Compounds | |
struct | ekhtml_attr_t |
Attribute object, passed into callbacks. More... | |
struct | ekhtml_string_t |
A string object, which is not NUL terminated. More... | |
Defines | |
#define | EKHTML_BLOCKSIZE (1024 * 4) |
EKHTML_BLOCKSIZE = # of blocks to allocate per chunk. | |
Typedefs | |
typedef ekhtml_string_t | ekhtml_string_t |
A string object, which is not NUL terminated. More... | |
typedef ekhtml_attr_t | ekhtml_attr_t |
Attribute object, passed into callbacks. More... | |
typedef ekhtml_parser_t | ekhtml_parser_t |
The parser object. More... | |
typedef void(* | ekhtml_data_cb_t )(void *cbdata, ekhtml_string_t *data) |
Callback for simple data. More... | |
typedef void(* | ekhtml_starttag_cb_t )(void *cbdata, ekhtml_string_t *tag, ekhtml_attr_t *attrs) |
Callback for start tags. More... | |
typedef void(* | ekhtml_endtag_cb_t )(void *cbdata, ekhtml_string_t *tag) |
Callback for end tags. More... | |
Functions | |
ekhtml_parser_t * | ekhtml_parser_new (void *cbdata) |
Create a new parser object. More... | |
void | ekhtml_parser_destroy (ekhtml_parser_t *parser) |
Destroys a parser object and all memory associated with it. More... | |
void | ekhtml_parser_cbdata_set (ekhtml_parser_t *parser, void *cbdata) |
Set the callback data for the parser. More... | |
void | ekhtml_parser_datacb_set (ekhtml_parser_t *parser, ekhtml_data_cb_t cb) |
Set the parser's data callback. More... | |
void | ekhtml_parser_commentcb_set (ekhtml_parser_t *parser, ekhtml_data_cb_t cb) |
Set the parser's comment callback. More... | |
void | ekhtml_parser_feed (ekhtml_parser_t *parser, ekhtml_string_t *data) |
Feed data for the parser to process. More... | |
int | ekhtml_parser_flush (ekhtml_parser_t *parser, int flushall) |
Flush the parser innards. More... | |
void | ekhtml_parser_startcb_add (ekhtml_parser_t *parser, const char *tag, ekhtml_starttag_cb_t cb) |
Add a callback for a start tag. More... | |
void | ekhtml_parser_endcb_add (ekhtml_parser_t *parser, const char *tag, ekhtml_endtag_cb_t cb) |
Add a callback for an end tag. More... |
This header defines everything that a program should need to use the El-Kabong library.
|
Attribute object, passed into callbacks. When ekhtml parses tags containing key/value attributes, it will pass this structure representing those values into the callbacks. Note, for speed reasons, things such as the 'name' and 'value' fields are not terminated with '\0', and therefore have an associated length field (namelen, vallen). |
|
Callback for simple data. Callback functions of this form are used to process data which is not part of a start or end tag. This callback may also be used to process the body of comment tags. I.e. <FOO>data_to_process</FOO> The data passed into the callback function will be "data_to_process"
|
|
Callback for end tags. Callback functions of this form are used to process end tags. I.e. <FOO>data_to_process</FOO> The tag passed into the callback will be "FOO" with a length of 3.
|
|
The parser object. The parser object holds state information, such as which callbacks to invoke when reading tags, how much data is being processed, etc. |
|
Callback for start tags. Callback functions of this form are used to process start tags. I.e. <FOO>data_to_process</FOO> The tag passed into the callback will be "FOO" with a length of 3.
|
|
A string object, which is not NUL terminated. For speed reasons, El-Kabong does not deal with zero-terminated strings. |
|
Set the callback data for the parser. This routine sets the callback data which is passed to set callbacks.
|
|
Set the parser's comment callback. This routine sets the callback which should be invoked when the parser processes a comment.
|
|
Set the parser's data callback. This routine sets the callback which should be invoked for non-tagged data.
|
|
Destroys a parser object and all memory associated with it. After calling this routine, the parser should no longer be used, as any results would be undefined.
|
|
Add a callback for an end tag. This routine sets the callback which should be invoked when the parser processes an end tag. Both specific tags, and unknown tags can be used with this method.
|
|
Feed data for the parser to process. Feed data into the HTML parser. This routine will fill up the internal buffer until it can go no more, then flush the data and refill. If there is more data that is required than the internal buffer can hold, it will be resized
|
|
Flush the parser innards. When this function is invoked, the parser will flush all data that is currently held, and any remaining state is saved. All data which is processed is removed from the parser, and the internal buffer is reshuffled.
|
|
Create a new parser object. This routine creates a new parser object, with no set callback functions or state.
|
|
Add a callback for a start tag. This routine sets the callback which should be invoked when the parser processes a start tag. Both specific tags, and unknown tags can be used with this method.
|