diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2013-12-13 20:16:52 +0000 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2013-12-13 20:16:52 +0000 |
commit | 1b95fec601a3d006ba6b99e1dea3f61c3c8318fc (patch) | |
tree | 1a0c3a78afe1db919ff6b4c56a6c3f2e01d03607 /src/select/font_face.c | |
parent | e3372335ec1628e1d6ef1a4fd63b11bb47f2e0e6 (diff) | |
download | libcss-1b95fec601a3d006ba6b99e1dea3f61c3c8318fc.tar.gz libcss-1b95fec601a3d006ba6b99e1dea3f61c3c8318fc.tar.bz2 |
Various changes which modify API and ABI:
- Remove client allocation function.
- Change node_classes callback not to yield array ownership to libcss.
- Node bloom filters now built by, during selection libcss.
- Added selection callbacks to get and set data on document nodes.
Test suite, example, and documentation updated to match.
Diffstat (limited to 'src/select/font_face.c')
-rw-r--r-- | src/select/font_face.c | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/src/select/font_face.c b/src/select/font_face.c index cd6556a..ea790eb 100644 --- a/src/select/font_face.c +++ b/src/select/font_face.c @@ -21,7 +21,7 @@ static void font_faces_srcs_destroy(css_font_face *font_face) } } - font_face->alloc(srcs, 0, font_face->pw); + free(srcs); font_face->srcs = NULL; } @@ -29,38 +29,30 @@ static const css_font_face default_font_face = { NULL, NULL, 0, - { (CSS_FONT_WEIGHT_NORMAL << 2) | CSS_FONT_STYLE_NORMAL }, - NULL, - NULL + { (CSS_FONT_WEIGHT_NORMAL << 2) | CSS_FONT_STYLE_NORMAL } }; /** * Create a font-face * - * \param alloc Memory (de)allocation function - * \param pw Pointer to client-specific data * \param result Pointer to location to receive result * \return CSS_OK on success, * CSS_NOMEM on memory exhaustion, * CSS_BADPARM on bad parameters. */ -css_error css__font_face_create(css_allocator_fn alloc, void *pw, - css_font_face **result) +css_error css__font_face_create(css_font_face **result) { css_font_face *f; - if (alloc == NULL || result == NULL) + if (result == NULL) return CSS_BADPARM; - f = alloc(NULL, sizeof(css_font_face), pw); + f = malloc(sizeof(css_font_face)); if (f == NULL) return CSS_NOMEM; memcpy(f, &default_font_face, sizeof(css_font_face)); - f->alloc = alloc; - f->pw = pw; - *result = f; return CSS_OK; @@ -83,7 +75,7 @@ css_error css__font_face_destroy(css_font_face *font_face) if (font_face->srcs != NULL) font_faces_srcs_destroy(font_face); - font_face->alloc(font_face, 0, font_face->pw); + free(font_face); return CSS_OK; } |