1
0
Fork 0
flightgear/utils/xmlgrep
2008-06-29 13:33:26 +00:00
..
.cvsignore Add an XML grep utility. It's far from complete but it allowed me to test the animation files for the precense of the 'offset' element in the translation animation sections. 2005-09-24 12:31:41 +00:00
ChangeLog Erik HOFMAN: add documentation/changelog 2008-06-29 13:33:26 +00:00
Makefile.am Erik HOFMAN: faster and better xmlgrep implementation 2008-06-29 13:08:24 +00:00
README Erik HOFMAN: add documentation/changelog 2008-06-29 13:33:26 +00:00
xml.c Erik HOFMAN: faster and better xmlgrep implementation 2008-06-29 13:08:24 +00:00
xml.h Erik HOFMAN: faster and better xmlgrep implementation 2008-06-29 13:08:24 +00:00
xmlgrep.c Erik HOFMAN: faster and better xmlgrep implementation 2008-06-29 13:08:24 +00:00

#
# Functions to Open and Close the XML file
# e.g.
#   id = xmlOpen("/tmp/file.xml");
#   xmlClose(id);
#
void *xmlOpen(const char *);
void xmlClose(const void *);

#
# Get the Id of a node at the specified path
# e.g.
#    xnid = xmlGetNode(id, "/path/to/specified/node");
#
void *xmlGetNode(const void *, const char *);
void *xmlCopyNode(void *, const char *);

#
# Functions to walk the node tree an process them one by one.
# e.g.
#   xmid = xmlMarkId(id);
#   num = xmlGetNumElements(xmid);
#   for (i=0; i<num; i++) {
#      if (xmlGetNextElement(id, xmid, "element") != 0) {
#         if ((s = xmlGetString(xmid)) != 0) {
#            printf("%s\n", s);
#            free(s);
#         }
#      }
#   }
#
void *xmlMarkId(void *);
unsigned int xmlGetNumElements(void *, const char *);
void *xmlGetNextElement(const void *, void *, const char *);

#
# These functions work on the current node.
# e.g.
#    xnid = xmlGetNode(id, "/path/to/last/node");
#    i = xmlGetInt(xnid);
# or
#    xnid = xmlGetNode(id, "/path/to/specified/node");
#    if (xmlCompareString(xnid, "value") == 0) printf("We have a match!\n");
#
long int xmlGetInt(void *);
double xmlGetDouble(void *);
char *xmlGetString(void *);
int xmlCompareString(const void *, const char *);

#
# These functions work on a specified node path
# e.g.
#    d = xmlGetNodeDouble(id, "/path/to/node");
# or
#    xnid = xmlGetNode(id, "/path/to");
#    i = xmlGetNodeInt(xnid, "node");
#
long int xmlGetNodeInt(void *, const char *);
double xmlGetNodeDouble(void *, const char *);
char *xmlGetNodeString(void *, const char *);
unsigned xmlCopyNodeString(void *, const char *, char *, const unsigned int);
int xmlCompareNodeString(const void *, const char *, const char *);