Add generic parser to cfg to struct.

This commit is contained in:
jonathan santis
2025-05-14 09:41:41 +02:00
parent 4c2e79638d
commit 07bbca3143
5 changed files with 32 additions and 6 deletions

13
test.c
View File

@@ -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);
}