aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-12-29 19:56:13 -0500
committerDavid Robillard <d@drobilla.net>2018-12-31 11:37:49 -0500
commit201888d97b1382632fcd7b335c37030c8a4922d8 (patch)
treed772f34887be39d41c2f7ed00c5686fc70e399a0
parent8790f785102ffc5b205ee1ea1fc2586164a6f383 (diff)
downloadserd-201888d97b1382632fcd7b335c37030c8a4922d8.tar.gz
serd-201888d97b1382632fcd7b335c37030c8a4922d8.tar.bz2
serd-201888d97b1382632fcd7b335c37030c8a4922d8.zip
Rename SerdType to SerdNodeType
The old name has become ambiguous with the expanded scope of serd.
-rw-r--r--serd/serd.h4
-rw-r--r--src/node.c6
-rw-r--r--src/node.h6
-rw-r--r--src/reader.c7
-rw-r--r--src/reader.h20
5 files changed, 24 insertions, 19 deletions
diff --git a/serd/serd.h b/serd/serd.h
index 42547a31..30ab1fc7 100644
--- a/serd/serd.h
+++ b/serd/serd.h
@@ -230,7 +230,7 @@ typedef enum {
<tt>nodeID</tt></a>
*/
SERD_BLANK = 4
-} SerdType;
+} SerdNodeType;
/**
Flags indicating certain string properties relevant to serialisation.
@@ -768,7 +768,7 @@ serd_new_blob(const void* buf,
Return the type of a node (SERD_URI, SERD_BLANK, or SERD_LITERAL).
*/
SERD_API
-SerdType
+SerdNodeType
serd_node_get_type(const SerdNode* node);
/**
diff --git a/src/node.c b/src/node.c
index b0e8f991..65bc6fb6 100644
--- a/src/node.c
+++ b/src/node.c
@@ -119,7 +119,7 @@ serd_node_total_size(const SerdNode* node)
}
SerdNode*
-serd_node_malloc(size_t n_bytes, SerdNodeFlags flags, SerdType type)
+serd_node_malloc(size_t n_bytes, SerdNodeFlags flags, SerdNodeType type)
{
const size_t size = sizeof(SerdNode) + serd_node_pad_size(n_bytes);
SerdNode* node = (SerdNode*)calloc(1, size);
@@ -146,7 +146,7 @@ serd_node_set(SerdNode** dst, const SerdNode* src)
}
static SerdNode*
-serd_new_simple(SerdType type, const char* str)
+serd_new_simple(SerdNodeType type, const char* str)
{
if (!str) {
return NULL;
@@ -643,7 +643,7 @@ serd_new_blob(const void* buf,
return node;
}
-SerdType
+SerdNodeType
serd_node_get_type(const SerdNode* node)
{
return node ? node->type : SERD_NOTHING;
diff --git a/src/node.h b/src/node.h
index bfd9ebf5..53936ca3 100644
--- a/src/node.h
+++ b/src/node.h
@@ -24,7 +24,7 @@
struct SerdNodeImpl {
size_t n_bytes; /**< Size in bytes (not including null) */
SerdNodeFlags flags; /**< Node flags (e.g. string properties) */
- SerdType type; /**< Node type */
+ SerdNodeType type; /**< Node type */
};
static inline char*
@@ -39,7 +39,9 @@ serd_node_buffer_c(const SerdNode* node)
return (const char*)(node + 1);
}
-SerdNode* serd_node_malloc(size_t n_bytes, SerdNodeFlags flags, SerdType type);
+SerdNode*
+serd_node_malloc(size_t n_bytes, SerdNodeFlags flags, SerdNodeType type);
+
void serd_node_set(SerdNode** dst, const SerdNode* src);
size_t serd_node_total_size(const SerdNode* node);
void serd_node_zero_pad(SerdNode* node);
diff --git a/src/reader.c b/src/reader.c
index bc8edd52..ab6b3611 100644
--- a/src/reader.c
+++ b/src/reader.c
@@ -75,7 +75,7 @@ blank_id(SerdReader* reader)
SerdNode*
push_node_padded(SerdReader* reader, size_t maxlen,
- SerdType type, const char* str, size_t n_bytes)
+ SerdNodeType type, const char* str, size_t n_bytes)
{
// Push a null byte to ensure the previous node was null terminated
char* terminator = (char*)serd_stack_push(&reader->stack, 1);
@@ -109,7 +109,10 @@ push_node_padded(SerdReader* reader, size_t maxlen,
}
SerdNode*
-push_node(SerdReader* reader, SerdType type, const char* str, size_t n_bytes)
+push_node(SerdReader* reader,
+ SerdNodeType type,
+ const char* str,
+ size_t n_bytes)
{
return push_node_padded(reader, n_bytes, type, str, n_bytes);
}
diff --git a/src/reader.h b/src/reader.h
index 7794526b..8c0efe3a 100644
--- a/src/reader.h
+++ b/src/reader.h
@@ -69,16 +69,16 @@ struct SerdReaderImpl {
SerdStatus r_err(SerdReader* reader, SerdStatus st, const char* fmt, ...);
-SerdNode* push_node_padded(SerdReader* reader,
- size_t maxlen,
- SerdType type,
- const char* str,
- size_t n_bytes);
-
-SerdNode* push_node(SerdReader* reader,
- SerdType type,
- const char* str,
- size_t n_bytes);
+SerdNode* push_node_padded(SerdReader* reader,
+ size_t maxlen,
+ SerdNodeType type,
+ const char* str,
+ size_t n_bytes);
+
+SerdNode* push_node(SerdReader* reader,
+ SerdNodeType type,
+ const char* str,
+ size_t n_bytes);
size_t genid_size(SerdReader* reader);
SerdNode* blank_id(SerdReader* reader);