Some necesary fixups to cope with new location and FreeBSD CVS keyword.
This commit is contained in:
parent
4a2ff1a0f0
commit
02b4c46fb1
@ -61,6 +61,7 @@ struct mytree {
|
|||||||
struct node *top;
|
struct node *top;
|
||||||
struct node *cur;
|
struct node *cur;
|
||||||
int indent;
|
int indent;
|
||||||
|
int ignore;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ref {
|
struct ref {
|
||||||
@ -99,6 +100,11 @@ StartElement(void *userData, const char *name, const char **atts __unused)
|
|||||||
struct node *np;
|
struct node *np;
|
||||||
|
|
||||||
mt = userData;
|
mt = userData;
|
||||||
|
if (!strcmp(name, "FreeBSD")) {
|
||||||
|
mt->ignore = 1;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
mt->ignore = 0;
|
||||||
mt->indent += 2;
|
mt->indent += 2;
|
||||||
np = new_node();
|
np = new_node();
|
||||||
np->name = strdup(name);
|
np->name = strdup(name);
|
||||||
@ -116,6 +122,8 @@ EndElement(void *userData, const char *name __unused)
|
|||||||
struct node *np;
|
struct node *np;
|
||||||
|
|
||||||
mt = userData;
|
mt = userData;
|
||||||
|
if (mt->ignore)
|
||||||
|
return;
|
||||||
|
|
||||||
mt->indent -= 2;
|
mt->indent -= 2;
|
||||||
sbuf_finish(mt->cur->cont);
|
sbuf_finish(mt->cur->cont);
|
||||||
@ -136,6 +144,8 @@ CharData(void *userData , const XML_Char *s , int len)
|
|||||||
const char *b, *e;
|
const char *b, *e;
|
||||||
|
|
||||||
mt = userData;
|
mt = userData;
|
||||||
|
if (mt->ignore)
|
||||||
|
return;
|
||||||
b = s;
|
b = s;
|
||||||
e = s + len - 1;
|
e = s + len - 1;
|
||||||
while (isspace(*b) && b < e)
|
while (isspace(*b) && b < e)
|
||||||
@ -173,6 +183,8 @@ dofile(char *filename)
|
|||||||
fstat(fd, &st);
|
fstat(fd, &st);
|
||||||
p = mmap(NULL, st.st_size, PROT_READ, MAP_NOCORE|MAP_PRIVATE, fd, 0);
|
p = mmap(NULL, st.st_size, PROT_READ, MAP_NOCORE|MAP_PRIVATE, fd, 0);
|
||||||
i = XML_Parse(parser, p, st.st_size, 1);
|
i = XML_Parse(parser, p, st.st_size, 1);
|
||||||
|
if (i != 1)
|
||||||
|
errx(1, "XML_Parse complained -> %d", i);
|
||||||
munmap(p, st.st_size);
|
munmap(p, st.st_size);
|
||||||
close(fd);
|
close(fd);
|
||||||
XML_ParserFree(parser);
|
XML_ParserFree(parser);
|
||||||
|
@ -25,3 +25,10 @@ test: ${PROG}
|
|||||||
if ./${PROG} a1.conf a1b.conf > /dev/null 2>&1 ; then exit 1 ; fi
|
if ./${PROG} a1.conf a1b.conf > /dev/null 2>&1 ; then exit 1 ; fi
|
||||||
if ./${PROG} a1.conf a1c.conf > /dev/null 2>&1 ; then exit 1 ; fi
|
if ./${PROG} a1.conf a1c.conf > /dev/null 2>&1 ; then exit 1 ; fi
|
||||||
if ./${PROG} a1.conf a1d.conf > /dev/null 2>&1 ; then exit 1 ; fi
|
if ./${PROG} a1.conf a1d.conf > /dev/null 2>&1 ; then exit 1 ; fi
|
||||||
|
|
||||||
|
ttest: ${PROG}
|
||||||
|
rm -f _* *.core
|
||||||
|
./${PROG} a1.conf a1a.conf
|
||||||
|
./${PROG} a1.conf a1b.conf
|
||||||
|
./${PROG} a1.conf a1c.conf
|
||||||
|
./${PROG} a1.conf a1d.conf
|
||||||
|
@ -9,7 +9,7 @@ SRCS= geom.c geom_bsd.c geom_simdev.c geom_dump.c geom_event.c geom_io.c \
|
|||||||
|
|
||||||
CFLAGS+= -g -static -W -Wall
|
CFLAGS+= -g -static -W -Wall
|
||||||
CFLAGS+= -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith
|
CFLAGS+= -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith
|
||||||
CFLAGS += -I/usr/local/include/xml -I/usr/src/sys
|
CFLAGS += -I/usr/local/include/xml -I/usr/src/sys -I..
|
||||||
NOPIC = static
|
NOPIC = static
|
||||||
NOPROFILE = bingo
|
NOPROFILE = bingo
|
||||||
NOOBJ = youbet
|
NOOBJ = youbet
|
||||||
|
@ -4,7 +4,7 @@ PROG = testprg
|
|||||||
NOMAN = no
|
NOMAN = no
|
||||||
NOOBJ = youbet
|
NOOBJ = youbet
|
||||||
CFLAGS += -g -W -Wall -Wstrict-prototypes -Wmissing-prototypes
|
CFLAGS += -g -W -Wall -Wstrict-prototypes -Wmissing-prototypes
|
||||||
CFLAGS += -Wpointer-arith -static -I/usr/src/sys
|
CFLAGS += -Wpointer-arith -static -I/usr/src/sys -I../..
|
||||||
LDADD += -L../../GLib -lG
|
LDADD += -L../../GLib -lG
|
||||||
LDADD += -L/usr/local/lib -lexpat
|
LDADD += -L/usr/local/lib -lexpat
|
||||||
DPADD += ../../GLib/libG.a
|
DPADD += ../../GLib/libG.a
|
||||||
|
Loading…
Reference in New Issue
Block a user