mirror of
https://github.com/labwc/labwc.git
synced 2025-11-02 09:01:47 -05:00
Add tools/rcxml/rcxml-print-nodenames.c
This commit is contained in:
parent
898d80e04f
commit
91ce33dd0d
4 changed files with 41 additions and 0 deletions
1
tools/rcxml/.gitignore
vendored
Normal file
1
tools/rcxml/.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
rcxml-print-nodenames
|
||||
17
tools/rcxml/Makefile
Normal file
17
tools/rcxml/Makefile
Normal 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
5
tools/rcxml/README.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
Try
|
||||
|
||||
./rcxml-print-nodenames /etc/xdg/openbox/rc.xml
|
||||
./rcxml-print-nodenames ../../data/rc.xml
|
||||
|
||||
18
tools/rcxml/rcxml-print-nodenames.c
Normal file
18
tools/rcxml/rcxml-print-nodenames.c
Normal 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]);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue