aboutsummaryrefslogtreecommitdiffstats
path: root/serd
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-01-20 18:12:59 +0000
committerDavid Robillard <d@drobilla.net>2011-01-20 18:12:59 +0000
commitf0c50e7461641d060c783e1f0fb1b74b3c175054 (patch)
tree42f464e24cb30205af5c457a90f25753ceea3714 /serd
parent1c5d7f65aee365a856415adf8dbbcf4dfffa0fa6 (diff)
downloadserd-f0c50e7461641d060c783e1f0fb1b74b3c175054.tar.gz
serd-f0c50e7461641d060c783e1f0fb1b74b3c175054.tar.bz2
serd-f0c50e7461641d060c783e1f0fb1b74b3c175054.zip
Flesh out documentation.
git-svn-id: http://svn.drobilla.net/serd/trunk@12 490d8e77-9747-427b-9fa3-0b8f29cee8a0
Diffstat (limited to 'serd')
-rw-r--r--serd/serd.h39
1 files changed, 21 insertions, 18 deletions
diff --git a/serd/serd.h b/serd/serd.h
index 3c39e593..98aea4b5 100644
--- a/serd/serd.h
+++ b/serd/serd.h
@@ -53,9 +53,8 @@ extern "C" {
* @{
*/
-typedef struct SerdNamespacesImpl* SerdNamespaces;
-typedef struct SerdReaderImpl* SerdReader;
-
+typedef struct SerdNamespacesImpl* SerdNamespaces; ///< Set of namespaces
+typedef struct SerdReaderImpl* SerdReader; ///< RDF reader
/** RDF syntax */
typedef enum {
@@ -75,21 +74,24 @@ typedef enum {
* @{
*/
-/* Range of memory. */
+/** A chunk of memory (non-terminated string). */
typedef struct {
- const uint8_t* buf;
- size_t len;
-} SerdRange;
-
-/* Parsed URI. */
+ const uint8_t* buf; ///< Start of chunk
+ size_t len; ///< Length of chunk in bytes
+} SerdChunk;
+
+/** A parsed URI.
+ * This struct directly refers to chunks in other strings, it does not own
+ * any memory itself. Thus, URIs can be parsed and/or resolved against a
+ * base URI in-place without allocating memory.
+ */
typedef struct {
- SerdRange scheme; ///< Scheme
- SerdRange authority; ///< Authority
- SerdRange path_base; ///< Path prefix if relative
- SerdRange path; ///< Path suffix
- SerdRange query; ///< Query
- SerdRange fragment; ///< Fragment
- bool base_uri_has_authority; ///< True iff base URI has authority
+ SerdChunk scheme; ///< Scheme
+ SerdChunk authority; ///< Authority
+ SerdChunk path_base; ///< Path prefix if relative
+ SerdChunk path; ///< Path suffix
+ SerdChunk query; ///< Query
+ SerdChunk fragment; ///< Fragment
} SerdURI;
/** Return true iff @a utf8 is a relative URI string. */
@@ -149,6 +151,7 @@ SerdString*
serd_string_new_from_uri(const SerdURI* uri,
SerdURI* out);
+/** Write a node to @a file. */
SERD_API
bool
serd_write_node(FILE* file,
@@ -237,8 +240,8 @@ SERD_API
bool
serd_namespaces_expand(SerdNamespaces ns,
const SerdString* qname,
- SerdRange* uri_prefix,
- SerdRange* uri_suffix);
+ SerdChunk* uri_prefix,
+ SerdChunk* uri_suffix);
/** @} */