diff options
author | Lauri Aalto <laalto@iki.fi> | 2008-09-12 13:26:30 +0000 |
---|---|---|
committer | Lauri Aalto <laalto@iki.fi> | 2008-09-12 13:26:30 +0000 |
commit | f41a5533fe9a177b1648e2d0eed2e2cf4505b7eb (patch) | |
tree | a4c840b6f78786421730de31e45b50de04b0e686 /src/raptor_uri.c | |
parent | 75b296f73a36c74faed236fd10a12573f530683a (diff) | |
download | raptor-f41a5533fe9a177b1648e2d0eed2e2cf4505b7eb.tar.gz |
(raptor_new_uri_from_id_v2): Added new API function to replace raptor_new_uri_from_id(). Refactored internals to use raptor v2 raptor_world APIs.
Diffstat (limited to 'src/raptor_uri.c')
-rw-r--r-- | src/raptor_uri.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/src/raptor_uri.c b/src/raptor_uri.c index 3afa0aa8..5028e678 100644 --- a/src/raptor_uri.c +++ b/src/raptor_uri.c @@ -369,12 +369,35 @@ raptor_new_uri_relative_to_base_v2(raptor_world* world, * * This creates a URI equivalent to concatenating @base_uri with * ## and @id. + * + * raptor_init() MUST have been called before calling this function. + * Use raptor_new_uri_from_id_v2() if using raptor_world APIs. * * Return value: a new #raptor_uri object or NULL on failure. **/ raptor_uri* raptor_new_uri_from_id(raptor_uri *base_uri, const unsigned char *id) { + return raptor_new_uri_from_id_v2(raptor_world_instance(), base_uri, id); +} + + +/** + * raptor_new_uri_from_id_v2: + * @world: raptor_world object + * @base_uri: existing base URI + * @id: RDF ID + * + * Constructor - create a new URI from a base URI and RDF ID. + * + * This creates a URI equivalent to concatenating @base_uri with + * ## and @id. + * + * Return value: a new #raptor_uri object or NULL on failure. + **/ +raptor_uri* +raptor_new_uri_from_id_v2(raptor_world *world, raptor_uri *base_uri, const unsigned char *id) +{ raptor_uri *new_uri; unsigned char *local_name; int len; @@ -393,7 +416,7 @@ raptor_new_uri_from_id(raptor_uri *base_uri, const unsigned char *id) return NULL; *local_name='#'; strcpy((char*)local_name+1, (char*)id); - new_uri=raptor_new_uri_relative_to_base(base_uri, local_name); + new_uri=raptor_new_uri_relative_to_base_v2(world, base_uri, local_name); RAPTOR_FREE(cstring, local_name); return new_uri; } |