From c25fb778a07653c70550e58b22dd599627c0a9a9 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 29 Dec 2018 19:56:13 -0500 Subject: Rename SerdType to SerdNodeType The old name has become ambiguous with the expanded scope of serd. --- serd/serd.h | 4 ++-- src/node.c | 6 +++--- src/node.h | 6 ++++-- src/reader.c | 7 +++++-- src/reader.h | 20 ++++++++++---------- 5 files changed, 24 insertions(+), 19 deletions(-) diff --git a/serd/serd.h b/serd/serd.h index d87896ea..d715c795 100644 --- a/serd/serd.h +++ b/serd/serd.h @@ -230,7 +230,7 @@ typedef enum { nodeID */ SERD_BLANK = 4 -} SerdType; +} SerdNodeType; /** Flags indicating certain string properties relevant to serialisation. @@ -809,7 +809,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 af18d095..2482109b 100644 --- a/src/node.c +++ b/src/node.c @@ -118,7 +118,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); @@ -145,7 +145,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; @@ -639,7 +639,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); -- cgit v1.2.1