aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-12-29 19:56:13 -0500
committerDavid Robillard <d@drobilla.net>2020-10-27 13:13:58 +0100
commit6ed3c180ef0d90567bffc2c1120701a6a20e2f03 (patch)
treef5ec1e57de2d5b52c5523713bc2d821aa3dc9361
parentea89a5ce06d8c1ccdb6970ae959d91821b115b3f (diff)
downloadserd-6ed3c180ef0d90567bffc2c1120701a6a20e2f03.tar.gz
serd-6ed3c180ef0d90567bffc2c1120701a6a20e2f03.tar.bz2
serd-6ed3c180ef0d90567bffc2c1120701a6a20e2f03.zip
Rename SerdType to SerdNodeType
The old name has become ambiguous with the expanded scope of serd.
-rw-r--r--serd/serd.h6
-rw-r--r--src/node.c6
-rw-r--r--src/node.h6
-rw-r--r--src/reader.c7
-rw-r--r--src/reader.h22
5 files changed, 27 insertions, 20 deletions
diff --git a/serd/serd.h b/serd/serd.h
index 4a562dbc..4894a99c 100644
--- a/serd/serd.h
+++ b/serd/serd.h
@@ -226,7 +226,7 @@ typedef enum {
<tt>nodeID</tt></a>
*/
SERD_BLANK = 4
-} SerdType;
+} SerdNodeType;
/**
Flags indicating certain string properties relevant to serialisation.
@@ -624,7 +624,7 @@ serd_uri_serialise_relative(const SerdURI* uri,
*/
SERD_API
SerdNode*
-serd_new_simple_node(SerdType type, const char* str, size_t len);
+serd_new_simple_node(SerdNodeType type, const char* str, size_t len);
/**
Create a new plain literal string node from `str`.
@@ -830,7 +830,7 @@ serd_node_free(SerdNode* node);
Return the type of a node (SERD_URI, SERD_BLANK, or SERD_LITERAL).
*/
SERD_API
-SerdType
+SerdNodeType
serd_node_type(const SerdNode* node);
/**
diff --git a/src/node.c b/src/node.c
index f4f76be4..6853feae 100644
--- a/src/node.c
+++ b/src/node.c
@@ -100,7 +100,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);
@@ -127,7 +127,7 @@ serd_node_set(SerdNode** dst, const SerdNode* src)
}
SerdNode*
-serd_new_simple_node(SerdType type, const char* str, const size_t len)
+serd_new_simple_node(SerdNodeType type, const char* str, const size_t len)
{
if (!str) {
return NULL;
@@ -702,7 +702,7 @@ serd_new_blob(const void* buf,
return node;
}
-SerdType
+SerdNodeType
serd_node_type(const SerdNode* node)
{
return node->type;
diff --git a/src/node.h b/src/node.h
index 9a205a6e..3f8ec628 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 714bde61..c855b7aa 100644
--- a/src/reader.c
+++ b/src/reader.c
@@ -70,7 +70,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);
@@ -103,7 +103,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 7d911cb4..dcee87d7 100644
--- a/src/reader.h
+++ b/src/reader.h
@@ -76,16 +76,18 @@ SERD_LOG_FUNC(3, 4)
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);