|
libcss
|
#include <assert.h>#include <ctype.h>#include <stdbool.h>#include <libwapcaplet/libwapcaplet.h>#include <parserutils/input/inputstream.h>#include <parserutils/utils/stack.h>#include <parserutils/utils/vector.h>#include "charset/detect.h"#include "lex/lex.h"#include "parse/parse.h"#include "utils/parserutilserror.h"#include "utils/utils.h"#include <stdio.h>Classes | |
| struct | parser_state |
| struct | css_parser |
Macros | |
| #define | STACK_CHUNK 32 |
Typedefs | |
| typedef struct parser_state | parser_state |
Enumerations | |
| enum | { sStart = 0 , sStylesheet = 1 , sStatement = 2 , sRuleset = 3 , sRulesetEnd = 4 , sAtRule = 5 , sAtRuleEnd = 6 , sBlock = 7 , sBlockContent = 8 , sSelector = 9 , sDeclaration = 10 , sDeclList = 11 , sDeclListEnd = 12 , sProperty = 13 , sValue0 = 14 , sValue1 = 15 , sValue = 16 , sAny0 = 17 , sAny1 = 18 , sAny = 19 , sMalformedDecl = 20 , sMalformedSelector = 21 , sMalformedAtRule = 22 , sInlineStyle = 23 , sISBody0 = 24 , sISBody = 25 , sMediaQuery = 26 } |
Functions | |
| void | parserutils_stack_dump (parserutils_stack *stack, const char *prefix, void(*printer)(void *item)) |
| void | parserutils_vector_dump (parserutils_vector *vector, const char *prefix, void(*printer)(void *item)) |
| css_error | css__parser_create (const char *charset, css_charset_source cs_source, css_parser **parser) |
| css_error | css__parser_create_for_inline_style (const char *charset, css_charset_source cs_source, css_parser **parser) |
| css_error | css__parser_create_for_media_query (const char *charset, css_charset_source cs_source, css_parser **parser) |
| css_error | css__parser_destroy (css_parser *parser) |
| css_error | css__parser_setopt (css_parser *parser, css_parser_opttype type, css_parser_optparams *params) |
| css_error | css__parser_parse_chunk (css_parser *parser, const uint8_t *data, size_t len) |
| css_error | css__parser_completed (css_parser *parser) |
| const char * | css__parser_read_charset (css_parser *parser, css_charset_source *source) |
| bool | css__parser_quirks_permitted (css_parser *parser) |
| #define STACK_CHUNK 32 |
| typedef struct parser_state parser_state |
Representation of a parser state
| anonymous enum |
Major state numbers
| css_error css__parser_completed | ( | css_parser * | parser | ) |
Inform a CSS parser that all data has been received.
| parser | The parser to inform |
| css_error css__parser_create | ( | const char * | charset, |
| css_charset_source | cs_source, | ||
| css_parser ** | parser | ||
| ) |
Create a CSS parser
| charset | Charset of data, if known, or NULL |
| cs_source | Source of charset information, or CSS_CHARSET_DEFAULT |
| parser | Pointer to location to receive parser instance |
| css_error css__parser_create_for_inline_style | ( | const char * | charset, |
| css_charset_source | cs_source, | ||
| css_parser ** | parser | ||
| ) |
Create a CSS parser for an inline style
| charset | Charset of data, if known, or NULL |
| cs_source | Source of charset information, or CSS_CHARSET_DEFAULT |
| parser | Pointer to location to receive parser instance |
| css_error css__parser_create_for_media_query | ( | const char * | charset, |
| css_charset_source | cs_source, | ||
| css_parser ** | parser | ||
| ) |
Create a CSS parser for a media query
| charset | Charset of data, if known, or NULL |
| cs_source | Source of charset information, or CSS_CHARSET_DEFAULT |
| parser | Pointer to location to receive parser instance |
| css_error css__parser_destroy | ( | css_parser * | parser | ) |
Destroy a CSS parser
| parser | The parser instance to destroy |
| css_error css__parser_parse_chunk | ( | css_parser * | parser, |
| const uint8_t * | data, | ||
| size_t | len | ||
| ) |
Parse a chunk of data using a CSS parser
| parser | The parser to use |
| data | Pointer to the chunk to parse |
| len | Length of chunk |
| bool css__parser_quirks_permitted | ( | css_parser * | parser | ) |
Quirks permitted when parsing
| parser | Parser to query |
| const char * css__parser_read_charset | ( | css_parser * | parser, |
| css_charset_source * | source | ||
| ) |
Retrieve document charset information from a CSS parser
| parser | The parser instance |
| source | Pointer to location to receive charset source |
| css_error css__parser_setopt | ( | css_parser * | parser, |
| css_parser_opttype | type, | ||
| css_parser_optparams * | params | ||
| ) |
Configure a CSS parser
| parser | The parser instance to configure |
| type | The option to configure |
| params | Option-specific data |
|
extern |
|
extern |