From 94ff706d99220d915be8cedcda6b93ead998f5b8 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Wed, 1 Jul 2009 10:35:37 +0000 Subject: Make all URIs absolute svn path=/trunk/libcss/; revision=8228 --- src/stylesheet.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/stylesheet.c') diff --git a/src/stylesheet.c b/src/stylesheet.c index 9afed2b..bfd159f 100644 --- a/src/stylesheet.c +++ b/src/stylesheet.c @@ -31,6 +31,8 @@ static css_error _remove_selectors(css_stylesheet *sheet, css_rule *rule); * \param dict Dictionary in which to intern strings * \param alloc Memory (de)allocation function * \param alloc_pw Client private data for alloc + * \param resolve URL resolution function + * \param resolve_pw Client private data for resolve * \param stylesheet Pointer to location to receive stylesheet * \return CSS_OK on success, * CSS_BADPARM on bad parameters, @@ -41,6 +43,7 @@ css_error css_stylesheet_create(css_language_level level, css_origin origin, uint64_t media, bool allow_quirks, bool inline_style, lwc_context *dict, css_allocator_fn alloc, void *alloc_pw, + css_url_resolution_fn resolve, void *resolve_pw, css_stylesheet **stylesheet) { css_parser_optparams params; @@ -48,7 +51,8 @@ css_error css_stylesheet_create(css_language_level level, css_stylesheet *sheet; size_t len; - if (url == NULL || alloc == NULL || stylesheet == NULL) + if (url == NULL || alloc == NULL || + resolve == NULL || stylesheet == NULL) return CSS_BADPARM; sheet = alloc(NULL, sizeof(css_stylesheet), alloc_pw); @@ -115,6 +119,7 @@ css_error css_stylesheet_create(css_language_level level, return CSS_NOMEM; } memcpy(sheet->url, url, len); + sheet->url[len] = '\0'; if (title != NULL) { len = strlen(title) + 1; @@ -128,11 +133,15 @@ css_error css_stylesheet_create(css_language_level level, return CSS_NOMEM; } memcpy(sheet->title, title, len); + sheet->title[len] = '\0'; } sheet->origin = origin; sheet->media = media; + sheet->resolve = resolve; + sheet->resolve_pw = resolve_pw; + sheet->alloc = alloc; sheet->pw = alloc_pw; -- cgit v1.2.3