From de5aa9e275107f59cdf12f76fe55895605ee7dc6 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 27 Sep 2011 22:26:16 +0000 Subject: Add serd_env_set_prefix_from_strings for convenience. Fix configure --debug. git-svn-id: http://svn.drobilla.net/serd/trunk@217 490d8e77-9747-427b-9fa3-0b8f29cee8a0 --- ChangeLog | 1 + serd/serd.h | 9 +++++++++ src/env.c | 14 ++++++++++++++ wscript | 8 ++++---- 4 files changed, 28 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9c5b26c8..3e05ac6b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,7 @@ serd (UNRELEASED) unstable; urgency=low * Avoid writing illegal Turtle names as a result of URI qualifying * Gracefully handle NULL reader sinks * Add serd_strerror + * Add serd_env_set_prefix_from_strings for convenience * Fix erroneously equal SERD_ERR_BAD_SYNTAX and SERD_ERR_BAD_ARG * Add ability to build static library diff --git a/serd/serd.h b/serd/serd.h index 583c6eec..0651d734 100644 --- a/serd/serd.h +++ b/serd/serd.h @@ -471,6 +471,15 @@ serd_env_set_prefix(SerdEnv* env, const SerdNode* name, const SerdNode* uri); +/** + Set a namespace prefix. +*/ +SERD_API +SerdStatus +serd_env_set_prefix_from_strings(SerdEnv* env, + const uint8_t* name, + const uint8_t* uri); + /** Qualify @c uri into a CURIE if possible. */ diff --git a/src/env.c b/src/env.c index f7204121..d53ef73e 100644 --- a/src/env.c +++ b/src/env.c @@ -152,6 +152,20 @@ serd_env_set_prefix(SerdEnv* env, return SERD_SUCCESS; } +SERD_API +SerdStatus +serd_env_set_prefix_from_strings(SerdEnv* env, + const uint8_t* name, + const uint8_t* uri) +{ + const SerdNode name_node = serd_node_from_string(SERD_LITERAL, name); + const SerdNode uri_node = serd_node_from_string(SERD_URI, uri); + + SerdStatus ret = serd_env_set_prefix(env, &name_node, &uri_node); + + return ret; +} + static inline bool is_nameStartChar(const uint8_t c) { diff --git a/wscript b/wscript index d7d064e5..fd813323 100644 --- a/wscript +++ b/wscript @@ -9,7 +9,7 @@ from waflib.extras import autowaf as autowaf import waflib.Logs as Logs, waflib.Options as Options # Version of this package (even if built as a child) -SERD_VERSION = '0.4.5' +SERD_VERSION = '0.5.0' SERD_MAJOR_VERSION = '0' # Library version (UNIX style major, minor, micro) @@ -40,12 +40,12 @@ def options(opt): help="Build static library") def configure(conf): + conf.load('compiler_c') + autowaf.configure(conf) - conf.line_just = 13 autowaf.display_header('Serd Configuration') - conf.load('compiler_c') - conf.env.append_value('CFLAGS', '-std=c99') + conf.env.append_unique('CFLAGS', '-std=c99') conf.env['BUILD_TESTS'] = Options.options.build_tests conf.env['BUILD_UTILS'] = not Options.options.no_utils -- cgit v1.2.1