Add tools/rcxml/rcxml-print-nodenames.c

This commit is contained in:
Johan Malm 2020-06-08 19:53:12 +01:00
parent 898d80e04f
commit 91ce33dd0d
4 changed files with 41 additions and 0 deletions

1
tools/rcxml/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
rcxml-print-nodenames

17
tools/rcxml/Makefile Normal file
View file

@ -0,0 +1,17 @@
CFLAGS = -g -O0 -Wall -Wextra -std=c11 -pedantic `xml2-config --cflags`
CFLAGS += -Wno-unused-parameter
CFLAGS += -I../../include
ASAN_FLAGS = -O0 -fsanitize=address -fno-common -fno-omit-frame-pointer -rdynamic
CFLAGS += $(ASAN_FLAGS)
LDFLAGS += $(ASAN_FLAGS) -fuse-ld=gold
LDFLAGS = `xml2-config --libs`
PROGS = rcxml-print-nodenames
all: $(PROGS)
rcxml-print-nodenames: rcxml-print-nodenames.c
$(CC) $(CFLAGS) -o $@ $^ ../../src/config/rcxml.c $(LDFLAGS)
clean:
rm -f $(PROGS)

5
tools/rcxml/README.md Normal file
View file

@ -0,0 +1,5 @@
Try
./rcxml-print-nodenames /etc/xdg/openbox/rc.xml
./rcxml-print-nodenames ../../data/rc.xml

View file

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