summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/parse/language.c2
-rw-r--r--src/parse/parse.c18
-rw-r--r--src/parse/parse.h4
-rw-r--r--src/stylesheet.c20
-rw-r--r--src/stylesheet.h4
5 files changed, 24 insertions, 24 deletions
diff --git a/src/parse/language.c b/src/parse/language.c
index 4273658..d229c2a 100644
--- a/src/parse/language.c
+++ b/src/parse/language.c
@@ -409,7 +409,7 @@ css_error handleStartAtRule(css_language *c, const parserutils_vector *vector)
return CSS_INVALID;
}
- entry.data = atkeyword->lower.data;
+ entry.data = (void *) atkeyword->lower.data;
perror = parserutils_stack_push(c->context, (void *) &entry);
if (perror != PARSERUTILS_OK) {
diff --git a/src/parse/parse.c b/src/parse/parse.c
index bfa6c27..d7ad461 100644
--- a/src/parse/parse.c
+++ b/src/parse/parse.c
@@ -10,7 +10,7 @@
#include <stdbool.h>
#include <parserutils/input/inputstream.h>
-#include <parserutils/utils/dict.h>
+#include <parserutils/utils/hash.h>
#include <parserutils/utils/stack.h>
#include <parserutils/utils/vector.h>
@@ -91,7 +91,7 @@ struct css_parser
#define STACK_CHUNK 32
parserutils_stack *states; /**< Stack of states */
- parserutils_dict *dictionary; /**< Dictionary for interned strings */
+ parserutils_hash *dictionary; /**< Dictionary for interned strings */
parserutils_vector *tokens; /**< Vector of pending tokens */
@@ -185,7 +185,7 @@ static css_error (*parseFuncs[])(css_parser *parser) = {
* CSS_NOMEM on memory exhaustion
*/
css_error css_parser_create(const char *charset, css_charset_source cs_source,
- parserutils_dict *dictionary, css_alloc alloc, void *pw,
+ parserutils_hash *dictionary, css_alloc alloc, void *pw,
css_parser **parser)
{
css_parser *p;
@@ -420,13 +420,13 @@ const char *css_parser_read_charset(css_parser *parser,
const uint8_t *css_parser_dict_add(css_parser *parser, const uint8_t *data,
size_t len)
{
- const parserutils_dict_entry *interned;
+ const parserutils_hash_entry *interned;
parserutils_error perror;
if (parser == NULL || data == NULL || len == 0)
return NULL;
- perror = parserutils_dict_insert(parser->dictionary, data, len,
+ perror = parserutils_hash_insert(parser->dictionary, data, len,
&interned);
if (perror != PARSERUTILS_OK)
return NULL;
@@ -584,7 +584,7 @@ css_error getToken(css_parser *parser, const css_token **token)
if (t->type != CSS_TOKEN_S &&
t->data.data != NULL && t->data.len > 0) {
/* Insert token text into the dictionary */
- const parserutils_dict_entry *interned;
+ const parserutils_hash_entry *interned;
uint8_t temp[t->data.len];
bool lower = false;
@@ -607,7 +607,7 @@ css_error getToken(css_parser *parser, const css_token **token)
/* We get to insert it twice - once for the raw
* data, and once for a lowercased version that
* we need internally. */
- perror = parserutils_dict_insert(
+ perror = parserutils_hash_insert(
parser->dictionary,
temp, t->data.len,
&interned);
@@ -619,13 +619,13 @@ css_error getToken(css_parser *parser, const css_token **token)
t->lower.data = interned->data;
t->lower.len = interned->len;
- perror = parserutils_dict_insert(
+ perror = parserutils_hash_insert(
parser->dictionary,
t->data.data, t->data.len,
&interned);
} else {
/* Otherwise, we're not interested in case */
- perror = parserutils_dict_insert(
+ perror = parserutils_hash_insert(
parser->dictionary,
t->data.data, t->data.len,
&interned);
diff --git a/src/parse/parse.h b/src/parse/parse.h
index a948d56..7e57791 100644
--- a/src/parse/parse.h
+++ b/src/parse/parse.h
@@ -8,7 +8,7 @@
#ifndef css_parse_parse_h_
#define css_parse_parse_h_
-#include <parserutils/utils/dict.h>
+#include <parserutils/utils/hash.h>
#include <parserutils/utils/vector.h>
#include <libcss/errors.h>
@@ -57,7 +57,7 @@ typedef union css_parser_optparams {
} css_parser_optparams;
css_error css_parser_create(const char *charset, css_charset_source cs_source,
- parserutils_dict *dict, css_alloc alloc, void *pw,
+ parserutils_hash *dict, css_alloc alloc, void *pw,
css_parser **parser);
css_error css_parser_destroy(css_parser *parser);
diff --git a/src/stylesheet.c b/src/stylesheet.c
index 5c6e68d..b2e1c0e 100644
--- a/src/stylesheet.c
+++ b/src/stylesheet.c
@@ -51,7 +51,7 @@ css_error css_stylesheet_create(css_language_level level,
memset(sheet, 0, sizeof(css_stylesheet));
- perror = parserutils_dict_create((parserutils_alloc) alloc, alloc_pw,
+ perror = parserutils_hash_create((parserutils_alloc) alloc, alloc_pw,
&sheet->dictionary);
if (perror != PARSERUTILS_OK) {
alloc(sheet, 0, alloc_pw);
@@ -62,7 +62,7 @@ css_error css_stylesheet_create(css_language_level level,
charset ? CSS_CHARSET_DICTATED : CSS_CHARSET_DEFAULT,
sheet->dictionary, alloc, alloc_pw, &sheet->parser);
if (error != CSS_OK) {
- parserutils_dict_destroy(sheet->dictionary);
+ parserutils_hash_destroy(sheet->dictionary);
alloc(sheet, 0, alloc_pw);
return error;
}
@@ -72,7 +72,7 @@ css_error css_stylesheet_create(css_language_level level,
&sheet->parser_frontend);
if (error != CSS_OK) {
css_parser_destroy(sheet->parser);
- parserutils_dict_destroy(sheet->dictionary);
+ parserutils_hash_destroy(sheet->dictionary);
alloc(sheet, 0, alloc_pw);
return error;
}
@@ -84,7 +84,7 @@ css_error css_stylesheet_create(css_language_level level,
if (sheet->url == NULL) {
css_language_destroy(sheet->parser_frontend);
css_parser_destroy(sheet->parser);
- parserutils_dict_destroy(sheet->dictionary);
+ parserutils_hash_destroy(sheet->dictionary);
alloc(sheet, 0, alloc_pw);
return CSS_NOMEM;
}
@@ -97,7 +97,7 @@ css_error css_stylesheet_create(css_language_level level,
alloc(sheet->url, 0, alloc_pw);
css_language_destroy(sheet->parser_frontend);
css_parser_destroy(sheet->parser);
- parserutils_dict_destroy(sheet->dictionary);
+ parserutils_hash_destroy(sheet->dictionary);
alloc(sheet, 0, alloc_pw);
return CSS_NOMEM;
}
@@ -129,7 +129,7 @@ css_error css_stylesheet_destroy(css_stylesheet *sheet)
if (sheet == NULL)
return CSS_BADPARM;
- parserutils_dict_destroy(sheet->dictionary);
+ parserutils_hash_destroy(sheet->dictionary);
if (sheet->title != NULL)
sheet->alloc(sheet->title, 0, sheet->pw);
@@ -376,7 +376,7 @@ css_error css_stylesheet_selector_create(css_stylesheet *sheet,
* the dictionary, it would be more efficient to pass a pointer to the
* dictionary entry around rather than re-discovering it here. The same
* applies for value, and in css_stylesheet_selector_detail_create() */
- perror = parserutils_dict_insert(sheet->dictionary, name->data,
+ perror = parserutils_hash_insert(sheet->dictionary, name->data,
name->len, &iname);
if (perror != PARSERUTILS_OK) {
sheet->alloc(sel, 0, sheet->pw);
@@ -385,7 +385,7 @@ css_error css_stylesheet_selector_create(css_stylesheet *sheet,
sel->data.name = iname;
if (value != NULL) {
- perror = parserutils_dict_insert(sheet->dictionary,
+ perror = parserutils_hash_insert(sheet->dictionary,
value->data, value->len, &ivalue);
if (perror != PARSERUTILS_OK) {
sheet->alloc(sel, 0, sheet->pw);
@@ -454,7 +454,7 @@ css_error css_stylesheet_selector_detail_create(css_stylesheet *sheet,
det->type = type;
- perror = parserutils_dict_insert(sheet->dictionary, name->data,
+ perror = parserutils_hash_insert(sheet->dictionary, name->data,
name->len, &iname);
if (perror != PARSERUTILS_OK) {
sheet->alloc(det, 0, sheet->pw);
@@ -463,7 +463,7 @@ css_error css_stylesheet_selector_detail_create(css_stylesheet *sheet,
det->name = iname;
if (value != NULL) {
- perror = parserutils_dict_insert(sheet->dictionary,
+ perror = parserutils_hash_insert(sheet->dictionary,
value->data, value->len, &ivalue);
if (perror != PARSERUTILS_OK) {
sheet->alloc(det, 0, sheet->pw);
diff --git a/src/stylesheet.h b/src/stylesheet.h
index a331299..1ab3939 100644
--- a/src/stylesheet.h
+++ b/src/stylesheet.h
@@ -11,7 +11,7 @@
#include <inttypes.h>
#include <stdio.h>
-#include <parserutils/utils/dict.h>
+#include <parserutils/utils/hash.h>
#include <libcss/errors.h>
#include <libcss/functypes.h>
@@ -169,7 +169,7 @@ struct css_stylesheet {
css_parser *parser; /**< Core parser for sheet */
void *parser_frontend; /**< Frontend parser */
- parserutils_dict *dictionary; /**< String dictionary */
+ parserutils_hash *dictionary; /**< String dictionary */
css_alloc alloc; /**< Allocation function */
void *pw; /**< Private word */