From 9a026637586cc90ce3418e945210c90313434306 Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Wed, 26 Jan 2011 12:49:58 +0000 Subject: Rename all css_[^_] internal symbols to css__ so that they're nicely namespaced svn path=/trunk/libcss/; revision=11492 --- src/charset/detect.c | 2 +- src/charset/detect.h | 2 +- src/lex/lex.c | 8 +- src/lex/lex.h | 8 +- src/parse/language.c | 110 +++++++++++------------ src/parse/language.h | 4 +- src/parse/parse.c | 40 ++++----- src/parse/parse.h | 14 +-- src/parse/properties/azimuth.c | 4 +- src/parse/properties/background.c | 60 ++++++------- src/parse/properties/background_position.c | 10 +-- src/parse/properties/border_color.c | 4 +- src/parse/properties/border_spacing.c | 6 +- src/parse/properties/border_style.c | 2 +- src/parse/properties/border_width.c | 6 +- src/parse/properties/clip.c | 8 +- src/parse/properties/content.c | 32 +++---- src/parse/properties/css_property_parser_gen.c | 32 +++---- src/parse/properties/cursor.c | 6 +- src/parse/properties/elevation.c | 4 +- src/parse/properties/font.c | 74 ++++++++-------- src/parse/properties/font_family.c | 2 +- src/parse/properties/font_weight.c | 2 +- src/parse/properties/list_style.c | 30 +++---- src/parse/properties/list_style_type.c | 2 +- src/parse/properties/margin.c | 6 +- src/parse/properties/outline.c | 30 +++---- src/parse/properties/padding.c | 6 +- src/parse/properties/play_during.c | 6 +- src/parse/properties/quotes.c | 14 +-- src/parse/properties/text_decoration.c | 4 +- src/parse/properties/utils.c | 42 ++++----- src/parse/properties/voice_family.c | 2 +- src/select/hash.c | 18 ++-- src/select/hash.h | 18 ++-- src/select/properties/content.c | 4 +- src/select/properties/cursor.c | 2 +- src/select/properties/font_family.c | 2 +- src/select/properties/helpers.c | 4 +- src/select/properties/play_during.c | 2 +- src/select/properties/quotes.c | 4 +- src/select/properties/voice_family.c | 2 +- src/select/select.c | 8 +- src/stylesheet.c | 118 ++++++++++++------------- src/stylesheet.h | 50 +++++------ 45 files changed, 407 insertions(+), 407 deletions(-) (limited to 'src') diff --git a/src/charset/detect.c b/src/charset/detect.c index 9f8da69..a6b2346 100644 --- a/src/charset/detect.c +++ b/src/charset/detect.c @@ -35,7 +35,7 @@ static parserutils_error try_ascii_compatible_charset(const uint8_t *data, * * CSS 2.1 $4.4 */ -parserutils_error css_charset_extract(const uint8_t *data, size_t len, +parserutils_error css__charset_extract(const uint8_t *data, size_t len, uint16_t *mibenum, uint32_t *source) { parserutils_error error; diff --git a/src/charset/detect.h b/src/charset/detect.h index d907921..c963ebd 100644 --- a/src/charset/detect.h +++ b/src/charset/detect.h @@ -17,7 +17,7 @@ #include /* Extract a charset from a chunk of data */ -parserutils_error css_charset_extract(const uint8_t *data, size_t len, +parserutils_error css__charset_extract(const uint8_t *data, size_t len, uint16_t *mibenum, uint32_t *source); #endif diff --git a/src/lex/lex.c b/src/lex/lex.c index 194161d..7b258bd 100644 --- a/src/lex/lex.c +++ b/src/lex/lex.c @@ -176,7 +176,7 @@ static inline bool isSpace(uint8_t c); * CSS_BADPARM on bad parameters, * CSS_NOMEM on memory exhaustion */ -css_error css_lexer_create(parserutils_inputstream *input, +css_error css__lexer_create(parserutils_inputstream *input, css_allocator_fn alloc, void *pw, css_lexer **lexer) { css_lexer *lex; @@ -214,7 +214,7 @@ css_error css_lexer_create(parserutils_inputstream *input, * \param lexer The instance to destroy * \return CSS_OK on success, appropriate error otherwise */ -css_error css_lexer_destroy(css_lexer *lexer) +css_error css__lexer_destroy(css_lexer *lexer) { if (lexer == NULL) return CSS_BADPARM; @@ -235,7 +235,7 @@ css_error css_lexer_destroy(css_lexer *lexer) * \param params Option-specific parameters * \return CSS_OK on success, appropriate error otherwise */ -css_error css_lexer_setopt(css_lexer *lexer, css_lexer_opttype type, +css_error css__lexer_setopt(css_lexer *lexer, css_lexer_opttype type, css_lexer_optparams *params) { if (lexer == NULL || params == NULL) @@ -267,7 +267,7 @@ css_error css_lexer_setopt(css_lexer *lexer, css_lexer_opttype type, * does not depend on these remaining constant. This allows the client code * to efficiently implement a push-back buffer with interned string data. */ -css_error css_lexer_get_token(css_lexer *lexer, css_token **token) +css_error css__lexer_get_token(css_lexer *lexer, css_token **token) { css_error error; diff --git a/src/lex/lex.h b/src/lex/lex.h index 3736126..16ba77d 100644 --- a/src/lex/lex.h +++ b/src/lex/lex.h @@ -66,14 +66,14 @@ typedef struct css_token { uint32_t line; } css_token; -css_error css_lexer_create(parserutils_inputstream *input, +css_error css__lexer_create(parserutils_inputstream *input, css_allocator_fn alloc, void *pw, css_lexer **lexer); -css_error css_lexer_destroy(css_lexer *lexer); +css_error css__lexer_destroy(css_lexer *lexer); -css_error css_lexer_setopt(css_lexer *lexer, css_lexer_opttype type, +css_error css__lexer_setopt(css_lexer *lexer, css_lexer_opttype type, css_lexer_optparams *params); -css_error css_lexer_get_token(css_lexer *lexer, css_token **token); +css_error css__lexer_get_token(css_lexer *lexer, css_token **token); #endif diff --git a/src/parse/language.c b/src/parse/language.c index ca21996..c003ed6 100644 --- a/src/parse/language.c +++ b/src/parse/language.c @@ -101,7 +101,7 @@ static css_error parseProperty(css_language *c, * CSS_BADPARM on bad parameters, * CSS_NOMEM on memory exhaustion */ -css_error css_language_create(css_stylesheet *sheet, css_parser *parser, +css_error css__language_create(css_stylesheet *sheet, css_parser *parser, css_allocator_fn alloc, void *pw, void **language) { css_language *c; @@ -141,7 +141,7 @@ css_error css_language_create(css_stylesheet *sheet, css_parser *parser, params.event_handler.handler = language_handle_event; params.event_handler.pw = c; - error = css_parser_setopt(parser, CSS_PARSER_EVENT_HANDLER, ¶ms); + error = css__parser_setopt(parser, CSS_PARSER_EVENT_HANDLER, ¶ms); if (error != CSS_OK) { parserutils_stack_destroy(c->context); alloc(c, 0, pw); @@ -164,7 +164,7 @@ css_error css_language_create(css_stylesheet *sheet, css_parser *parser, * \param language The parser to destroy * \return CSS_OK on success, appropriate error otherwise */ -css_error css_language_destroy(css_language *language) +css_error css__language_destroy(css_language *language) { int i; @@ -281,7 +281,7 @@ css_error handleStartRuleset(css_language *c, const parserutils_vector *vector) if (cur != NULL && cur->type != CSS_PARSER_START_STYLESHEET) parent_rule = cur->data; - error = css_stylesheet_rule_create(c->sheet, CSS_RULE_SELECTOR, &rule); + error = css__stylesheet_rule_create(c->sheet, CSS_RULE_SELECTOR, &rule); if (error != CSS_OK) return error; @@ -289,7 +289,7 @@ css_error handleStartRuleset(css_language *c, const parserutils_vector *vector) /* Parse selectors, if there are any */ error = parseSelectorList(c, vector, rule); if (error != CSS_OK) { - css_stylesheet_rule_destroy(c->sheet, rule); + css__stylesheet_rule_destroy(c->sheet, rule); return error; } } @@ -298,14 +298,14 @@ css_error handleStartRuleset(css_language *c, const parserutils_vector *vector) perror = parserutils_stack_push(c->context, (void *) &entry); if (perror != PARSERUTILS_OK) { - css_stylesheet_rule_destroy(c->sheet, rule); + css__stylesheet_rule_destroy(c->sheet, rule); return css_error_from_parserutils_error(perror); } - error = css_stylesheet_add_rule(c->sheet, rule, parent_rule); + error = css__stylesheet_add_rule(c->sheet, rule, parent_rule); if (error != CSS_OK) { parserutils_stack_pop(c->context, NULL); - css_stylesheet_rule_destroy(c->sheet, rule); + css__stylesheet_rule_destroy(c->sheet, rule); return error; } @@ -380,21 +380,21 @@ css_error handleStartAtRule(css_language *c, const parserutils_vector *vector) if (token != NULL) return CSS_INVALID; - error = css_stylesheet_rule_create(c->sheet, + error = css__stylesheet_rule_create(c->sheet, CSS_RULE_CHARSET, &rule); if (error != CSS_OK) return error; - error = css_stylesheet_rule_set_charset(c->sheet, rule, + error = css__stylesheet_rule_set_charset(c->sheet, rule, charset->idata); if (error != CSS_OK) { - css_stylesheet_rule_destroy(c->sheet, rule); + css__stylesheet_rule_destroy(c->sheet, rule); return error; } - error = css_stylesheet_add_rule(c->sheet, rule, NULL); + error = css__stylesheet_add_rule(c->sheet, rule, NULL); if (error != CSS_OK) { - css_stylesheet_rule_destroy(c->sheet, rule); + css__stylesheet_rule_destroy(c->sheet, rule); return error; } @@ -428,7 +428,7 @@ css_error handleStartAtRule(css_language *c, const parserutils_vector *vector) return error; /* Create rule */ - error = css_stylesheet_rule_create(c->sheet, + error = css__stylesheet_rule_create(c->sheet, CSS_RULE_IMPORT, &rule); if (error != CSS_OK) return error; @@ -438,16 +438,16 @@ css_error handleStartAtRule(css_language *c, const parserutils_vector *vector) c->sheet->url, uri->idata, &url); if (error != CSS_OK) { - css_stylesheet_rule_destroy(c->sheet, rule); + css__stylesheet_rule_destroy(c->sheet, rule); return error; } /* Inform rule of it */ - error = css_stylesheet_rule_set_nascent_import(c->sheet, + error = css__stylesheet_rule_set_nascent_import(c->sheet, rule, url, media); if (error != CSS_OK) { lwc_string_unref(url); - css_stylesheet_rule_destroy(c->sheet, rule); + css__stylesheet_rule_destroy(c->sheet, rule); return error; } @@ -457,7 +457,7 @@ css_error handleStartAtRule(css_language *c, const parserutils_vector *vector) c->sheet, url, media); if (error != CSS_OK) { lwc_string_unref(url); - css_stylesheet_rule_destroy(c->sheet, + css__stylesheet_rule_destroy(c->sheet, rule); return error; } @@ -467,9 +467,9 @@ css_error handleStartAtRule(css_language *c, const parserutils_vector *vector) lwc_string_unref(url); /* Add rule to sheet */ - error = css_stylesheet_add_rule(c->sheet, rule, NULL); + error = css__stylesheet_add_rule(c->sheet, rule, NULL); if (error != CSS_OK) { - css_stylesheet_rule_destroy(c->sheet, rule); + css__stylesheet_rule_destroy(c->sheet, rule); return error; } @@ -490,20 +490,20 @@ css_error handleStartAtRule(css_language *c, const parserutils_vector *vector) if (error != CSS_OK) return error; - error = css_stylesheet_rule_create(c->sheet, + error = css__stylesheet_rule_create(c->sheet, CSS_RULE_MEDIA, &rule); if (error != CSS_OK) return error; - error = css_stylesheet_rule_set_media(c->sheet, rule, media); + error = css__stylesheet_rule_set_media(c->sheet, rule, media); if (error != CSS_OK) { - css_stylesheet_rule_destroy(c->sheet, rule); + css__stylesheet_rule_destroy(c->sheet, rule); return error; } - error = css_stylesheet_add_rule(c->sheet, rule, NULL); + error = css__stylesheet_add_rule(c->sheet, rule, NULL); if (error != CSS_OK) { - css_stylesheet_rule_destroy(c->sheet, rule); + css__stylesheet_rule_destroy(c->sheet, rule); return error; } @@ -517,7 +517,7 @@ css_error handleStartAtRule(css_language *c, const parserutils_vector *vector) /* any0 = (':' IDENT)? ws */ - error = css_stylesheet_rule_create(c->sheet, + error = css__stylesheet_rule_create(c->sheet, CSS_RULE_PAGE, &rule); if (error != CSS_OK) return error; @@ -530,22 +530,22 @@ css_error handleStartAtRule(css_language *c, const parserutils_vector *vector) error = parseSelector(c, vector, &ctx, &sel); if (error != CSS_OK) { - css_stylesheet_rule_destroy(c->sheet, rule); + css__stylesheet_rule_destroy(c->sheet, rule); return error; } - error = css_stylesheet_rule_set_page_selector(c->sheet, + error = css__stylesheet_rule_set_page_selector(c->sheet, rule, sel); if (error != CSS_OK) { - css_stylesheet_selector_destroy(c->sheet, sel); - css_stylesheet_rule_destroy(c->sheet, rule); + css__stylesheet_selector_destroy(c->sheet, sel); + css__stylesheet_rule_destroy(c->sheet, rule); return error; } } - error = css_stylesheet_add_rule(c->sheet, rule, NULL); + error = css__stylesheet_add_rule(c->sheet, rule, NULL); if (error != CSS_OK) { - css_stylesheet_rule_destroy(c->sheet, rule); + css__stylesheet_rule_destroy(c->sheet, rule); return error; } @@ -819,7 +819,7 @@ css_error parseClass(css_language *c, const parserutils_vector *vector, if (token == NULL || token->type != CSS_TOKEN_IDENT) return CSS_INVALID; - return css_stylesheet_selector_detail_init(c->sheet, + return css__stylesheet_selector_detail_init(c->sheet, CSS_SELECTOR_CLASS, token->idata, NULL, specific); } @@ -877,7 +877,7 @@ css_error parseAttrib(css_language *c, const parserutils_vector *vector, return CSS_INVALID; } - return css_stylesheet_selector_detail_init(c->sheet, type, + return css__stylesheet_selector_detail_init(c->sheet, type, name->idata, value != NULL ? value->idata : NULL, specific); } @@ -966,7 +966,7 @@ css_error parsePseudo(css_language *c, const parserutils_vector *vector, else return CSS_INVALID; - return css_stylesheet_selector_detail_init(c->sheet, + return css__stylesheet_selector_detail_init(c->sheet, type, name->idata, value != NULL ? value->idata : NULL, specific); } @@ -986,7 +986,7 @@ css_error parseSpecific(css_language *c, return CSS_INVALID; if (token->type == CSS_TOKEN_HASH) { - error = css_stylesheet_selector_detail_init(c->sheet, + error = css__stylesheet_selector_detail_init(c->sheet, CSS_SELECTOR_ID, token->idata, NULL, &specific); if (error != CSS_OK) return error; @@ -1008,7 +1008,7 @@ css_error parseSpecific(css_language *c, return CSS_INVALID; } - return css_stylesheet_selector_append_specific(c->sheet, parent, + return css__stylesheet_selector_append_specific(c->sheet, parent, &specific); } @@ -1052,7 +1052,7 @@ css_error parseSimpleSelector(css_language *c, if (token->type == CSS_TOKEN_IDENT || tokenIsChar(token, '*')) { /* Have element name */ - error = css_stylesheet_selector_create(c->sheet, + error = css__stylesheet_selector_create(c->sheet, token->idata, &selector); if (error != CSS_OK) return error; @@ -1060,7 +1060,7 @@ css_error parseSimpleSelector(css_language *c, parserutils_vector_iterate(vector, ctx); } else { /* Universal selector */ - error = css_stylesheet_selector_create(c->sheet, + error = css__stylesheet_selector_create(c->sheet, c->strings[UNIVERSAL], &selector); if (error != CSS_OK) return error; @@ -1068,14 +1068,14 @@ css_error parseSimpleSelector(css_language *c, /* Ensure we have at least one specific selector */ error = parseSpecific(c, vector, ctx, &selector); if (error != CSS_OK) { - css_stylesheet_selector_destroy(c->sheet, selector); + css__stylesheet_selector_destroy(c->sheet, selector); return error; } } error = parseSelectorSpecifics(c, vector, ctx, &selector); if (error != CSS_OK) { - css_stylesheet_selector_destroy(c->sheet, selector); + css__stylesheet_selector_destroy(c->sheet, selector); return error; } @@ -1171,10 +1171,10 @@ css_error parseSelector(css_language *c, const parserutils_vector *vector, *result = other; - error = css_stylesheet_selector_combine(c->sheet, + error = css__stylesheet_selector_combine(c->sheet, comb, selector, other); if (error != CSS_OK) { - css_stylesheet_selector_destroy(c->sheet, selector); + css__stylesheet_selector_destroy(c->sheet, selector); return error; } @@ -1200,15 +1200,15 @@ css_error parseSelectorList(css_language *c, const parserutils_vector *vector, error = parseSelector(c, vector, &ctx, &selector); if (error != CSS_OK) { if (selector != NULL) - css_stylesheet_selector_destroy(c->sheet, selector); + css__stylesheet_selector_destroy(c->sheet, selector); return error; } assert(selector != NULL); - error = css_stylesheet_rule_add_selector(c->sheet, rule, selector); + error = css__stylesheet_rule_add_selector(c->sheet, rule, selector); if (error != CSS_OK) { - css_stylesheet_selector_destroy(c->sheet, selector); + css__stylesheet_selector_destroy(c->sheet, selector); return error; } @@ -1224,7 +1224,7 @@ css_error parseSelectorList(css_language *c, const parserutils_vector *vector, error = parseSelector(c, vector, &ctx, &selector); if (error != CSS_OK) { if (selector != NULL) { - css_stylesheet_selector_destroy(c->sheet, + css__stylesheet_selector_destroy(c->sheet, selector); } return error; @@ -1232,10 +1232,10 @@ css_error parseSelectorList(css_language *c, const parserutils_vector *vector, assert(selector != NULL); - error = css_stylesheet_rule_add_selector(c->sheet, rule, + error = css__stylesheet_rule_add_selector(c->sheet, rule, selector); if (error != CSS_OK) { - css_stylesheet_selector_destroy(c->sheet, selector); + css__stylesheet_selector_destroy(c->sheet, selector); return error; } } @@ -1274,7 +1274,7 @@ css_error parseProperty(css_language *c, const css_token *property, assert(handler != NULL); /* allocate style */ - error = css_stylesheet_style_create(c->sheet, &style); + error = css__stylesheet_style_create(c->sheet, &style); if (error != CSS_OK) return error; @@ -1283,14 +1283,14 @@ css_error parseProperty(css_language *c, const css_token *property, /* Call the handler */ error = handler(c, vector, ctx, style); if (error != CSS_OK) { - css_stylesheet_style_destroy(style); + css__stylesheet_style_destroy(style); return error; } /* Determine if this declaration is important or not */ error = css__parse_important(c, vector, ctx, &flags); if (error != CSS_OK) { - css_stylesheet_style_destroy(style); + css__stylesheet_style_destroy(style); return error; } @@ -1299,7 +1299,7 @@ css_error parseProperty(css_language *c, const css_token *property, token = parserutils_vector_iterate(vector, ctx); if (token != NULL) { /* Trailing junk, so discard declaration */ - css_stylesheet_style_destroy(style); + css__stylesheet_style_destroy(style); return CSS_INVALID; } @@ -1308,9 +1308,9 @@ css_error parseProperty(css_language *c, const css_token *property, css__make_style_important(style); /* Append style to rule */ - error = css_stylesheet_rule_append_style(c->sheet, rule, style); + error = css__stylesheet_rule_append_style(c->sheet, rule, style); if (error != CSS_OK) { - css_stylesheet_style_destroy(style); + css__stylesheet_style_destroy(style); return error; } diff --git a/src/parse/language.h b/src/parse/language.h index 73f6b2c..39b7222 100644 --- a/src/parse/language.h +++ b/src/parse/language.h @@ -41,9 +41,9 @@ typedef struct css_language { void *pw; /**< Client's private data */ } css_language; -css_error css_language_create(css_stylesheet *sheet, css_parser *parser, +css_error css__language_create(css_stylesheet *sheet, css_parser *parser, css_allocator_fn alloc, void *pw, void **language); -css_error css_language_destroy(css_language *language); +css_error css__language_destroy(css_language *language); /****************************************************************************** * Helper functions * diff --git a/src/parse/parse.c b/src/parse/parse.c index e4b4d2d..669df53 100644 --- a/src/parse/parse.c +++ b/src/parse/parse.c @@ -113,7 +113,7 @@ struct css_parser void *pw; /**< Client-specific private data */ }; -static css_error css_parser_create_internal(const char *charset, +static css_error css__parser_create_internal(const char *charset, css_charset_source cs_source, css_allocator_fn alloc, void *pw, parser_state initial, css_parser **parser); @@ -200,13 +200,13 @@ static css_error (*parseFuncs[])(css_parser *parser) = { * CSS_BADPARM on bad parameters, * CSS_NOMEM on memory exhaustion */ -css_error css_parser_create(const char *charset, css_charset_source cs_source, +css_error css__parser_create(const char *charset, css_charset_source cs_source, css_allocator_fn alloc, void *pw, css_parser **parser) { parser_state initial = { sStart, 0 }; - return css_parser_create_internal(charset, cs_source, + return css__parser_create_internal(charset, cs_source, alloc, pw, initial, parser); } @@ -222,13 +222,13 @@ css_error css_parser_create(const char *charset, css_charset_source cs_source, * CSS_BADPARM on bad parameters, * CSS_NOMEM on memory exhaustion */ -css_error css_parser_create_for_inline_style(const char *charset, +css_error css__parser_create_for_inline_style(const char *charset, css_charset_source cs_source, css_allocator_fn alloc, void *pw, css_parser **parser) { parser_state initial = { sInlineStyle, 0 }; - return css_parser_create_internal(charset, cs_source, + return css__parser_create_internal(charset, cs_source, alloc, pw, initial, parser); } @@ -238,7 +238,7 @@ css_error css_parser_create_for_inline_style(const char *charset, * \param parser The parser instance to destroy * \return CSS_OK on success, appropriate error otherwise */ -css_error css_parser_destroy(css_parser *parser) +css_error css__parser_destroy(css_parser *parser) { if (parser == NULL) return CSS_BADPARM; @@ -249,7 +249,7 @@ css_error css_parser_destroy(css_parser *parser) parserutils_stack_destroy(parser->states); - css_lexer_destroy(parser->lexer); + css__lexer_destroy(parser->lexer); parserutils_inputstream_destroy(parser->stream); @@ -266,7 +266,7 @@ css_error css_parser_destroy(css_parser *parser) * \param params Option-specific data * \return CSS_OK on success, appropriate error otherwise */ -css_error css_parser_setopt(css_parser *parser, css_parser_opttype type, +css_error css__parser_setopt(css_parser *parser, css_parser_opttype type, css_parser_optparams *params) { if (parser == NULL || params == NULL) @@ -324,7 +324,7 @@ css_error css__parser_parse_chunk(css_parser *parser, const uint8_t *data, * \param parser The parser to inform * \return CSS_OK on success, appropriate error otherwise */ -css_error css_parser_completed(css_parser *parser) +css_error css__parser_completed(css_parser *parser) { parserutils_error perror; parser_state *state; @@ -357,7 +357,7 @@ css_error css_parser_completed(css_parser *parser) * \param source Pointer to location to receive charset source * \return Pointer to charset name (constant; do not free) */ -const char *css_parser_read_charset(css_parser *parser, +const char *css__parser_read_charset(css_parser *parser, css_charset_source *source) { const char *charset; @@ -379,7 +379,7 @@ const char *css_parser_read_charset(css_parser *parser, * \param parser Parser to query * \return True if quirks permitted, false otherwise */ -bool css_parser_quirks_permitted(css_parser *parser) +bool css__parser_quirks_permitted(css_parser *parser) { return parser->quirks; } @@ -401,7 +401,7 @@ bool css_parser_quirks_permitted(css_parser *parser) * CSS_BADPARM on bad parameters, * CSS_NOMEM on memory exhaustion */ -css_error css_parser_create_internal(const char *charset, +css_error css__parser_create_internal(const char *charset, css_charset_source cs_source, css_allocator_fn alloc, void *pw, parser_state initial, css_parser **parser) @@ -418,14 +418,14 @@ css_error css_parser_create_internal(const char *charset, return CSS_NOMEM; perror = parserutils_inputstream_create(charset, cs_source, - css_charset_extract, (parserutils_alloc) alloc, pw, + css__charset_extract, (parserutils_alloc) alloc, pw, &p->stream); if (perror != PARSERUTILS_OK) { alloc(p, 0, pw); return css_error_from_parserutils_error(perror); } - error = css_lexer_create(p->stream, alloc, pw, &p->lexer); + error = css__lexer_create(p->stream, alloc, pw, &p->lexer); if (error != CSS_OK) { parserutils_inputstream_destroy(p->stream); alloc(p, 0, pw); @@ -436,7 +436,7 @@ css_error css_parser_create_internal(const char *charset, STACK_CHUNK, (parserutils_alloc) alloc, pw, &p->states); if (perror != PARSERUTILS_OK) { - css_lexer_destroy(p->lexer); + css__lexer_destroy(p->lexer); parserutils_inputstream_destroy(p->stream); alloc(p, 0, pw); return css_error_from_parserutils_error(perror); @@ -447,7 +447,7 @@ css_error css_parser_create_internal(const char *charset, &p->tokens); if (perror != PARSERUTILS_OK) { parserutils_stack_destroy(p->states); - css_lexer_destroy(p->lexer); + css__lexer_destroy(p->lexer); parserutils_inputstream_destroy(p->stream); alloc(p, 0, pw); return css_error_from_parserutils_error(perror); @@ -459,7 +459,7 @@ css_error css_parser_create_internal(const char *charset, if (perror != PARSERUTILS_OK) { parserutils_vector_destroy(p->tokens); parserutils_stack_destroy(p->states); - css_lexer_destroy(p->lexer); + css__lexer_destroy(p->lexer); parserutils_inputstream_destroy(p->stream); alloc(p, 0, pw); return css_error_from_parserutils_error(perror); @@ -470,7 +470,7 @@ css_error css_parser_create_internal(const char *charset, parserutils_stack_destroy(p->open_items); parserutils_vector_destroy(p->tokens); parserutils_stack_destroy(p->states); - css_lexer_destroy(p->lexer); + css__lexer_destroy(p->lexer); parserutils_inputstream_destroy(p->stream); alloc(p, 0, pw); return css_error_from_parserutils_error(perror); @@ -623,14 +623,14 @@ css_error getToken(css_parser *parser, const css_token **token) /* Otherwise, ask the lexer */ css_token *t; - error = css_lexer_get_token(parser->lexer, &t); + error = css__lexer_get_token(parser->lexer, &t); if (error != CSS_OK) return error; /* If the last token read was whitespace, keep reading * tokens until we encounter one that isn't whitespace */ while (parser->last_was_ws && t->type == CSS_TOKEN_S) { - error = css_lexer_get_token(parser->lexer, &t); + error = css__lexer_get_token(parser->lexer, &t); if (error != CSS_OK) return error; } diff --git a/src/parse/parse.h b/src/parse/parse.h index 23f1f63..e9dbe64 100644 --- a/src/parse/parse.h +++ b/src/parse/parse.h @@ -57,24 +57,24 @@ typedef union css_parser_optparams { } event_handler; } css_parser_optparams; -css_error css_parser_create(const char *charset, css_charset_source cs_source, +css_error css__parser_create(const char *charset, css_charset_source cs_source, css_allocator_fn alloc, void *pw, css_parser **parser); -css_error css_parser_create_for_inline_style(const char *charset, +css_error css__parser_create_for_inline_style(const char *charset, css_charset_source cs_source, css_allocator_fn alloc, void *pw, css_parser **parser); -css_error css_parser_destroy(css_parser *parser); +css_error css__parser_destroy(css_parser *parser); -css_error css_parser_setopt(css_parser *parser, css_parser_opttype type, +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); +css_error css__parser_completed(css_parser *parser); -const char *css_parser_read_charset(css_parser *parser, +const char *css__parser_read_charset(css_parser *parser, css_charset_source *source); -bool css_parser_quirks_permitted(css_parser *parser); +bool css__parser_quirks_permitted(css_parser *parser); #endif diff --git a/src/parse/properties/azimuth.c b/src/parse/properties/azimuth.c index ace29a2..76bc383 100644 --- a/src/parse/properties/azimuth.c +++ b/src/parse/properties/azimuth.c @@ -217,14 +217,14 @@ css_error css__parse_azimuth(css_language *c, value = AZIMUTH_ANGLE; } - error = css_stylesheet_style_appendOPV(result, CSS_PROP_AZIMUTH, flags, value); + error = css__stylesheet_style_appendOPV(result, CSS_PROP_AZIMUTH, flags, value); if (error != CSS_OK) { *ctx = orig_ctx; return error; } if (((flags & FLAG_INHERIT) == false) && (value == AZIMUTH_ANGLE)) { - error = css_stylesheet_style_vappend(result, 2, length, unit); + error = css__stylesheet_style_vappend(result, 2, length, unit); if (error != CSS_OK) { *ctx = orig_ctx; return error; diff --git a/src/parse/properties/background.c b/src/parse/properties/background.c index 137372e..cae069c 100644 --- a/src/parse/properties/background.c +++ b/src/parse/properties/background.c @@ -77,37 +77,37 @@ css_error css__parse_background(css_language *c, } /* allocate styles */ - error = css_stylesheet_style_create(c->sheet, &attachment_style); + error = css__stylesheet_style_create(c->sheet, &attachment_style); if (error != CSS_OK) return error; - error = css_stylesheet_style_create(c->sheet, &color_style); + error = css__stylesheet_style_create(c->sheet, &color_style); if (error != CSS_OK) { - css_stylesheet_style_destroy(attachment_style); + css__stylesheet_style_destroy(attachment_style); return error; } - error = css_stylesheet_style_create(c->sheet, &image_style); + error = css__stylesheet_style_create(c->sheet, &image_style); if (error != CSS_OK) { - css_stylesheet_style_destroy(attachment_style); - css_stylesheet_style_destroy(color_style); + css__stylesheet_style_destroy(attachment_style); + css__stylesheet_style_destroy(color_style); return error; } - error = css_stylesheet_style_create(c->sheet, &position_style); + error = css__stylesheet_style_create(c->sheet, &position_style); if (error != CSS_OK) { - css_stylesheet_style_destroy(attachment_style); - css_stylesheet_style_destroy(color_style); - css_stylesheet_style_destroy(image_style); + css__stylesheet_style_destroy(attachment_style); + css__stylesheet_style_destroy(color_style); + css__stylesheet_style_destroy(image_style); return error; } - error = css_stylesheet_style_create(c->sheet, &repeat_style); + error = css__stylesheet_style_create(c->sheet, &repeat_style); if (error != CSS_OK) { - css_stylesheet_style_destroy(attachment_style); - css_stylesheet_style_destroy(color_style); - css_stylesheet_style_destroy(image_style); - css_stylesheet_style_destroy(position_style); + css__stylesheet_style_destroy(attachment_style); + css__stylesheet_style_destroy(color_style); + css__stylesheet_style_destroy(image_style); + css__stylesheet_style_destroy(position_style); return error; } @@ -157,7 +157,7 @@ css_error css__parse_background(css_language *c, } while (*ctx != prev_ctx && token != NULL); if (attachment) { - error = css_stylesheet_style_appendOPV(attachment_style, + error = css__stylesheet_style_appendOPV(attachment_style, CSS_PROP_BACKGROUND_ATTACHMENT, 0, BACKGROUND_ATTACHMENT_SCROLL); if (error != CSS_OK) @@ -165,7 +165,7 @@ css_error css__parse_background(css_language *c, } if (color) { - error = css_stylesheet_style_appendOPV(color_style, + error = css__stylesheet_style_appendOPV(color_style, CSS_PROP_BACKGROUND_COLOR, 0, BACKGROUND_COLOR_TRANSPARENT); if (error != CSS_OK) @@ -173,7 +173,7 @@ css_error css__parse_background(css_language *c, } if (image) { - error = css_stylesheet_style_appendOPV(image_style, + error = css__stylesheet_style_appendOPV(image_style, CSS_PROP_BACKGROUND_IMAGE, 0, BACKGROUND_IMAGE_NONE); if (error != CSS_OK) @@ -181,7 +181,7 @@ css_error css__parse_background(css_language *c, } if (position) { - error = css_stylesheet_style_appendOPV(position_style, + error = css__stylesheet_style_appendOPV(position_style, CSS_PROP_BACKGROUND_POSITION, 0, BACKGROUND_POSITION_HORZ_LEFT | BACKGROUND_POSITION_VERT_TOP); @@ -190,37 +190,37 @@ css_error css__parse_background(css_language *c, } if (repeat) { - error = css_stylesheet_style_appendOPV(repeat_style, + error = css__stylesheet_style_appendOPV(repeat_style, CSS_PROP_BACKGROUND_REPEAT, 0, BACKGROUND_REPEAT_REPEAT); if (error != CSS_OK) goto css__parse_background_cleanup; } - error = css_stylesheet_merge_style(result, attachment_style); + error = css__stylesheet_merge_style(result, attachment_style); if (error != CSS_OK) goto css__parse_background_cleanup; - error = css_stylesheet_merge_style(result, color_style); + error = css__stylesheet_merge_style(result, color_style); if (error != CSS_OK) goto css__parse_background_cleanup; - error = css_stylesheet_merge_style(result, image_style); + error = css__stylesheet_merge_style(result, image_style); if (error != CSS_OK) goto css__parse_background_cleanup; - error = css_stylesheet_merge_style(result, position_style); + error = css__stylesheet_merge_style(result, position_style); if (error != CSS_OK) goto css__parse_background_cleanup; - error = css_stylesheet_merge_style(result, repeat_style); + error = css__stylesheet_merge_style(result, repeat_style); css__parse_background_cleanup: - css_stylesheet_style_destroy(attachment_style); - css_stylesheet_style_destroy(color_style); - css_stylesheet_style_destroy(image_style); - css_stylesheet_style_destroy(position_style); - css_stylesheet_style_destroy(repeat_style); + css__stylesheet_style_destroy(attachment_style); + css__stylesheet_style_destroy(color_style); + css__stylesheet_style_destroy(image_style); + css__stylesheet_style_destroy(position_style); + css__stylesheet_style_destroy(repeat_style); if (error != CSS_OK) *ctx = orig_ctx; diff --git a/src/parse/properties/background_position.c b/src/parse/properties/background_position.c index af38882..992372b 100644 --- a/src/parse/properties/background_position.c +++ b/src/parse/properties/background_position.c @@ -183,7 +183,7 @@ css_error css__parse_background_position(css_language *c, } } - error = css_stylesheet_style_appendOPV(result, + error = css__stylesheet_style_appendOPV(result, CSS_PROP_BACKGROUND_POSITION, flags, value[0] | value[1]); @@ -194,12 +194,12 @@ css_error css__parse_background_position(css_language *c, if ((flags & FLAG_INHERIT) == false) { if (value[0] == BACKGROUND_POSITION_HORZ_SET) { - css_stylesheet_style_append(result, length[0]); - css_stylesheet_style_append(result, unit[0]); + css__stylesheet_style_append(result, length[0]); + css__stylesheet_style_append(result, unit[0]); } if (value[1] == BACKGROUND_POSITION_VERT_SET) { - css_stylesheet_style_append(result, length[1]); - css_stylesheet_style_append(result, unit[1]); + css__stylesheet_style_append(result, length[1]); + css__stylesheet_style_append(result, unit[1]); } } diff --git a/src/parse/properties/border_color.c b/src/parse/properties/border_color.c index 87c1c5f..074b457 100644 --- a/src/parse/properties/border_color.c +++ b/src/parse/properties/border_color.c @@ -100,11 +100,11 @@ css_error css__parse_border_color(css_language *c, #define SIDE_APPEND(OP,NUM) \ - error = css_stylesheet_style_appendOPV(result, (OP), 0, side_val[(NUM)]); \ + error = css__stylesheet_style_appendOPV(result, (OP), 0, side_val[(NUM)]); \ if (error != CSS_OK) \ break; \ if (side_val[(NUM)] == BORDER_COLOR_SET) \ - error = css_stylesheet_style_append(result, side_color[(NUM)]); \ + error = css__stylesheet_style_append(result, side_color[(NUM)]); \ if (error != CSS_OK) \ break; diff --git a/src/parse/properties/border_spacing.c b/src/parse/properties/border_spacing.c index 0d6bc76..e9949fd 100644 --- a/src/parse/properties/border_spacing.c +++ b/src/parse/properties/border_spacing.c @@ -51,7 +51,7 @@ css_error css__parse_border_spacing(css_language *c, &match) == lwc_error_ok && match)) { parserutils_vector_iterate(vector, ctx); /* inherit */ - error = css_stylesheet_style_appendOPV(result, + error = css__stylesheet_style_appendOPV(result, CSS_PROP_BORDER_SPACING, FLAG_INHERIT, 0); @@ -109,7 +109,7 @@ css_error css__parse_border_spacing(css_language *c, return CSS_INVALID; } - error = css_stylesheet_style_appendOPV(result, + error = css__stylesheet_style_appendOPV(result, CSS_PROP_BORDER_SPACING, 0, BORDER_SPACING_SET); @@ -119,7 +119,7 @@ css_error css__parse_border_spacing(css_language *c, return error; } - error = css_stylesheet_style_vappend(result, + error = css__stylesheet_style_vappend(result, 4, length[0], unit[0], diff --git a/src/parse/properties/border_style.c b/src/parse/properties/border_style.c index ae697df..d4a4d12 100644 --- a/src/parse/properties/border_style.c +++ b/src/parse/properties/border_style.c @@ -111,7 +111,7 @@ css_error css__parse_border_style(css_language *c, #define SIDE_APPEND(OP,NUM) \ - error = css_stylesheet_style_appendOPV(result, (OP), 0, side_val[(NUM)]); \ + error = css__stylesheet_style_appendOPV(result, (OP), 0, side_val[(NUM)]); \ if (error != CSS_OK) \ break diff --git a/src/parse/properties/border_width.c b/src/parse/properties/border_width.c index 88abae5..8b86bc4 100644 --- a/src/parse/properties/border_width.c +++ b/src/parse/properties/border_width.c @@ -121,14 +121,14 @@ css_error css__parse_border_width(css_language *c, #define SIDE_APPEND(OP,NUM) \ - error = css_stylesheet_style_appendOPV(result, (OP), 0, side_val[(NUM)]); \ + error = css__stylesheet_style_appendOPV(result, (OP), 0, side_val[(NUM)]); \ if (error != CSS_OK) \ break; \ if (side_val[(NUM)] == BORDER_WIDTH_SET) { \ - error = css_stylesheet_style_append(result, side_length[(NUM)]); \ + error = css__stylesheet_style_append(result, side_length[(NUM)]); \ if (error != CSS_OK) \ break; \ - error = css_stylesheet_style_append(result, side_unit[(NUM)]); \ + error = css__stylesheet_style_append(result, side_unit[(NUM)]); \ if (error != CSS_OK) \ break; \ } diff --git a/src/parse/properties/clip.c b/src/parse/properties/clip.c index 0e06fd0..3d200f5 100644 --- a/src/parse/properties/clip.c +++ b/src/parse/properties/clip.c @@ -52,7 +52,7 @@ css_error css__parse_clip(css_language *c, (lwc_string_caseless_isequal( token->idata, c->strings[INHERIT], &match) == lwc_error_ok && match)) { - error = css_stylesheet_style_appendOPV(result, + error = css__stylesheet_style_appendOPV(result, CSS_PROP_CLIP, FLAG_INHERIT, 0); @@ -60,7 +60,7 @@ css_error css__parse_clip(css_language *c, (lwc_string_caseless_isequal( token->idata, c->strings[AUTO], &match) == lwc_error_ok && match)) { - error = css_stylesheet_style_appendOPV(result, + error = css__stylesheet_style_appendOPV(result, CSS_PROP_CLIP, 0, CLIP_AUTO); @@ -140,7 +140,7 @@ css_error css__parse_clip(css_language *c, } /* output bytecode */ - error = css_stylesheet_style_appendOPV(result, + error = css__stylesheet_style_appendOPV(result, CSS_PROP_CLIP, 0, value); @@ -150,7 +150,7 @@ css_error css__parse_clip(css_language *c, } for (i = 0; i < num_lengths; i++) { - error = css_stylesheet_style_vappend(result, + error = css__stylesheet_style_vappend(result, 2, length[i], unit[i]); diff --git a/src/parse/properties/content.c b/src/parse/properties/content.c index 8ea8e2f..860d0f1 100644 --- a/src/parse/properties/content.c +++ b/src/parse/properties/content.c @@ -54,18 +54,18 @@ css_error css__parse_content(css_language *c, (lwc_string_caseless_isequal(token->idata, c->strings[NORMAL], &match) == lwc_error_ok && match)) { - error = css_stylesheet_style_appendOPV(result, CSS_PROP_CONTENT, 0, CONTENT_NORMAL); + error = css__stylesheet_style_appendOPV(result, CSS_PROP_CONTENT, 0, CONTENT_NORMAL); } else if ((token->type == CSS_TOKEN_IDENT) && (lwc_string_caseless_isequal(token->idata, c->strings[NONE], &match) == lwc_error_ok && match)) { - error = css_stylesheet_style_appendOPV(result, CSS_PROP_CONTENT, 0, CONTENT_NONE); + error = css__stylesheet_style_appendOPV(result, CSS_PROP_CONTENT, 0, CONTENT_NONE); } else { /* Macro to output the value marker, awkward because we need to check * first to determine how the value is constructed. */ -#define CSS_APPEND(CSSVAL) css_stylesheet_style_append(result, first?buildOPV(CSS_PROP_CONTENT, 0, CSSVAL):CSSVAL) +#define CSS_APPEND(CSSVAL) css__stylesheet_style_append(result, first?buildOPV(CSS_PROP_CONTENT, 0, CSSVAL):CSSVAL) bool first = true; int prev_ctx = orig_ctx; @@ -108,7 +108,7 @@ css_error css__parse_content(css_language *c, } else if (token->type == CSS_TOKEN_STRING) { uint32_t snumber; - error = css_stylesheet_string_add(c->sheet, lwc_string_ref(token->idata), &snumber); + error = css__stylesheet_string_add(c->sheet, lwc_string_ref(token->idata), &snumber); if (error != CSS_OK) { *ctx = orig_ctx; return error; @@ -120,7 +120,7 @@ css_error css__parse_content(css_language *c, return error; } - error = css_stylesheet_style_append(result, snumber); + error = css__stylesheet_style_append(result, snumber); } else if (token->type == CSS_TOKEN_URI) { lwc_string *uri; uint32_t uri_snumber; @@ -134,7 +134,7 @@ css_error css__parse_content(css_language *c, return error; } - error = css_stylesheet_string_add(c->sheet, + error = css__stylesheet_string_add(c->sheet, uri, &uri_snumber); if (error != CSS_OK) { @@ -148,7 +148,7 @@ css_error css__parse_content(css_language *c, return error; } - error = css_stylesheet_style_append(result, uri_snumber); + error = css__stylesheet_style_append(result, uri_snumber); } else if (token->type == CSS_TOKEN_FUNCTION && (lwc_string_caseless_isequal( token->idata, c->strings[ATTR], @@ -164,7 +164,7 @@ css_error css__parse_content(css_language *c, return CSS_INVALID; } - error = css_stylesheet_string_add(c->sheet, lwc_string_ref(token->idata), &snumber); + error = css__stylesheet_string_add(c->sheet, lwc_string_ref(token->idata), &snumber); if (error != CSS_OK) { *ctx = orig_ctx; return error; @@ -176,7 +176,7 @@ css_error css__parse_content(css_language *c, return error; } - error = css_stylesheet_style_append(result, snumber); + error = css__stylesheet_style_append(result, snumber); consumeWhitespace(vector, ctx); @@ -257,7 +257,7 @@ css_error css__parse_content(css_language *c, } - error = css_stylesheet_string_add(c->sheet, lwc_string_ref(name), &snumber); + error = css__stylesheet_string_add(c->sheet, lwc_string_ref(name), &snumber); if (error != CSS_OK) { *ctx = orig_ctx; return error; @@ -269,7 +269,7 @@ css_error css__parse_content(css_language *c, return error; } - error = css_stylesheet_style_append(result, snumber); + error = css__stylesheet_style_append(result, snumber); } else if (token->type == CSS_TOKEN_FUNCTION && (lwc_string_caseless_isequal( token->idata, c->strings[COUNTERS], @@ -364,13 +364,13 @@ css_error css__parse_content(css_language *c, } - error = css_stylesheet_string_add(c->sheet, lwc_string_ref(name), &name_snumber); + error = css__stylesheet_string_add(c->sheet, lwc_string_ref(name), &name_snumber); if (error != CSS_OK) { *ctx = orig_ctx; return error; } - error = css_stylesheet_string_add(c->sheet, lwc_string_ref(sep), &sep_snumber); + error = css__stylesheet_string_add(c->sheet, lwc_string_ref(sep), &sep_snumber); if (error != CSS_OK) { *ctx = orig_ctx; return error; @@ -382,13 +382,13 @@ css_error css__parse_content(css_language *c, return error; } - error = css_stylesheet_style_append(result, name_snumber); + error = css__stylesheet_style_append(result, name_snumber); if (error != CSS_OK) { *ctx = orig_ctx; return error; } - error = css_stylesheet_style_append(result, sep_snumber); + error = css__stylesheet_style_append(result, sep_snumber); } else if (first) { /* Invalid if this is the first iteration */ error = CSS_INVALID; @@ -414,7 +414,7 @@ css_error css__parse_content(css_language *c, } /* while */ /* Write list terminator */ - css_stylesheet_style_append(result, CONTENT_NORMAL); + css__stylesheet_style_append(result, CONTENT_NORMAL); } if (error != CSS_OK) diff --git a/src/parse/properties/css_property_parser_gen.c b/src/parse/properties/css_property_parser_gen.c index d53fe16..ae1fa04 100644 --- a/src/parse/properties/css_property_parser_gen.c +++ b/src/parse/properties/css_property_parser_gen.c @@ -179,7 +179,7 @@ void output_ident(FILE *outputf, bool only_ident, struct keyval *parseid, struct parseid->val); } else { fprintf(outputf, - "\t\t\terror = css_stylesheet_style_appendOPV(result, %s, %s);\n", + "\t\t\terror = css__stylesheet_style_appendOPV(result, %s, %s);\n", parseid->val, ckv->val); } @@ -205,19 +205,19 @@ void output_uri(FILE *outputf, struct keyval *parseid, struct keyval_list *kvlis " return error;\n" " }\n" "\n" - " error = css_stylesheet_string_add(c->sheet, uri, &uri_snumber);\n" + " error = css__stylesheet_string_add(c->sheet, uri, &uri_snumber);\n" " if (error != CSS_OK) {\n" " *ctx = orig_ctx;\n" " return error;\n" " }\n" "\n" - " error = css_stylesheet_style_appendOPV(result, %s, 0, %s);\n" + " error = css__stylesheet_style_appendOPV(result, %s, 0, %s);\n" " if (error != CSS_OK) {\n" " *ctx = orig_ctx;\n" " return error;\n" " }\n" "\n" - " error = css_stylesheet_style_append(result, uri_snumber);\n" + " error = css__stylesheet_style_append(result, uri_snumber);\n" " } else ", parseid->val, ckv->val); @@ -255,12 +255,12 @@ void output_number(FILE *outputf, struct keyval *parseid, struct keyval_list *kv } fprintf(outputf, - "\t\terror = css_stylesheet_style_appendOPV(result, %s, 0, %s);\n" + "\t\terror = css__stylesheet_style_appendOPV(result, %s, 0, %s);\n" "\t\tif (error != CSS_OK) {\n" "\t\t\t*ctx = orig_ctx;\n" "\t\t\treturn error;\n" "\t\t}\n\n" - "\t\terror = css_stylesheet_style_append(result, num);\n" + "\t\terror = css__stylesheet_style_append(result, num);\n" "\t} else ", parseid->val, ckv->val); @@ -279,13 +279,13 @@ void output_color(FILE *outputf, struct keyval *parseid, struct keyval_list *kvl "\t\t\t*ctx = orig_ctx;\n" "\t\t\treturn error;\n" "\t\t}\n\n" - "\t\terror = css_stylesheet_style_appendOPV(result, %s, 0, %s);\n" + "\t\terror = css__stylesheet_style_appendOPV(result, %s, 0, %s);\n" "\t\tif (error != CSS_OK) {\n" "\t\t\t*ctx = orig_ctx;\n" "\t\t\treturn error;\n" "\t\t}\n" "\n" - "\t\terror = css_stylesheet_style_append(result, color);\n" + "\t\terror = css__stylesheet_style_append(result, color);\n" "\t}\n\n", parseid->val, ckv->val); @@ -338,13 +338,13 @@ void output_length_unit(FILE *outputf, struct keyval *parseid, struct keyval_lis } fprintf(outputf, - "\t\terror = css_stylesheet_style_appendOPV(result, %s, 0, %s);\n" + "\t\terror = css__stylesheet_style_appendOPV(result, %s, 0, %s);\n" "\t\tif (error != CSS_OK) {\n" "\t\t\t*ctx = orig_ctx;\n" "\t\t\treturn error;\n" "\t\t}\n" "\n" - "\t\terror = css_stylesheet_style_vappend(result, 2, length, unit);\n" + "\t\terror = css__stylesheet_style_vappend(result, 2, length, unit);\n" "\t}\n\n", parseid->val, ckv->val); @@ -359,7 +359,7 @@ void output_ident_list(FILE *outputf, struct keyval *parseid, struct keyval_list fprintf(outputf, "{\n" - "\t\terror = css_stylesheet_style_appendOPV(result, %s, 0, %s);\n" + "\t\terror = css__stylesheet_style_appendOPV(result, %s, 0, %s);\n" "\t\tif (error != CSS_OK) {\n" "\t\t\t*ctx = orig_ctx;\n" "\t\t\treturn error;\n" @@ -368,12 +368,12 @@ void output_ident_list(FILE *outputf, struct keyval *parseid, struct keyval_list "\t\t\tuint32_t snumber;\n" "\t\t\tcss_fixed num;\n" "\t\t\tint pctx;\n\n" - "\t\t\terror = css_stylesheet_string_add(c->sheet, lwc_string_ref(token->idata), &snumber);\n" + "\t\t\terror = css__stylesheet_string_add(c->sheet, lwc_string_ref(token->idata), &snumber);\n" "\t\t\tif (error != CSS_OK) {\n" "\t\t\t\t*ctx = orig_ctx;\n" "\t\t\t\treturn error;\n" "\t\t\t}\n\n" - "\t\t\terror = css_stylesheet_style_append(result, snumber);\n" + "\t\t\terror = css__stylesheet_style_append(result, snumber);\n" "\t\t\tif (error != CSS_OK) {\n" "\t\t\t\t*ctx = orig_ctx;\n" "\t\t\t\treturn error;\n" @@ -394,7 +394,7 @@ void output_ident_list(FILE *outputf, struct keyval *parseid, struct keyval_list "\t\t\t} else {\n" "\t\t\t\tnum = INTTOFIX(%s);\n" "\t\t\t}\n\n" - "\t\t\terror = css_stylesheet_style_append(result, num);\n" + "\t\t\terror = css__stylesheet_style_append(result, num);\n" "\t\t\tif (error != CSS_OK) {\n" "\t\t\t\t*ctx = orig_ctx;\n" "\t\t\t\treturn error;\n" @@ -402,7 +402,7 @@ void output_ident_list(FILE *outputf, struct keyval *parseid, struct keyval_list "\t\t\tif (token == NULL)\n" "\t\t\t\tbreak;\n\n" "\t\t\tif (token->type == CSS_TOKEN_IDENT) {\n" - "\t\t\t\terror = css_stylesheet_style_append(result, %s);\n" + "\t\t\t\terror = css__stylesheet_style_append(result, %s);\n" "\t\t\t\tif (error != CSS_OK) {\n" "\t\t\t\t\t*ctx = orig_ctx;\n" "\t\t\t\t\treturn error;\n" @@ -411,7 +411,7 @@ void output_ident_list(FILE *outputf, struct keyval *parseid, struct keyval_list "\t\t\t\t*ctx = pctx; /* rewind one token back */\n" "\t\t\t}\n" "\t\t}\n\n" - "\t\terror = css_stylesheet_style_append(result, %s);\n" + "\t\terror = css__stylesheet_style_append(result, %s);\n" "\t}\n\n", parseid->val, ckv->val, diff --git a/src/parse/properties/cursor.c b/src/parse/properties/cursor.c index 07e2d8a..6b9eadf 100644 --- a/src/parse/properties/cursor.c +++ b/src/parse/properties/cursor.c @@ -59,7 +59,7 @@ css_error css__parse_cursor(css_language *c, /* Macro to output the value marker, awkward because we need to check * first to determine how the value is constructed. */ -#define CSS_APPEND(CSSVAL) css_stylesheet_style_append(result, first?buildOPV(CSS_PROP_CURSOR, 0, CSSVAL):CSSVAL) +#define CSS_APPEND(CSSVAL) css__stylesheet_style_append(result, first?buildOPV(CSS_PROP_CURSOR, 0, CSSVAL):CSSVAL) /* URI* */ @@ -75,7 +75,7 @@ css_error css__parse_cursor(css_language *c, return error; } - error = css_stylesheet_string_add(c->sheet, + error = css__stylesheet_string_add(c->sheet, uri, &uri_snumber); if (error != CSS_OK) { @@ -89,7 +89,7 @@ css_error css__parse_cursor(css_language *c, return error; } - error = css_stylesheet_style_append(result, uri_snumber); + error = css__stylesheet_style_append(result, uri_snumber); if (error != CSS_OK) { *ctx = orig_ctx; return error; diff --git a/src/parse/properties/elevation.c b/src/parse/properties/elevation.c index 8c5e48e..f3a48a4 100644 --- a/src/parse/properties/elevation.c +++ b/src/parse/properties/elevation.c @@ -117,14 +117,14 @@ css_error css__parse_elevation(css_language *c, value = ELEVATION_ANGLE; } - error = css_stylesheet_style_appendOPV(result, CSS_PROP_ELEVATION, flags, value); + error = css__stylesheet_style_appendOPV(result, CSS_PROP_ELEVATION, flags, value); if (error != CSS_OK) { *ctx = orig_ctx; return error; } if (((flags & FLAG_INHERIT) == false) && (value == ELEVATION_ANGLE)) { - error = css_stylesheet_style_vappend(result, 2, length, unit); + error = css__stylesheet_style_vappend(result, 2, length, unit); if (error != CSS_OK) { *ctx = orig_ctx; return error; diff --git a/src/parse/properties/font.c b/src/parse/properties/font.c index 1417dda..25ce096 100644 --- a/src/parse/properties/font.c +++ b/src/parse/properties/font.c @@ -84,47 +84,47 @@ css_error css__parse_font(css_language *c, /* allocate styles */ - error = css_stylesheet_style_create(c->sheet, &style_style); + error = css__stylesheet_style_create(c->sheet, &style_style); if (error != CSS_OK) return error; - error = css_stylesheet_style_create(c->sheet, &variant_style); + error = css__stylesheet_style_create(c->sheet, &variant_style); if (error != CSS_OK) { - css_stylesheet_style_destroy(style_style); + css__stylesheet_style_destroy(style_style); return error; } - error = css_stylesheet_style_create(c->sheet, &weight_style); + error = css__stylesheet_style_create(c->sheet, &weight_style); if (error != CSS_OK) { - css_stylesheet_style_destroy(style_style); - css_stylesheet_style_destroy(variant_style); + css__stylesheet_style_destroy(style_style); + css__stylesheet_style_destroy(variant_style); return error; } - error = css_stylesheet_style_create(c->sheet, &size_style); + error = css__stylesheet_style_create(c->sheet, &size_style); if (error != CSS_OK) { - css_stylesheet_style_destroy(style_style); - css_stylesheet_style_destroy(variant_style); - css_stylesheet_style_destroy(weight_style); + css__stylesheet_style_destroy(style_style); + css__stylesheet_style_destroy(variant_style); + css__stylesheet_style_destroy(weight_style); return error; } - error = css_stylesheet_style_create(c->sheet, &line_height_style); + error = css__stylesheet_style_create(c->sheet, &line_height_style); if (error != CSS_OK) { - css_stylesheet_style_destroy(style_style); - css_stylesheet_style_destroy(variant_style); - css_stylesheet_style_destroy(weight_style); - css_stylesheet_style_destroy(size_style); + css__stylesheet_style_destroy(style_style); + css__stylesheet_style_destroy(variant_style); + css__stylesheet_style_destroy(weight_style); + css__stylesheet_style_destroy(size_style); return error; } - error = css_stylesheet_style_create(c->sheet, &family_style); + error = css__stylesheet_style_create(c->sheet, &family_style); if (error != CSS_OK) { - css_stylesheet_style_destroy(style_style); - css_stylesheet_style_destroy(variant_style); - css_stylesheet_style_destroy(weight_style); - css_stylesheet_style_destroy(size_style); - css_stylesheet_style_destroy(line_height_style); + css__stylesheet_style_destroy(style_style); + css__stylesheet_style_destroy(variant_style); + css__stylesheet_style_destroy(weight_style); + css__stylesheet_style_destroy(size_style); + css__stylesheet_style_destroy(line_height_style); return error; } @@ -225,7 +225,7 @@ css_error css__parse_font(css_language *c, /* defaults */ if (style) { - error = css_stylesheet_style_appendOPV(style_style, + error = css__stylesheet_style_appendOPV(style_style, CSS_PROP_FONT_STYLE, 0, FONT_STYLE_NORMAL); if (error != CSS_OK) @@ -233,7 +233,7 @@ css_error css__parse_font(css_language *c, } if (variant) { - error = css_stylesheet_style_appendOPV(variant_style, + error = css__stylesheet_style_appendOPV(variant_style, CSS_PROP_FONT_VARIANT, 0, FONT_VARIANT_NORMAL); if (error != CSS_OK) @@ -241,7 +241,7 @@ css_error css__parse_font(css_language *c, } if (weight) { - error = css_stylesheet_style_appendOPV(weight_style, + error = css__stylesheet_style_appendOPV(weight_style, CSS_PROP_FONT_WEIGHT, 0, FONT_WEIGHT_NORMAL); if (error != CSS_OK) @@ -249,7 +249,7 @@ css_error css__parse_font(css_language *c, } if (line_height) { - error = css_stylesheet_style_appendOPV(line_height_style, + error = css__stylesheet_style_appendOPV(line_height_style, CSS_PROP_LINE_HEIGHT, 0, LINE_HEIGHT_NORMAL); if (error != CSS_OK) @@ -257,37 +257,37 @@ css_error css__parse_font(css_language *c, } /* merge final output */ - error = css_stylesheet_merge_style(result, style_style); + error = css__stylesheet_merge_style(result, style_style); if (error != CSS_OK) goto css__parse_font_cleanup; - error = css_stylesheet_merge_style(result, variant_style); + error = css__stylesheet_merge_style(result, variant_style); if (error != CSS_OK) goto css__parse_font_cleanup; - error = css_stylesheet_merge_style(result, weight_style); + error = css__stylesheet_merge_style(result, weight_style); if (error != CSS_OK) goto css__parse_font_cleanup; - error = css_stylesheet_merge_style(result, size_style); + error = css__stylesheet_merge_style(result, size_style); if (error != CSS_OK) goto css__parse_font_cleanup; - error = css_stylesheet_merge_style(result, line_height_style); + error = css__stylesheet_merge_style(result, line_height_style); if (error != CSS_OK) goto css__parse_font_cleanup; - error = css_stylesheet_merge_style(result, family_style); + error = css__stylesheet_merge_style(result, family_style); css__parse_font_cleanup: - css_stylesheet_style_destroy(style_style); - css_stylesheet_style_destroy(variant_style); - css_stylesheet_style_destroy(weight_style); - css_stylesheet_style_destroy(size_style); - css_stylesheet_style_destroy(line_height_style); - css_stylesheet_style_destroy(family_style); + css__stylesheet_style_destroy(style_style); + css__stylesheet_style_destroy(variant_style); + css__stylesheet_style_destroy(weight_style); + css__stylesheet_style_destroy(size_style); + css__stylesheet_style_destroy(line_height_style); + css__stylesheet_style_destroy(family_style); if (error != CSS_OK) *ctx = orig_ctx; diff --git a/src/parse/properties/font_family.c b/src/parse/properties/font_family.c index 4d0a3b1..60c069d 100644 --- a/src/parse/properties/font_family.c +++ b/src/parse/properties/font_family.c @@ -139,7 +139,7 @@ css_error css__parse_font_family(css_language *c, return error; } - error = css_stylesheet_style_append(result, FONT_FAMILY_END); + error = css__stylesheet_style_append(result, FONT_FAMILY_END); } if (error != CSS_OK) { diff --git a/src/parse/properties/font_weight.c b/src/parse/properties/font_weight.c index 9c4048b..4853106 100644 --- a/src/parse/properties/font_weight.c +++ b/src/parse/properties/font_weight.c @@ -94,7 +94,7 @@ css_error css__parse_font_weight(css_language *c, return CSS_INVALID; } - error = css_stylesheet_style_appendOPV(result, + error = css__stylesheet_style_appendOPV(result, CSS_PROP_FONT_WEIGHT, flags, value); diff --git a/src/parse/properties/list_style.c b/src/parse/properties/list_style.c index 7ac0831..4ef4ce8 100644 --- a/src/parse/properties/list_style.c +++ b/src/parse/properties/list_style.c @@ -65,20 +65,20 @@ css_error css__parse_list_style(css_language *c, } /* allocate styles */ - error = css_stylesheet_style_create(c->sheet, &image_style); + error = css__stylesheet_style_create(c->sheet, &image_style); if (error != CSS_OK) return error; - error = css_stylesheet_style_create(c->sheet, &position_style); + error = css__stylesheet_style_create(c->sheet, &position_style); if (error != CSS_OK) { - css_stylesheet_style_destroy(image_style); + css__stylesheet_style_destroy(image_style); return error; } - error = css_stylesheet_style_create(c->sheet, &type_style); + error = css__stylesheet_style_create(c->sheet, &type_style); if (error != CSS_OK) { - css_stylesheet_style_destroy(image_style); - css_stylesheet_style_destroy(position_style); + css__stylesheet_style_destroy(image_style); + css__stylesheet_style_destroy(position_style); return error; } @@ -121,40 +121,40 @@ css_error css__parse_list_style(css_language *c, /* defaults */ if (image) { - error = css_stylesheet_style_appendOPV(image_style, + error = css__stylesheet_style_appendOPV(image_style, CSS_PROP_LIST_STYLE_IMAGE, 0, LIST_STYLE_IMAGE_NONE); } if (position) { - error = css_stylesheet_style_appendOPV(position_style, + error = css__stylesheet_style_appendOPV(position_style, CSS_PROP_LIST_STYLE_POSITION, 0, LIST_STYLE_POSITION_OUTSIDE); } if (type) { - error = css_stylesheet_style_appendOPV(type_style, + error = css__stylesheet_style_appendOPV(type_style, CSS_PROP_LIST_STYLE_TYPE, 0, LIST_STYLE_TYPE_DISC); } - error = css_stylesheet_merge_style(result, image_style); + error = css__stylesheet_merge_style(result, image_style); if (error != CSS_OK) goto css__parse_list_style_cleanup; - error = css_stylesheet_merge_style(result, position_style); + error = css__stylesheet_merge_style(result, position_style); if (error != CSS_OK) goto css__parse_list_style_cleanup; - error = css_stylesheet_merge_style(result, type_style); + error = css__stylesheet_merge_style(result, type_style); css__parse_list_style_cleanup: - css_stylesheet_style_destroy(type_style); - css_stylesheet_style_destroy(position_style); - css_stylesheet_style_destroy(image_style); + css__stylesheet_style_destroy(type_style); + css__stylesheet_style_destroy(position_style); + css__stylesheet_style_destroy(image_style); if (error != CSS_OK) *ctx = orig_ctx; diff --git a/src/parse/properties/list_style_type.c b/src/parse/properties/list_style_type.c index 12fb465..b73bcb7 100644 --- a/src/parse/properties/list_style_type.c +++ b/src/parse/properties/list_style_type.c @@ -61,7 +61,7 @@ css_error css__parse_list_style_type(css_language *c, } } - error = css_stylesheet_style_appendOPV(result, CSS_PROP_LIST_STYLE_TYPE, flags, value); + error = css__stylesheet_style_appendOPV(result, CSS_PROP_LIST_STYLE_TYPE, flags, value); if (error != CSS_OK) *ctx = orig_ctx; diff --git a/src/parse/properties/margin.c b/src/parse/properties/margin.c index 04b8795..896e300 100644 --- a/src/parse/properties/margin.c +++ b/src/parse/properties/margin.c @@ -107,14 +107,14 @@ css_error css__parse_margin(css_language *c, #define SIDE_APPEND(OP,NUM) \ - error = css_stylesheet_style_appendOPV(result, (OP), 0, side_val[(NUM)]); \ + error = css__stylesheet_style_appendOPV(result, (OP), 0, side_val[(NUM)]); \ if (error != CSS_OK) \ break; \ if (side_val[(NUM)] == MARGIN_SET) { \ - error = css_stylesheet_style_append(result, side_length[(NUM)]); \ + error = css__stylesheet_style_append(result, side_length[(NUM)]); \ if (error != CSS_OK) \ break; \ - error = css_stylesheet_style_append(result, side_unit[(NUM)]); \ + error = css__stylesheet_style_append(result, side_unit[(NUM)]); \ if (error != CSS_OK) \ break; \ } diff --git a/src/parse/properties/outline.c b/src/parse/properties/outline.c index 7cd74cd..eb4f525 100644 --- a/src/parse/properties/outline.c +++ b/src/parse/properties/outline.c @@ -65,20 +65,20 @@ css_error css__parse_outline(css_language *c, } /* allocate styles */ - error = css_stylesheet_style_create(c->sheet, &color_style); + error = css__stylesheet_style_create(c->sheet, &color_style); if (error != CSS_OK) return error; - error = css_stylesheet_style_create(c->sheet, &style_style); + error = css__stylesheet_style_create(c->sheet, &style_style); if (error != CSS_OK) { - css_stylesheet_style_destroy(color_style); + css__stylesheet_style_destroy(color_style); return error; } - error = css_stylesheet_style_create(c->sheet, &width_style); + error = css__stylesheet_style_create(c->sheet, &width_style); if (error != CSS_OK) { - css_stylesheet_style_destroy(color_style); - css_stylesheet_style_destroy(style_style); + css__stylesheet_style_destroy(color_style); + css__stylesheet_style_destroy(style_style); return error; } @@ -121,40 +121,40 @@ css_error css__parse_outline(css_language *c, /* defaults */ if (color) { - error = css_stylesheet_style_appendOPV(color_style, + error = css__stylesheet_style_appendOPV(color_style, CSS_PROP_OUTLINE_COLOR, 0, OUTLINE_COLOR_INVERT); } if (style) { - error = css_stylesheet_style_appendOPV(style_style, + error = css__stylesheet_style_appendOPV(style_style, CSS_PROP_OUTLINE_STYLE, 0, OUTLINE_STYLE_NONE); } if (width) { - error = css_stylesheet_style_appendOPV(width_style, + error = css__stylesheet_style_appendOPV(width_style, CSS_PROP_OUTLINE_WIDTH, 0, OUTLINE_WIDTH_MEDIUM); } - error = css_stylesheet_merge_style(result, color_style); + error = css__stylesheet_merge_style(result, color_style); if (error != CSS_OK) goto css__parse_outline_cleanup; - error = css_stylesheet_merge_style(result, style_style); + error = css__stylesheet_merge_style(result, style_style); if (error != CSS_OK) goto css__parse_outline_cleanup; - error = css_stylesheet_merge_style(result, width_style); + error = css__stylesheet_merge_style(result, width_style); css__parse_outline_cleanup: - css_stylesheet_style_destroy(width_style); - css_stylesheet_style_destroy(style_style); - css_stylesheet_style_destroy(color_style); + css__stylesheet_style_destroy(width_style); + css__stylesheet_style_destroy(style_style); + css__stylesheet_style_destroy(color_style); if (error != CSS_OK) *ctx = orig_ctx; diff --git a/src/parse/properties/padding.c b/src/parse/properties/padding.c index 5211e9d..7a5b88b 100644 --- a/src/parse/properties/padding.c +++ b/src/parse/properties/padding.c @@ -99,13 +99,13 @@ css_error css__parse_padding(css_language *c, } while ((*ctx != prev_ctx) && (token != NULL) && (side_count < 4)); #define SIDE_APPEND(OP,NUM) \ - error = css_stylesheet_style_appendOPV(result, (OP), 0, PADDING_SET); \ + error = css__stylesheet_style_appendOPV(result, (OP), 0, PADDING_SET); \ if (error != CSS_OK) \ break; \ - error = css_stylesheet_style_append(result, side_length[(NUM)]); \ + error = css__stylesheet_style_append(result, side_length[(NUM)]); \ if (error != CSS_OK) \ break; \ - error = css_stylesheet_style_append(result, side_unit[(NUM)]); \ + error = css__stylesheet_style_append(result, side_unit[(NUM)]); \ if (error != CSS_OK) \ break; diff --git a/src/parse/properties/play_during.c b/src/parse/properties/play_during.c index 8d83a92..1e5ad63 100644 --- a/src/parse/properties/play_during.c +++ b/src/parse/properties/play_during.c @@ -79,7 +79,7 @@ css_error css__parse_play_during(css_language *c, return error; } - error = css_stylesheet_string_add(c->sheet, + error = css__stylesheet_string_add(c->sheet, uri, &uri_snumber); if (error != CSS_OK) { @@ -124,7 +124,7 @@ css_error css__parse_play_during(css_language *c, } } - error = css_stylesheet_style_appendOPV(result, CSS_PROP_PLAY_DURING, flags, value); + error = css__stylesheet_style_appendOPV(result, CSS_PROP_PLAY_DURING, flags, value); if (error != CSS_OK) { *ctx = orig_ctx; return error; @@ -132,7 +132,7 @@ css_error css__parse_play_during(css_language *c, if ((flags & FLAG_INHERIT) == false && (value & PLAY_DURING_TYPE_MASK) == PLAY_DURING_URI) { - error = css_stylesheet_style_append(result, uri_snumber); + error = css__stylesheet_style_append(result, uri_snumber); } if (error != CSS_OK) diff --git a/src/parse/properties/quotes.c b/src/parse/properties/quotes.c index 6d235ab..07d8998 100644 --- a/src/parse/properties/quotes.c +++ b/src/parse/properties/quotes.c @@ -54,7 +54,7 @@ css_error css__parse_quotes(css_language *c, (lwc_string_caseless_isequal(token->idata, c->strings[NONE], &match) == lwc_error_ok && match)) { - error = css_stylesheet_style_appendOPV(result, + error = css__stylesheet_style_appendOPV(result, CSS_PROP_QUOTES, 0, QUOTES_NONE); } else if (token->type == CSS_TOKEN_STRING) { bool first = true; @@ -62,14 +62,14 @@ css_error css__parse_quotes(css_language *c, /* Macro to output the value marker, awkward because we need to check * first to determine how the value is constructed. */ -#define CSS_FIRST_APPEND(CSSVAL) css_stylesheet_style_append(result, first?buildOPV(CSS_PROP_QUOTES, 0, CSSVAL):CSSVAL) +#define CSS_FIRST_APPEND(CSSVAL) css__stylesheet_style_append(result, first?buildOPV(CSS_PROP_QUOTES, 0, CSSVAL):CSSVAL) /* [ STRING STRING ]+ */ while ((token != NULL) && (token->type == CSS_TOKEN_STRING)) { uint32_t open_snumber; uint32_t close_snumber; - error = css_stylesheet_string_add(c->sheet, + error = css__stylesheet_string_add(c->sheet, lwc_string_ref(token->idata), &open_snumber); if (error != CSS_OK) @@ -84,7 +84,7 @@ css_error css__parse_quotes(css_language *c, break; } - error = css_stylesheet_string_add(c->sheet, + error = css__stylesheet_string_add(c->sheet, lwc_string_ref(token->idata), &close_snumber); if (error != CSS_OK) @@ -96,11 +96,11 @@ css_error css__parse_quotes(css_language *c, if (error != CSS_OK) break; - error = css_stylesheet_style_append(result, open_snumber); + error = css__stylesheet_style_append(result, open_snumber); if (error != CSS_OK) break; - error = css_stylesheet_style_append(result, close_snumber); + error = css__stylesheet_style_append(result, close_snumber); if (error != CSS_OK) break; @@ -114,7 +114,7 @@ css_error css__parse_quotes(css_language *c, if (error == CSS_OK) { /* AddTerminator */ - error = css_stylesheet_style_append(result, QUOTES_NONE); + error = css__stylesheet_style_append(result, QUOTES_NONE); } } else { error = CSS_INVALID; diff --git a/src/parse/properties/text_decoration.c b/src/parse/properties/text_decoration.c index 2d893f4..9bfdec2 100644 --- a/src/parse/properties/text_decoration.c +++ b/src/parse/properties/text_decoration.c @@ -51,7 +51,7 @@ css_error css__parse_text_decoration(css_language *c, } else if (lwc_string_caseless_isequal(token->idata, c->strings[NONE], &match) == lwc_error_ok && match) { - error = css_stylesheet_style_appendOPV(result, + error = css__stylesheet_style_appendOPV(result, CSS_PROP_TEXT_DECORATION, 0, TEXT_DECORATION_NONE); } else { uint16_t value = 0; @@ -104,7 +104,7 @@ css_error css__parse_text_decoration(css_language *c, break; token = parserutils_vector_iterate(vector, ctx); } - error = css_stylesheet_style_appendOPV(result, + error = css__stylesheet_style_appendOPV(result, CSS_PROP_TEXT_DECORATION, 0, value); } diff --git a/src/parse/properties/utils.c b/src/parse/properties/utils.c index 35882ee..85c0e2d 100644 --- a/src/parse/properties/utils.c +++ b/src/parse/properties/utils.c @@ -155,20 +155,20 @@ css_error css__parse_border_side(css_language *c, } /* allocate styles */ - error = css_stylesheet_style_create(c->sheet, &color_style); + error = css__stylesheet_style_create(c->sheet, &color_style); if (error != CSS_OK) return error; - error = css_stylesheet_style_create(c->sheet, &style_style); + error = css__stylesheet_style_create(c->sheet, &style_style); if (error != CSS_OK) { - css_stylesheet_style_destroy(color_style); + css__stylesheet_style_destroy(color_style); return error; } - error = css_stylesheet_style_create(c->sheet, &width_style); + error = css__stylesheet_style_create(c->sheet, &width_style); if (error != CSS_OK) { - css_stylesheet_style_destroy(color_style); - css_stylesheet_style_destroy(width_style); + css__stylesheet_style_destroy(color_style); + css__stylesheet_style_destroy(width_style); return error; } @@ -212,7 +212,7 @@ css_error css__parse_border_side(css_language *c, } while (*ctx != prev_ctx && token != NULL); if (style) { - error = css_stylesheet_style_appendOPV(style_style, + error = css__stylesheet_style_appendOPV(style_style, CSS_PROP_BORDER_TOP_STYLE + side, 0, BORDER_STYLE_NONE); if (error != CSS_OK) @@ -220,27 +220,27 @@ css_error css__parse_border_side(css_language *c, } if (width) { - error = css_stylesheet_style_appendOPV(width_style, + error = css__stylesheet_style_appendOPV(width_style, CSS_PROP_BORDER_TOP_WIDTH + side, 0, BORDER_WIDTH_MEDIUM); if (error != CSS_OK) goto css__parse_border_side_cleanup; } - error = css_stylesheet_merge_style(result, color_style); + error = css__stylesheet_merge_style(result, color_style); if (error != CSS_OK) goto css__parse_border_side_cleanup; - error = css_stylesheet_merge_style(result, style_style); + error = css__stylesheet_merge_style(result, style_style); if (error != CSS_OK) goto css__parse_border_side_cleanup; - error = css_stylesheet_merge_style(result, width_style); + error = css__stylesheet_merge_style(result, width_style); css__parse_border_side_cleanup: - css_stylesheet_style_destroy(color_style); - css_stylesheet_style_destroy(style_style); - css_stylesheet_style_destroy(width_style); + css__stylesheet_style_destroy(color_style); + css__stylesheet_style_destroy(style_style); + css__stylesheet_style_destroy(width_style); if (error != CSS_OK) *ctx = orig_ctx; @@ -1172,22 +1172,22 @@ css_error css__comma_list_to_style(css_language *c, if (error != CSS_OK) goto cleanup; - error = css_stylesheet_string_add(c->sheet, + error = css__stylesheet_string_add(c->sheet, str, &snumber); if (error != CSS_OK) goto cleanup; - error = css_stylesheet_style_append(result, + error = css__stylesheet_style_append(result, value); if (error != CSS_OK) goto cleanup; - error = css_stylesheet_style_append(result, + error = css__stylesheet_style_append(result, snumber); if (error != CSS_OK) goto cleanup; } else { - error = css_stylesheet_style_append(result, + error = css__stylesheet_style_append(result, value); if (error != CSS_OK) goto cleanup; @@ -1196,16 +1196,16 @@ css_error css__comma_list_to_style(css_language *c, css_code_t value = get_value(c, token, first); uint32_t snumber; - error = css_stylesheet_string_add(c->sheet, + error = css__stylesheet_string_add(c->sheet, lwc_string_ref(token->idata), &snumber); if (error != CSS_OK) goto cleanup; - error = css_stylesheet_style_append(result, value); + error = css__stylesheet_style_append(result, value); if (error != CSS_OK) goto cleanup; - error = css_stylesheet_style_append(result, snumber); + error = css__stylesheet_style_append(result, snumber); if (error != CSS_OK) goto cleanup; } else { diff --git a/src/parse/properties/voice_family.c b/src/parse/properties/voice_family.c index 9ef52be..8a969a6 100644 --- a/src/parse/properties/voice_family.c +++ b/src/parse/properties/voice_family.c @@ -121,7 +121,7 @@ css_error css__parse_voice_family(css_language *c, return error; } - error = css_stylesheet_style_append(result, VOICE_FAMILY_END); + error = css__stylesheet_style_append(result, VOICE_FAMILY_END); } if (error != CSS_OK) { diff --git a/src/select/hash.c b/src/select/hash.c index ed956a0..d68ad82 100644 --- a/src/select/hash.c +++ b/src/select/hash.c @@ -70,7 +70,7 @@ static css_error _iterate_universal(css_selector_hash *hash, * \param hash Pointer to location to receive result * \return CSS_OK on success, appropriate error otherwise */ -css_error css_selector_hash_create(css_allocator_fn alloc, void *pw, +css_error css__selector_hash_create(css_allocator_fn alloc, void *pw, css_selector_hash **hash) { css_selector_hash *h; @@ -134,7 +134,7 @@ css_error css_selector_hash_create(css_allocator_fn alloc, void *pw, * \param hash The hash to destroy * \return CSS_OK on success, appropriate error otherwise */ -css_error css_selector_hash_destroy(css_selector_hash *hash) +css_error css__selector_hash_destroy(css_selector_hash *hash) { hash_entry *d, *e; uint32_t i; @@ -191,7 +191,7 @@ css_error css_selector_hash_destroy(css_selector_hash *hash) * \param selector Pointer to selector * \return CSS_OK on success, appropriate error otherwise */ -css_error css_selector_hash_insert(css_selector_hash *hash, +css_error css__selector_hash_insert(css_selector_hash *hash, const css_selector *selector) { uint32_t index, mask; @@ -239,7 +239,7 @@ css_error css_selector_hash_insert(css_selector_hash *hash, * \param selector Pointer to selector * \return CSS_OK on success, appropriate error otherwise */ -css_error css_selector_hash_remove(css_selector_hash *hash, +css_error css__selector_hash_remove(css_selector_hash *hash, const css_selector *selector) { uint32_t index, mask; @@ -291,7 +291,7 @@ css_error css_selector_hash_remove(css_selector_hash *hash, * * If nothing matches, CSS_OK will be returned and **matched == NULL */ -css_error css_selector_hash_find(css_selector_hash *hash, +css_error css__selector_hash_find(css_selector_hash *hash, lwc_string *name, css_selector_hash_iterator *iterator, const css_selector ***matched) @@ -346,7 +346,7 @@ css_error css_selector_hash_find(css_selector_hash *hash, * * If nothing matches, CSS_OK will be returned and **matched == NULL */ -css_error css_selector_hash_find_by_class(css_selector_hash *hash, +css_error css__selector_hash_find_by_class(css_selector_hash *hash, lwc_string *name, css_selector_hash_iterator *iterator, const css_selector ***matched) @@ -405,7 +405,7 @@ css_error css_selector_hash_find_by_class(css_selector_hash *hash, * * If nothing matches, CSS_OK will be returned and **matched == NULL */ -css_error css_selector_hash_find_by_id(css_selector_hash *hash, +css_error css__selector_hash_find_by_id(css_selector_hash *hash, lwc_string *name, css_selector_hash_iterator *iterator, const css_selector ***matched) @@ -463,7 +463,7 @@ css_error css_selector_hash_find_by_id(css_selector_hash *hash, * * If nothing matches, CSS_OK will be returned and **matched == NULL */ -css_error css_selector_hash_find_universal(css_selector_hash *hash, +css_error css__selector_hash_find_universal(css_selector_hash *hash, css_selector_hash_iterator *iterator, const css_selector ***matched) { @@ -486,7 +486,7 @@ css_error css_selector_hash_find_universal(css_selector_hash *hash, * \note The returned size will represent the size of the hash datastructures, * and will not include the size of the data stored in the hash. */ -css_error css_selector_hash_size(css_selector_hash *hash, size_t *size) +css_error css__selector_hash_size(css_selector_hash *hash, size_t *size) { if (hash == NULL || size == NULL) return CSS_BADPARM; diff --git a/src/select/hash.h b/src/select/hash.h index e1f2542..c8a3d36 100644 --- a/src/select/hash.h +++ b/src/select/hash.h @@ -22,32 +22,32 @@ typedef css_error (*css_selector_hash_iterator)(css_selector_hash *hash, const struct css_selector **current, const struct css_selector ***next); -css_error css_selector_hash_create(css_allocator_fn alloc, void *pw, +css_error css__selector_hash_create(css_allocator_fn alloc, void *pw, css_selector_hash **hash); -css_error css_selector_hash_destroy(css_selector_hash *hash); +css_error css__selector_hash_destroy(css_selector_hash *hash); -css_error css_selector_hash_insert(css_selector_hash *hash, +css_error css__selector_hash_insert(css_selector_hash *hash, const struct css_selector *selector); -css_error css_selector_hash_remove(css_selector_hash *hash, +css_error css__selector_hash_remove(css_selector_hash *hash, const struct css_selector *selector); -css_error css_selector_hash_find(css_selector_hash *hash, +css_error css__selector_hash_find(css_selector_hash *hash, lwc_string *name, css_selector_hash_iterator *iterator, const struct css_selector ***matched); -css_error css_selector_hash_find_by_class(css_selector_hash *hash, +css_error css__selector_hash_find_by_class(css_selector_hash *hash, lwc_string *name, css_selector_hash_iterator *iterator, const struct css_selector ***matched); -css_error css_selector_hash_find_by_id(css_selector_hash *hash, +css_error css__selector_hash_find_by_id(css_selector_hash *hash, lwc_string *name, css_selector_hash_iterator *iterator, const struct css_selector ***matched); -css_error css_selector_hash_find_universal(css_selector_hash *hash, +css_error css__selector_hash_find_universal(css_selector_hash *hash, css_selector_hash_iterator *iterator, const struct css_selector ***matched); -css_error css_selector_hash_size(css_selector_hash *hash, size_t *size); +css_error css__selector_hash_size(css_selector_hash *hash, size_t *size); #endif diff --git a/src/select/properties/content.c b/src/select/properties/content.c index 5e38d49..1d033f2 100644 --- a/src/select/properties/content.c +++ b/src/select/properties/content.c @@ -35,7 +35,7 @@ css_error css__cascade_content(uint32_t opv, css_style *style, lwc_string *he; css_computed_content_item *temp; - css_stylesheet_string_get(style->sheet, *((css_code_t *) style->bytecode), &he); + css__stylesheet_string_get(style->sheet, *((css_code_t *) style->bytecode), &he); temp = state->computed->alloc(content, (n_contents + 1) * @@ -66,7 +66,7 @@ css_error css__cascade_content(uint32_t opv, css_style *style, advance_bytecode(style, sizeof(css_code_t)); - css_stylesheet_string_get(style->sheet, *((css_code_t *) style->bytecode), &sep); + css__stylesheet_string_get(style->sheet, *((css_code_t *) style->bytecode), &sep); advance_bytecode(style, sizeof(css_code_t)); content[n_contents].type = diff --git a/src/select/properties/cursor.c b/src/select/properties/cursor.c index 42c3753..d4785b1 100644 --- a/src/select/properties/cursor.c +++ b/src/select/properties/cursor.c @@ -28,7 +28,7 @@ css_error css__cascade_cursor(uint32_t opv, css_style *style, lwc_string *uri; lwc_string **temp; - css_stylesheet_string_get(style->sheet, *((css_code_t *) style->bytecode), &uri); + css__stylesheet_string_get(style->sheet, *((css_code_t *) style->bytecode), &uri); advance_bytecode(style, sizeof(css_code_t)); temp = state->computed->alloc(uris, diff --git a/src/select/properties/font_family.c b/src/select/properties/font_family.c index f712cdb..8ad36e4 100644 --- a/src/select/properties/font_family.c +++ b/src/select/properties/font_family.c @@ -31,7 +31,7 @@ css_error css__cascade_font_family(uint32_t opv, css_style *style, switch (v) { case FONT_FAMILY_STRING: case FONT_FAMILY_IDENT_LIST: - css_stylesheet_string_get(style->sheet, *((css_code_t *) style->bytecode), &font); + css__stylesheet_string_get(style->sheet, *((css_code_t *) style->bytecode), &font); advance_bytecode(style, sizeof(css_code_t)); break; case FONT_FAMILY_SERIF: diff --git a/src/select/properties/helpers.c b/src/select/properties/helpers.c index 31ef2a7..9635dd8 100644 --- a/src/select/properties/helpers.c +++ b/src/select/properties/helpers.c @@ -93,7 +93,7 @@ css_error css__cascade_uri_none(uint32_t opv, css_style *style, break; case BACKGROUND_IMAGE_URI: value = CSS_BACKGROUND_IMAGE_IMAGE; - css_stylesheet_string_get(style->sheet, *((css_code_t *) style->bytecode), &uri); + css__stylesheet_string_get(style->sheet, *((css_code_t *) style->bytecode), &uri); advance_bytecode(style, sizeof(css_code_t)); break; } @@ -402,7 +402,7 @@ css_error css__cascade_counter_increment_reset(uint32_t opv, css_style *style, lwc_string *name; css_fixed val = 0; - css_stylesheet_string_get(style->sheet, *((css_code_t *) style->bytecode), &name); + css__stylesheet_string_get(style->sheet, *((css_code_t *) style->bytecode), &name); advance_bytecode(style, sizeof(css_code_t)); val = *((css_fixed *) style->bytecode); diff --git a/src/select/properties/play_during.c b/src/select/properties/play_during.c index ab01b6a..cb1de3c 100644 --- a/src/select/properties/play_during.c +++ b/src/select/properties/play_during.c @@ -25,7 +25,7 @@ css_error css__cascade_play_during(uint32_t opv, css_style *style, case PLAY_DURING_URI: value = 0; - css_stylesheet_string_get(style->sheet, *((css_code_t *) style->bytecode), &uri); + css__stylesheet_string_get(style->sheet, *((css_code_t *) style->bytecode), &uri); advance_bytecode(style, sizeof(css_code_t)); break; case PLAY_DURING_AUTO: diff --git a/src/select/properties/quotes.c b/src/select/properties/quotes.c index 5db2184..7671c1d 100644 --- a/src/select/properties/quotes.c +++ b/src/select/properties/quotes.c @@ -30,10 +30,10 @@ css_error css__cascade_quotes(uint32_t opv, css_style *style, lwc_string *open, *close; lwc_string **temp; - css_stylesheet_string_get(style->sheet, *((css_code_t *) style->bytecode), &open); + css__stylesheet_string_get(style->sheet, *((css_code_t *) style->bytecode), &open); advance_bytecode(style, sizeof(css_code_t)); - css_stylesheet_string_get(style->sheet, *((css_code_t *) style->bytecode), &close); + css__stylesheet_string_get(style->sheet, *((css_code_t *) style->bytecode), &close); advance_bytecode(style, sizeof(css_code_t)); temp = state->computed->alloc(quotes, diff --git a/src/select/properties/voice_family.c b/src/select/properties/voice_family.c index dfff826..e61d2c6 100644 --- a/src/select/properties/voice_family.c +++ b/src/select/properties/voice_family.c @@ -31,7 +31,7 @@ css_error css__cascade_voice_family(uint32_t opv, css_style *style, switch (v) { case VOICE_FAMILY_STRING: case VOICE_FAMILY_IDENT_LIST: - css_stylesheet_string_get(style->sheet, *((css_code_t *) style->bytecode), &voice); + css__stylesheet_string_get(style->sheet, *((css_code_t *) style->bytecode), &voice); advance_bytecode(style, sizeof(css_code_t)); break; case VOICE_FAMILY_MALE: diff --git a/src/select/select.c b/src/select/select.c index 0c9fb30..ee34df2 100644 --- a/src/select/select.c +++ b/src/select/select.c @@ -837,7 +837,7 @@ css_error match_selectors_in_sheet(css_select_ctx *ctx, goto cleanup; /* Find hash chain that applies to current node */ - error = css_selector_hash_find(sheet->selectors, element, + error = css__selector_hash_find(sheet->selectors, element, &node_iterator, &node_selectors); if (error != CSS_OK) goto cleanup; @@ -852,7 +852,7 @@ css_error match_selectors_in_sheet(css_select_ctx *ctx, } for (i = 0; i < n_classes; i++) { - error = css_selector_hash_find_by_class( + error = css__selector_hash_find_by_class( sheet->selectors, classes[i], &class_iterator, &class_selectors[i]); if (error != CSS_OK) @@ -862,14 +862,14 @@ css_error match_selectors_in_sheet(css_select_ctx *ctx, if (id != NULL) { /* Find hash chain for node ID */ - error = css_selector_hash_find_by_id(sheet->selectors, id, + error = css__selector_hash_find_by_id(sheet->selectors, id, &id_iterator, &id_selectors); if (error != CSS_OK) goto cleanup; } /* Find hash chain for universal selector */ - error = css_selector_hash_find_universal(sheet->selectors, + error = css__selector_hash_find_universal(sheet->selectors, &univ_iterator, &univ_selectors); if (error != CSS_OK) goto cleanup; diff --git a/src/stylesheet.c b/src/stylesheet.c index 3a0fadd..9a8cae7 100644 --- a/src/stylesheet.c +++ b/src/stylesheet.c @@ -33,7 +33,7 @@ static size_t _rule_size(const css_rule *rule); * \post Ownership of \a string reference is passed to the stylesheet (even on failure) * \note The returned string number is guaranteed to be non-zero */ -css_error css_stylesheet_string_add(css_stylesheet *sheet, lwc_string *string, uint32_t *string_number) +css_error css__stylesheet_string_add(css_stylesheet *sheet, lwc_string *string, uint32_t *string_number) { uint32_t new_string_number; /* The string number count */ @@ -96,7 +96,7 @@ css_error css_stylesheet_string_add(css_stylesheet *sheet, lwc_string *string, u * \return CSS_OK on success, * CSS_BADPARM on bad parameters, */ -css_error css_stylesheet_string_get(css_stylesheet *sheet, uint32_t string_number, lwc_string **string) +css_error css__stylesheet_string_get(css_stylesheet *sheet, uint32_t string_number, lwc_string **string) { /* External string numbers = index into vector + 1 */ string_number--; @@ -155,11 +155,11 @@ css_error css_stylesheet_create(css_language_level level, sheet->inline_style = inline_style; if (inline_style) { - error = css_parser_create_for_inline_style(charset, + error = css__parser_create_for_inline_style(charset, charset ? CSS_CHARSET_DICTATED : CSS_CHARSET_DEFAULT, alloc, alloc_pw, &sheet->parser); } else { - error = css_parser_create(charset, + error = css__parser_create(charset, charset ? CSS_CHARSET_DICTATED : CSS_CHARSET_DEFAULT, alloc, alloc_pw, &sheet->parser); } @@ -173,29 +173,29 @@ css_error css_stylesheet_create(css_language_level level, if (allow_quirks) { params.quirks = true; - error = css_parser_setopt(sheet->parser, CSS_PARSER_QUIRKS, + error = css__parser_setopt(sheet->parser, CSS_PARSER_QUIRKS, ¶ms); if (error != CSS_OK) { - css_parser_destroy(sheet->parser); + css__parser_destroy(sheet->parser); alloc(sheet, 0, alloc_pw); return error; } } sheet->level = level; - error = css_language_create(sheet, sheet->parser, alloc, alloc_pw, + error = css__language_create(sheet, sheet->parser, alloc, alloc_pw, &sheet->parser_frontend); if (error != CSS_OK) { - css_parser_destroy(sheet->parser); + css__parser_destroy(sheet->parser); alloc(sheet, 0, alloc_pw); return error; } - error = css_selector_hash_create(alloc, alloc_pw, + error = css__selector_hash_create(alloc, alloc_pw, &sheet->selectors); if (error != CSS_OK) { - css_language_destroy(sheet->parser_frontend); - css_parser_destroy(sheet->parser); + css__language_destroy(sheet->parser_frontend); + css__parser_destroy(sheet->parser); alloc(sheet, 0, alloc_pw); return error; } @@ -203,9 +203,9 @@ css_error css_stylesheet_create(css_language_level level, len = strlen(url) + 1; sheet->url = alloc(NULL, len, alloc_pw); if (sheet->url == NULL) { - css_selector_hash_destroy(sheet->selectors); - css_language_destroy(sheet->parser_frontend); - css_parser_destroy(sheet->parser); + css__selector_hash_destroy(sheet->selectors); + css__language_destroy(sheet->parser_frontend); + css__parser_destroy(sheet->parser); alloc(sheet, 0, alloc_pw); return CSS_NOMEM; } @@ -216,9 +216,9 @@ css_error css_stylesheet_create(css_language_level level, sheet->title = alloc(NULL, len, alloc_pw); if (sheet->title == NULL) { alloc(sheet->url, 0, alloc_pw); - css_selector_hash_destroy(sheet->selectors); - css_language_destroy(sheet->parser_frontend); - css_parser_destroy(sheet->parser); + css__selector_hash_destroy(sheet->selectors); + css__language_destroy(sheet->parser_frontend); + css__parser_destroy(sheet->parser); alloc(sheet, 0, alloc_pw); return CSS_NOMEM; } @@ -270,20 +270,20 @@ css_error css_stylesheet_destroy(css_stylesheet *sheet) r->prev = NULL; r->next = NULL; - css_stylesheet_rule_destroy(sheet, r); + css__stylesheet_rule_destroy(sheet, r); } - css_selector_hash_destroy(sheet->selectors); + css__selector_hash_destroy(sheet->selectors); /* These three may have been destroyed when parsing completed */ if (sheet->parser_frontend != NULL) - css_language_destroy(sheet->parser_frontend); + css__language_destroy(sheet->parser_frontend); if (sheet->parser != NULL) - css_parser_destroy(sheet->parser); + css__parser_destroy(sheet->parser); if (sheet->cached_style != NULL) - css_stylesheet_style_destroy(sheet->cached_style); + css__stylesheet_style_destroy(sheet->cached_style); /* destroy string vector */ for (string_index = 0; @@ -339,20 +339,20 @@ css_error css_stylesheet_data_done(css_stylesheet *sheet) if (sheet->parser == NULL) return CSS_INVALID; - error = css_parser_completed(sheet->parser); + error = css__parser_completed(sheet->parser); if (error != CSS_OK) return error; /* Destroy the parser, as it's no longer needed */ - css_language_destroy(sheet->parser_frontend); - css_parser_destroy(sheet->parser); + css__language_destroy(sheet->parser_frontend); + css__parser_destroy(sheet->parser); sheet->parser_frontend = NULL; sheet->parser = NULL; /* If we have a cached style, drop it as we're done parsing. */ if (sheet->cached_style != NULL) { - css_stylesheet_style_destroy(sheet->cached_style); + css__stylesheet_style_destroy(sheet->cached_style); sheet->cached_style = NULL; } @@ -607,7 +607,7 @@ css_error css_stylesheet_size(css_stylesheet *sheet, size_t *size) if (sheet->selectors != NULL) { size_t hash_size; - error = css_selector_hash_size(sheet->selectors, &hash_size); + error = css__selector_hash_size(sheet->selectors, &hash_size); if (error != CSS_OK) return error; @@ -638,7 +638,7 @@ css_error css_stylesheet_size(css_stylesheet *sheet, size_t *size) * CSS_BADPARM on bad parameters, * CSS_NOMEM on memory exhaustion */ -css_error css_stylesheet_style_create(css_stylesheet *sheet, css_style **style) +css_error css__stylesheet_style_create(css_stylesheet *sheet, css_style **style) { css_style *s; @@ -671,7 +671,7 @@ css_error css_stylesheet_style_create(css_stylesheet *sheet, css_style **style) return CSS_OK; } -css_error css_stylesheet_merge_style(css_style *target, css_style *style) +css_error css__stylesheet_merge_style(css_style *target, css_style *style) { css_code_t *newcode; uint32_t newcode_len; @@ -704,7 +704,7 @@ css_error css_stylesheet_merge_style(css_style *target, css_style *style) } /** append one or more css code entries to a style */ -css_error css_stylesheet_style_vappend(css_style *style, uint32_t style_count, ...) +css_error css__stylesheet_style_vappend(css_style *style, uint32_t style_count, ...) { va_list ap; css_error error = CSS_OK; @@ -713,7 +713,7 @@ css_error css_stylesheet_style_vappend(css_style *style, uint32_t style_count, . va_start(ap, style_count); while (style_count > 0) { css_code = va_arg(ap, css_code_t); - error = css_stylesheet_style_append(style, css_code); + error = css__stylesheet_style_append(style, css_code); if (error != CSS_OK) break; style_count--; @@ -723,7 +723,7 @@ css_error css_stylesheet_style_vappend(css_style *style, uint32_t style_count, . } /** append a css code entry to a style */ -css_error css_stylesheet_style_append(css_style *style, css_code_t css_code) +css_error css__stylesheet_style_append(css_style *style, css_code_t css_code) { css_stylesheet *sheet; @@ -756,7 +756,7 @@ css_error css_stylesheet_style_append(css_style *style, css_code_t css_code) * \param style The style to destroy * \return CSS_OK on success, appropriate error otherwise */ -css_error css_stylesheet_style_destroy(css_style *style) +css_error css__stylesheet_style_destroy(css_style *style) { css_stylesheet *sheet; @@ -791,7 +791,7 @@ css_error css_stylesheet_style_destroy(css_style *style) * CSS_BADPARM on bad parameters, * CSS_NOMEM on memory exhaustion */ -css_error css_stylesheet_selector_create(css_stylesheet *sheet, +css_error css__stylesheet_selector_create(css_stylesheet *sheet, lwc_string *name, css_selector **selector) { css_selector *sel; @@ -834,7 +834,7 @@ css_error css_stylesheet_selector_create(css_stylesheet *sheet, * \param selector The selector to destroy * \return CSS_OK on success, appropriate error otherwise */ -css_error css_stylesheet_selector_destroy(css_stylesheet *sheet, +css_error css__stylesheet_selector_destroy(css_stylesheet *sheet, css_selector *selector) { css_selector *c, *d; @@ -897,7 +897,7 @@ css_error css_stylesheet_selector_destroy(css_stylesheet *sheet, * \return CSS_OK on success, * CSS_BADPARM on bad parameters */ -css_error css_stylesheet_selector_detail_init(css_stylesheet *sheet, +css_error css__stylesheet_selector_detail_init(css_stylesheet *sheet, css_selector_type type, lwc_string *name, lwc_string *value, css_selector_detail *detail) @@ -922,7 +922,7 @@ css_error css_stylesheet_selector_detail_init(css_stylesheet *sheet, * \param specific The selector to append (copied) * \return CSS_OK on success, appropriate error otherwise. */ -css_error css_stylesheet_selector_append_specific(css_stylesheet *sheet, +css_error css__stylesheet_selector_append_specific(css_stylesheet *sheet, css_selector **parent, const css_selector_detail *detail) { css_selector *temp; @@ -995,7 +995,7 @@ css_error css_stylesheet_selector_append_specific(css_stylesheet *sheet, * with a combinator type of CSS_COMBINATOR_SIBLING. Thus, given B, we can * find its combinator. It is not possible to find B given A. */ -css_error css_stylesheet_selector_combine(css_stylesheet *sheet, +css_error css__stylesheet_selector_combine(css_stylesheet *sheet, css_combinator type, css_selector *a, css_selector *b) { const css_selector_detail *det; @@ -1033,7 +1033,7 @@ css_error css_stylesheet_selector_combine(css_stylesheet *sheet, * CSS_BADPARM on bad parameters, * CSS_NOMEM on memory exhaustion */ -css_error css_stylesheet_rule_create(css_stylesheet *sheet, css_rule_type type, +css_error css__stylesheet_rule_create(css_stylesheet *sheet, css_rule_type type, css_rule **rule) { css_rule *r; @@ -1086,7 +1086,7 @@ css_error css_stylesheet_rule_create(css_stylesheet *sheet, css_rule_type type, * \param rule The rule to destroy * \return CSS_OK on success, appropriate error otherwise */ -css_error css_stylesheet_rule_destroy(css_stylesheet *sheet, css_rule *rule) +css_error css__stylesheet_rule_destroy(css_stylesheet *sheet, css_rule *rule) { if (sheet == NULL || rule == NULL) return CSS_BADPARM; @@ -1110,14 +1110,14 @@ css_error css_stylesheet_rule_destroy(css_stylesheet *sheet, css_rule *rule) /* Detach from rule */ sel->rule = NULL; - css_stylesheet_selector_destroy(sheet, sel); + css__stylesheet_selector_destroy(sheet, sel); } if (s->selectors != NULL) sheet->alloc(s->selectors, 0, sheet->pw); if (s->style != NULL) - css_stylesheet_style_destroy(s->style); + css__stylesheet_style_destroy(s->style); } break; case CSS_RULE_CHARSET: @@ -1148,7 +1148,7 @@ css_error css_stylesheet_rule_destroy(css_stylesheet *sheet, css_rule *rule) c->prev = NULL; c->next = NULL; - css_stylesheet_rule_destroy(sheet, c); + css__stylesheet_rule_destroy(sheet, c); } } break; @@ -1157,7 +1157,7 @@ css_error css_stylesheet_rule_destroy(css_stylesheet *sheet, css_rule *rule) css_rule_font_face *font_face = (css_rule_font_face *) rule; if (font_face->style != NULL) - css_stylesheet_style_destroy(font_face->style); + css__stylesheet_style_destroy(font_face->style); } break; case CSS_RULE_PAGE: @@ -1166,11 +1166,11 @@ css_error css_stylesheet_rule_destroy(css_stylesheet *sheet, css_rule *rule) if (page->selector != NULL) { page->selector->rule = NULL; - css_stylesheet_selector_destroy(sheet, page->selector); + css__stylesheet_selector_destroy(sheet, page->selector); } if (page->style != NULL) - css_stylesheet_style_destroy(page->style); + css__stylesheet_style_destroy(page->style); } break; } @@ -1189,7 +1189,7 @@ css_error css_stylesheet_rule_destroy(css_stylesheet *sheet, css_rule *rule) * \param selector The selector to add * \return CSS_OK on success, appropriate error otherwise */ -css_error css_stylesheet_rule_add_selector(css_stylesheet *sheet, +css_error css__stylesheet_rule_add_selector(css_stylesheet *sheet, css_rule *rule, css_selector *selector) { css_rule_selector *r = (css_rule_selector *) rule; @@ -1227,7 +1227,7 @@ css_error css_stylesheet_rule_add_selector(css_stylesheet *sheet, * \param style The style to add * \return CSS_OK on success, appropriate error otherwise */ -css_error css_stylesheet_rule_append_style(css_stylesheet *sheet, +css_error css__stylesheet_rule_append_style(css_stylesheet *sheet, css_rule *rule, css_style *style) { css_style *current_style; @@ -1244,13 +1244,13 @@ css_error css_stylesheet_rule_append_style(css_stylesheet *sheet, current_style = ((css_rule_page *) rule)->style; if (current_style != NULL) { - error = css_stylesheet_merge_style(current_style, style); + error = css__stylesheet_merge_style(current_style, style); if (error != CSS_OK) return error; /* Done with style */ - css_stylesheet_style_destroy(style); + css__stylesheet_style_destroy(style); } else { /* No current style, so use this one */ current_style = style; @@ -1275,7 +1275,7 @@ css_error css_stylesheet_rule_append_style(css_stylesheet *sheet, * \param charset The charset * \return CSS_OK on success, appropriate error otherwise */ -css_error css_stylesheet_rule_set_charset(css_stylesheet *sheet, +css_error css__stylesheet_rule_set_charset(css_stylesheet *sheet, css_rule *rule, lwc_string *charset) { css_rule_charset *r = (css_rule_charset *) rule; @@ -1302,7 +1302,7 @@ css_error css_stylesheet_rule_set_charset(css_stylesheet *sheet, * \param media The applicable media types for the imported stylesheet * \return CSS_OK on success, appropriate error otherwise */ -css_error css_stylesheet_rule_set_nascent_import(css_stylesheet *sheet, +css_error css__stylesheet_rule_set_nascent_import(css_stylesheet *sheet, css_rule *rule, lwc_string *url, uint64_t media) { @@ -1329,7 +1329,7 @@ css_error css_stylesheet_rule_set_nascent_import(css_stylesheet *sheet, * \param media The applicable media types for the rule * \return CSS_OK on success, appropriate error otherwise */ -css_error css_stylesheet_rule_set_media(css_stylesheet *sheet, +css_error css__stylesheet_rule_set_media(css_stylesheet *sheet, css_rule *rule, uint64_t media) { css_rule_media *r = (css_rule_media *) rule; @@ -1354,7 +1354,7 @@ css_error css_stylesheet_rule_set_media(css_stylesheet *sheet, * \param selector The page selector * \return CSS_OK on success, appropriate error otherwise */ -css_error css_stylesheet_rule_set_page_selector(css_stylesheet *sheet, +css_error css__stylesheet_rule_set_page_selector(css_stylesheet *sheet, css_rule *rule, css_selector *selector) { css_rule_page *r = (css_rule_page *) rule; @@ -1384,7 +1384,7 @@ css_error css_stylesheet_rule_set_page_selector(css_stylesheet *sheet, * \param parent The parent rule, or NULL for a top-level rule * \return CSS_OK on success, appropriate error otherwise */ -css_error css_stylesheet_add_rule(css_stylesheet *sheet, css_rule *rule, +css_error css__stylesheet_add_rule(css_stylesheet *sheet, css_rule *rule, css_rule *parent) { css_error error; @@ -1454,7 +1454,7 @@ css_error css_stylesheet_add_rule(css_stylesheet *sheet, css_rule *rule, * \param rule The rule to remove * \return CSS_OK on success, appropriate error otherwise */ -css_error css_stylesheet_remove_rule(css_stylesheet *sheet, css_rule *rule) +css_error css__stylesheet_remove_rule(css_stylesheet *sheet, css_rule *rule) { css_error error; @@ -1523,14 +1523,14 @@ css_error _add_selectors(css_stylesheet *sheet, css_rule *rule) for (i = 0; i < rule->items; i++) { css_selector *sel = s->selectors[i]; - error = css_selector_hash_insert(sheet->selectors, sel); + error = css__selector_hash_insert(sheet->selectors, sel); if (error != CSS_OK) { /* Failed, revert our changes */ for (i--; i >= 0; i--) { sel = s->selectors[i]; /* Ignore errors */ - css_selector_hash_remove( + css__selector_hash_remove( sheet->selectors, sel); } @@ -1585,7 +1585,7 @@ css_error _remove_selectors(css_stylesheet *sheet, css_rule *rule) for (i = 0; i < rule->items; i++) { css_selector *sel = s->selectors[i]; - error = css_selector_hash_remove(sheet->selectors, sel); + error = css__selector_hash_remove(sheet->selectors, sel); if (error != CSS_OK) return error; } diff --git a/src/stylesheet.h b/src/stylesheet.h index 294f64a..827d8d6 100644 --- a/src/stylesheet.h +++ b/src/stylesheet.h @@ -187,72 +187,72 @@ struct css_stylesheet { uint32_t string_vector_c; /**< The number of string vector entries used */ }; -css_error css_stylesheet_style_create(css_stylesheet *sheet, css_style **style); -css_error css_stylesheet_style_append(css_style *style, css_code_t code); -css_error css_stylesheet_style_vappend(css_style *style, uint32_t style_count, ...); -css_error css_stylesheet_style_destroy(css_style *style); -css_error css_stylesheet_merge_style(css_style *target, css_style *style); +css_error css__stylesheet_style_create(css_stylesheet *sheet, css_style **style); +css_error css__stylesheet_style_append(css_style *style, css_code_t code); +css_error css__stylesheet_style_vappend(css_style *style, uint32_t style_count, ...); +css_error css__stylesheet_style_destroy(css_style *style); +css_error css__stylesheet_merge_style(css_style *target, css_style *style); /** Helper function to avoid distinct buildOPV call */ -static inline css_error css_stylesheet_style_appendOPV(css_style *style, opcode_t opcode, uint8_t flags, uint16_t value) +static inline css_error css__stylesheet_style_appendOPV(css_style *style, opcode_t opcode, uint8_t flags, uint16_t value) { - return css_stylesheet_style_append(style, buildOPV(opcode, flags, value)); + return css__stylesheet_style_append(style, buildOPV(opcode, flags, value)); } /** Helper function to set inherit flag */ static inline css_error css_stylesheet_style_inherit(css_style *style, opcode_t opcode) { - return css_stylesheet_style_append(style, buildOPV(opcode, FLAG_INHERIT, 0)); + return css__stylesheet_style_append(style, buildOPV(opcode, FLAG_INHERIT, 0)); } -css_error css_stylesheet_selector_create(css_stylesheet *sheet, +css_error css__stylesheet_selector_create(css_stylesheet *sheet, lwc_string *name, css_selector **selector); -css_error css_stylesheet_selector_destroy(css_stylesheet *sheet, +css_error css__stylesheet_selector_destroy(css_stylesheet *sheet, css_selector *selector); -css_error css_stylesheet_selector_detail_init(css_stylesheet *sheet, +css_error css__stylesheet_selector_detail_init(css_stylesheet *sheet, css_selector_type type, lwc_string *name, lwc_string *value, css_selector_detail *detail); -css_error css_stylesheet_selector_append_specific(css_stylesheet *sheet, +css_error css__stylesheet_selector_append_specific(css_stylesheet *sheet, css_selector **parent, const css_selector_detail *specific); -css_error css_stylesheet_selector_combine(css_stylesheet *sheet, +css_error css__stylesheet_selector_combine(css_stylesheet *sheet, css_combinator type, css_selector *a, css_selector *b); -css_error css_stylesheet_rule_create(css_stylesheet *sheet, css_rule_type type, +css_error css__stylesheet_rule_create(css_stylesheet *sheet, css_rule_type type, css_rule **rule); -css_error css_stylesheet_rule_destroy(css_stylesheet *sheet, css_rule *rule); +css_error css__stylesheet_rule_destroy(css_stylesheet *sheet, css_rule *rule); -css_error css_stylesheet_rule_add_selector(css_stylesheet *sheet, +css_error css__stylesheet_rule_add_selector(css_stylesheet *sheet, css_rule *rule, css_selector *selector); -css_error css_stylesheet_rule_append_style(css_stylesheet *sheet, +css_error css__stylesheet_rule_append_style(css_stylesheet *sheet, css_rule *rule, css_style *style); -css_error css_stylesheet_rule_set_charset(css_stylesheet *sheet, +css_error css__stylesheet_rule_set_charset(css_stylesheet *sheet, css_rule *rule, lwc_string *charset); -css_error css_stylesheet_rule_set_nascent_import(css_stylesheet *sheet, +css_error css__stylesheet_rule_set_nascent_import(css_stylesheet *sheet, css_rule *rule, lwc_string *url, uint64_t media); -css_error css_stylesheet_rule_set_media(css_stylesheet *sheet, +css_error css__stylesheet_rule_set_media(css_stylesheet *sheet, css_rule *rule, uint64_t media); -css_error css_stylesheet_rule_set_page_selector(css_stylesheet *sheet, +css_error css__stylesheet_rule_set_page_selector(css_stylesheet *sheet, css_rule *rule, css_selector *sel); -css_error css_stylesheet_add_rule(css_stylesheet *sheet, css_rule *rule, +css_error css__stylesheet_add_rule(css_stylesheet *sheet, css_rule *rule, css_rule *parent); -css_error css_stylesheet_remove_rule(css_stylesheet *sheet, css_rule *rule); +css_error css__stylesheet_remove_rule(css_stylesheet *sheet, css_rule *rule); -css_error css_stylesheet_string_get(css_stylesheet *sheet, uint32_t string_number, lwc_string **string); +css_error css__stylesheet_string_get(css_stylesheet *sheet, uint32_t string_number, lwc_string **string); -css_error css_stylesheet_string_add(css_stylesheet *sheet, lwc_string *string, uint32_t *string_number); +css_error css__stylesheet_string_add(css_stylesheet *sheet, lwc_string *string, uint32_t *string_number); #endif -- cgit v1.2.3