src/config/rcxml.c: optionally write nodenames to buffer

This commit is contained in:
Johan Malm 2020-06-09 22:01:19 +01:00
parent bc51e0ad2f
commit 1f5d8c3812
4 changed files with 19 additions and 9 deletions

View file

@ -3,16 +3,22 @@
#include <unistd.h>
#include "rcxml.h"
#include "buf.h"
struct rcxml rc = { 0 };
int main(int argc, char **argv)
{
struct buf b;
if (argc != 2) {
fprintf(stderr, "usage: %s <rc.xml file>\n", argv[0]);
exit(EXIT_FAILURE);
}
buf_init(&b);
rcxml_init(&rc);
rcxml_set_verbose();
rcxml_get_nodenames(&b);
rcxml_read(argv[1]);
printf("%s", b.buf);
free(b.buf);
}