Hi,
I would like to read a thin YAML file using a simple C program. I beleve the best way for this is to use the follow library: Pyyaml.org.
After reading the wiki page, I have try to use some examples here: http://pyyaml.org/browser/libyaml/branches/stable/tests/ But for a noob like me, it is not very simple to understand.
If for example I get this more simple YAML file (named test.yml):
test:
- {conf: hi}
- {conf: test}
- {conf: abc}
How can I do to do somethig like this:
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv)
{
/* I do not really see how to load the file here... */
char *conf[3] = {"hi", "test", "abc"}; /* configuration of the YAML file */
int i;
for (i = 0; i < 3; i++)
{
printf("content: %s\n", conf[i]);
}
return 0;
}
...but from the given YAML file?
Many thanks for any suggestions!