GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> XLX / dev > parser / sun-gcc
#include <XLX_p.h>
#include <EXPAT/expat.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
Functions | |
| int | XLX_initState (XLX_state *state, unsigned int stackLimit, void *stackSeed, XLX_pDoctype doctype, XLX_pEnter enter, XLX_pExit exit, XLX_pChar character, int verbose) |
| Initialise the state of the parser. | |
| void | XLX_doctype (void *data, const char *name, const char *sysId, const char *pubId, int intSubset) |
| Handle a doctype declaration. | |
| void | XLX_start (void *data, const char *element, const char **attribute) |
| Handle a start tag. | |
| void | XLX_end (void *data, const char *element) |
| Handle an end tag. | |
| void | XLX_character (void *data, const char *element, int len) |
| Handle a character element. | |
| void | XLX_printout_down (XLX_state *state, const char *element) |
| Print a starting tag. | |
| void | XLX_printout_up (XLX_state *state, const char *element) |
| Print an ending tag. | |
| void | XLX_character_noop (XLX_state *state, const char *element, int len) |
| No-op character element handler. | |
| void | XLX_enter_noop (XLX_state *state, const char **attribute) |
| No-op enter element handler. | |
| void | XLX_exit_noop (XLX_state *state) |
| No-op exit element handler. | |
| void | XLX_character_tag (XLX_state *state, const char *element, int len) |
| Handle a character element inside a parent tag by delegating the work to the first child. | |
| void XLX_character | ( | void * | data, | |
| const char * | element, | |||
| int | len | |||
| ) |
Handle a character element.
| data | Pointer to the current state of the parser | |
| element | Character element | |
| len | Length of the character element |
References _XLX_state::character, _XLX_basic_tag::character, _XLX_state::error, _XLX_state::st, and XLX_peek().
Referenced by XLX_character_tag(), and XLX_parse().
| void XLX_character_noop | ( | XLX_state * | state, | |
| const char * | element, | |||
| int | len | |||
| ) |
No-op character element handler.
| state | Pointer to the current state of the parser | |
| element | The text string from the current element | |
| len | Length of element |
| void XLX_character_tag | ( | XLX_state * | state, | |
| const char * | element, | |||
| int | len | |||
| ) |
Handle a character element inside a parent tag by delegating the work to the first child.
If there are valid characters in the character element then the first child of the current tag is pushed onto the stack and then XLX_character is called to handle the character parsing. After the parsing is complete the child is popped off the stack.
| state | Pointer to the current state of the parser | |
| element | Character element | |
| len | Length of the character element |
References _XLX_parent_tag::child, _XLX_state::st, XLX_character(), XLX_ischar(), XLX_peek(), XLX_pop(), and XLX_push().
| void XLX_doctype | ( | void * | data, | |
| const char * | name, | |||
| const char * | sysId, | |||
| const char * | pubId, | |||
| int | intSubset | |||
| ) |
Handle a doctype declaration.
| data | Pointer to the current state of the parser | |
| name | The doctype name | |
| sysId | The system ID name | |
| pubId | The public ID name | |
| intSubset | True if internal subset |
References _XLX_state::doctype.
Referenced by XLX_parse().
| void XLX_end | ( | void * | data, | |
| const char * | element | |||
| ) |
Handle an end tag.
| data | Pointer to the current state of the parser | |
| element | Element name from end tag |
References _XLX_state::error, _XLX_state::exit, _XLX_parent_tag::exit, _XLX_basic_tag::name, _XLX_state::parser, _XLX_state::st, _XLX_state::verbose, XLX_dispFileName(), XLX_pop(), XLX_printout_up(), and _XLX_basic_tag::xType.
Referenced by XLX_parse().
| void XLX_enter_noop | ( | XLX_state * | state, | |
| const char ** | attribute | |||
| ) |
No-op enter element handler.
| state | Pointer to the current state of the parser | |
| attribute | Attribute list for the current element |
| void XLX_exit_noop | ( | XLX_state * | state | ) |
No-op exit element handler.
| state | Pointer to the current state of the parser |
| int XLX_initState | ( | XLX_state * | state, | |
| unsigned int | stackLimit, | |||
| void * | stackSeed, | |||
| XLX_pDoctype | doctype, | |||
| XLX_pEnter | enter, | |||
| XLX_pExit | exit, | |||
| XLX_pChar | character, | |||
| int | verbose | |||
| ) |
Initialise the state of the parser.
| state | Pointer to the state information | |
| stackLimit | Initial depth of the stack | |
| stackSeed | Initial item on the stack | |
| doctype | Action on encountering a doctype declaration | |
| enter | Parser default action on encountering an enter tag | |
| exit | Parser default action on encountering an exit tag | |
| character | Parser default action on encountering a character tag | |
| verbose | Verbosity level of the parser: 0 is quiet, 1 displays file name after error messages, > 1 displays information messages |
| 0 | Success | |
| -1 | Insufficient memory |
References _XLX_state::character, _XLX_state::doctype, _XLX_state::enter, _XLX_state::error, _XLX_state::exit, _XLX_state::fName, _XLX_state::parser, _XLX_state::st, _XLX_state::verbose, XLX_initStack(), and XLX_push().
| void XLX_printout_down | ( | XLX_state * | state, | |
| const char * | element | |||
| ) |
Print a starting tag.
| state | Pointer to the current state of the parser | |
| element | Text string from the current tag |
References _XLX_state::st, _XLX_stack::used, and _XLX_state::verbose.
Referenced by XLX_start().
| void XLX_printout_up | ( | XLX_state * | state, | |
| const char * | element | |||
| ) |
Print an ending tag.
| state | Pointer to the current state of the parser | |
| element | Text string from the current tag |
References _XLX_state::st, _XLX_stack::used, and _XLX_state::verbose.
Referenced by XLX_end().
| void XLX_start | ( | void * | data, | |
| const char * | element, | |||
| const char ** | attribute | |||
| ) |
Handle a start tag.
| data | Pointer to the current state of the parser | |
| element | Element name from start tag | |
| attribute | Attribute list from the start tag |
References _XLX_parent_tag::base, _XLX_parent_tag::child, _XLX_state::enter, _XLX_parent_tag::enter, _XLX_state::error, _XLX_basic_tag::name, _XLX_state::parser, _XLX_parent_tag::self, _XLX_state::st, _XLX_state::verbose, XLX_dispFileName(), XLX_peek(), XLX_printout_down(), XLX_push(), and _XLX_basic_tag::xType.
Referenced by XLX_parse().
1.5.8