Add generic parser to cfg to struct.
This commit is contained in:
13
test.c
13
test.c
@@ -57,8 +57,17 @@ int main(void)
|
||||
else {
|
||||
printf("Error on getFile:%d\n",ret);
|
||||
}
|
||||
|
||||
parseConfig(content,&entry,sizeEntry);
|
||||
struct configEntry *entry=NULL;
|
||||
int returnedCount=0;
|
||||
int i=0;
|
||||
|
||||
entry = malloc(10*sizeof(struct configEntry));
|
||||
parseConfig(content,&entry,10*sizeof(struct configEntry),&returnedCount);
|
||||
|
||||
for(i=0;i<returnedCount;i++)
|
||||
{
|
||||
printf("i:%d/%d, struct section: %s, keyname: %s, keyvalue: %s\n",i,returnedCount,entry[i].sectionName,entry[i].keyName,entry[i].keyValue);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user