summaryrefslogtreecommitdiff
path: root/src/stylesheet.c
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2008-11-09 20:09:50 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2008-11-09 20:09:50 +0000
commit83c070f67a2c26672f0ddad9b7e9104c16d7015f (patch)
tree8baa79156f9e837972f4103e7d955d670b29f397 /src/stylesheet.c
parent93db0a01a331b1820ba26e1ced4cb288ee8bb47d (diff)
downloadlibcss-83c070f67a2c26672f0ddad9b7e9104c16d7015f.tar.gz
libcss-83c070f67a2c26672f0ddad9b7e9104c16d7015f.tar.bz2
Port libcss to new lpu API.
Make lexer, core parser, and css21 parser constructors&destructors return errors svn path=/trunk/libcss/; revision=5674
Diffstat (limited to 'src/stylesheet.c')
-rw-r--r--src/stylesheet.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/stylesheet.c b/src/stylesheet.c
index 9be6d70..333a650 100644
--- a/src/stylesheet.c
+++ b/src/stylesheet.c
@@ -33,6 +33,7 @@ css_stylesheet *css_stylesheet_create(css_language_level level,
css_import_handler import_callback, void *import_pw,
css_alloc alloc, void *alloc_pw)
{
+ css_error error;
css_stylesheet *sheet;
size_t len;
@@ -45,10 +46,10 @@ css_stylesheet *css_stylesheet_create(css_language_level level,
memset(sheet, 0, sizeof(css_stylesheet));
- sheet->parser = css_parser_create(charset,
+ error = css_parser_create(charset,
charset ? CSS_CHARSET_DICTATED : CSS_CHARSET_DEFAULT,
- alloc, alloc_pw);
- if (sheet->parser == NULL) {
+ alloc, alloc_pw, &sheet->parser);
+ if (error != CSS_OK) {
alloc(sheet, 0, alloc_pw);
return NULL;
}
@@ -61,9 +62,9 @@ css_stylesheet *css_stylesheet_create(css_language_level level,
}
sheet->level = level;
- sheet->parser_frontend =
- css_css21_create(sheet, sheet->parser, alloc, alloc_pw);
- if (sheet->parser_frontend == NULL) {
+ error = css_css21_create(sheet, sheet->parser, alloc, alloc_pw,
+ &sheet->parser_frontend);
+ if (error != CSS_OK) {
css_parser_destroy(sheet->parser);
alloc(sheet, 0, alloc_pw);
return NULL;