-
-
Notifications
You must be signed in to change notification settings - Fork 496
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
array in ini file for ini parser stream to parse #120
Comments
Hi @chienhsinlin, there's no special provision for this in inih itself, but you can definitely parse comma-separated values in the handler yourself -- use something like If the values for one key are spread across multiple lines, you'll also want to set
Then you'll receive two separate calls to your handler function with the same section and key name, and you'll need to save the last Hope that helps! |
Thanks a lot, It works now after using strtok in the handler to parse each line and tokenize strings with delimiter. |
Something like that. as you said idx is global variable.
|
|
Hi @silly2020, do you have |
Hi, @benhoyt , thanks for prompt reply.
what I got with dump:
|
This is a bug fix that makes inih's behaviour here work as per Python's ConfigParser, which is what inih behaviour is (loosely) based on. Thanks @silly2020 for the report. See #120 (comment)
This is a bug fix that makes inih's behaviour here work as per Python's ConfigParser, which is what inih behaviour is (loosely) based on. Thanks @silly2020 for the report. See #120 (comment)
@silly2020 Thanks for the report. This is an oversight (bug!) in inih, and differs from how Python's |
@benhoyt Yes. I tested again with |
Hi!:
I have an array in a ini file like
[section1]
key1 = value1
key2 = value2
.....
lut_table =
1, 2, 3, 4, 5, 6, 7, 8,
9, 10, 11, 12, 13, 14, 15, 16
......
In the structure, it is defined as
struct {
...
int lut_table[16];
}
for(i=0; i<16; i++)
pconfig.lut_table[i] = atoi[multi_value] something?
Can I implement something in the ini_parse_stream to read values for this array? any suggestions? Or something similar like simpleIni to have a key whic has multivalues?
The text was updated successfully, but these errors were encountered: