diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2007-07-06 14:32:44 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2007-07-06 14:32:44 +0000 |
commit | 7f29141f5069d02843468785a54543a2f6d9260a (patch) | |
tree | 18a60e0aa3081bcb49156782f4c30576679cdc52 /include/dom/core/string.h | |
download | libdom-7f29141f5069d02843468785a54543a2f6d9260a.tar.gz libdom-7f29141f5069d02843468785a54543a2f6d9260a.tar.bz2 |
Import DOM library.
This is mainly stub functions atm (and is missing a number of key interfaces).
svn path=/trunk/dom/; revision=3384
Diffstat (limited to 'include/dom/core/string.h')
-rw-r--r-- | include/dom/core/string.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/include/dom/core/string.h b/include/dom/core/string.h new file mode 100644 index 0000000..f79eaa7 --- /dev/null +++ b/include/dom/core/string.h @@ -0,0 +1,40 @@ +/* + * This file is part of libdom. + * Licensed under the MIT License, + * http://www.opensource.org/licenses/mit-license.php + * Copyright 2007 John-Mark Bell <jmb@netsurf-browser.org> + */ + +#ifndef dom_string_h_ +#define dom_string_h_ + +#include <inttypes.h> +#include <stddef.h> + +#include <dom/core/exceptions.h> + +struct dom_ctx; +struct dom_document; +struct dom_string; + +/* Claim a reference on a DOM string */ +void dom_string_ref(struct dom_ctx *ctx, struct dom_string *str); +/* Release a reference on a DOM string */ +void dom_string_unref(struct dom_ctx *ctx, struct dom_string *str); + +/* Create a DOM string from an offset into the document buffer */ +dom_exception dom_string_create_from_off(struct dom_ctx *ctx, + struct dom_document *doc, uint32_t off, size_t len, + struct dom_string **str); +/* Create a DOM string from a string of characters */ +dom_exception dom_string_create_from_ptr(struct dom_ctx *ctx, + const uint8_t *ptr, size_t len, struct dom_string **str); +/* Create a DOM string from a constant string of characters */ +dom_exception dom_string_create_from_const_ptr(struct dom_ctx *ctx, + const uint8_t *ptr, size_t len, struct dom_string **str); + +/* Get a pointer to the string of characters within a DOM string */ +dom_exception dom_string_get_data(struct dom_ctx *ctx, + struct dom_string *str, const uint8_t **data, size_t *len); + +#endif |