diff options
author | David Robillard <d@drobilla.net> | 2011-01-24 21:11:53 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-01-24 21:11:53 +0000 |
commit | 6903e56e2443a1a5b023d688cb7fd54e3580316d (patch) | |
tree | 291d35f268ed8de8ed1a671800d3481003abc4dc /src/serd_internal.h | |
parent | cffc0e7bb7a52153673d3eba2e31d6b2930a6248 (diff) | |
download | serd-6903e56e2443a1a5b023d688cb7fd54e3580316d.tar.gz serd-6903e56e2443a1a5b023d688cb7fd54e3580316d.tar.bz2 serd-6903e56e2443a1a5b023d688cb7fd54e3580316d.zip |
Remove SerdString from public API in favour of more expressive (and not necessarily inline with data payload) SerdNode.
git-svn-id: http://svn.drobilla.net/serd/trunk@53 490d8e77-9747-427b-9fa3-0b8f29cee8a0
Diffstat (limited to 'src/serd_internal.h')
-rw-r--r-- | src/serd_internal.h | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/src/serd_internal.h b/src/serd_internal.h index 49db82d5..1b601e12 100644 --- a/src/serd_internal.h +++ b/src/serd_internal.h @@ -8,11 +8,11 @@ * * Serd is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * License for details. * * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef SERD_INTERNAL_H @@ -30,7 +30,7 @@ typedef struct { size_t size; ///< Conceptual size of stack in buf } SerdStack; -/** An offset to start the stack at. Note 0 is reserved for NULL. */ +/** An offset to start the stack at. Note 0 is reserved for NULL. */ #define SERD_STACK_BOTTOM sizeof(void*) static inline SerdStack @@ -99,4 +99,27 @@ is_digit(const uint8_t c) return in_range(c, '0', '9'); } +/** Measured UTF-8 string. */ +typedef struct { + size_t n_bytes; ///< Size in bytes including trailing null byte + size_t n_chars; ///< Length in characters + uint8_t buf[]; ///< Buffer +} SerdString; + +#if 0 +/** Create a new UTF-8 string from @a utf8. */ +SerdString* +serd_string_new(const uint8_t* utf8); + +/** Copy @a string. */ +SerdString* +serd_string_copy(const SerdString* str); +#endif + +void +serd_string_free(SerdString* str); + +SerdString* +serd_string_new_from_node(const SerdNode* node); + #endif // SERD_INTERNAL_H |