diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/byte_source.h | 4 | ||||
-rw-r--r-- | src/env.c | 3 | ||||
-rw-r--r-- | src/env.h | 4 | ||||
-rw-r--r-- | src/node.c | 14 | ||||
-rw-r--r-- | src/node.h | 36 | ||||
-rw-r--r-- | src/reader.h | 5 | ||||
-rw-r--r-- | src/statement.h | 16 | ||||
-rw-r--r-- | src/system.h | 8 | ||||
-rw-r--r-- | src/uri_utils.h | 6 |
9 files changed, 49 insertions, 47 deletions
diff --git a/src/byte_source.h b/src/byte_source.h index 099fc515..d40012ea 100644 --- a/src/byte_source.h +++ b/src/byte_source.h @@ -6,11 +6,11 @@ #include "caret.h" // IWYU pragma: keep -#include "serd/attributes.h" #include "serd/caret.h" #include "serd/node.h" #include "serd/status.h" #include "serd/stream.h" +#include "zix/attributes.h" #include <assert.h> #include <stdbool.h> @@ -60,7 +60,7 @@ serd_byte_source_prepare(SerdByteSource* source); SerdStatus serd_byte_source_page(SerdByteSource* source); -SERD_PURE_FUNC static inline uint8_t +ZIX_PURE_FUNC static inline uint8_t serd_byte_source_peek(SerdByteSource* source) { assert(source->prepared); @@ -7,6 +7,7 @@ #include "node.h" #include "serd/node.h" +#include "zix/attributes.h" #include <assert.h> #include <stdbool.h> @@ -138,7 +139,7 @@ serd_env_set_base_uri(SerdEnv* const env, const SerdStringView uri) return SERD_SUCCESS; } -SERD_PURE_FUNC static SerdPrefix* +ZIX_PURE_FUNC static SerdPrefix* serd_env_find(const SerdEnv* const env, const char* const name, const size_t name_len) @@ -4,12 +4,12 @@ #ifndef SERD_SRC_ENV_H #define SERD_SRC_ENV_H -#include "serd/attributes.h" #include "serd/env.h" #include "serd/node.h" #include "serd/status.h" #include "serd/string_view.h" #include "serd/uri.h" +#include "zix/attributes.h" #include <stdbool.h> @@ -32,7 +32,7 @@ serd_env_expand_in_place(const SerdEnv* env, SerdStringView* uri_prefix, SerdStringView* uri_suffix); -SERD_PURE_FUNC SerdURIView +ZIX_PURE_FUNC SerdURIView serd_env_base_uri_view(const SerdEnv* env); #endif // SERD_SRC_ENV_H @@ -8,7 +8,6 @@ #include "system.h" #include "exess/exess.h" -#include "serd/attributes.h" #include "serd/buffer.h" #include "serd/node.h" #include "serd/status.h" @@ -16,6 +15,7 @@ #include "serd/string_view.h" #include "serd/uri.h" #include "serd/write_result.h" +#include "zix/attributes.h" #include <assert.h> #include <math.h> @@ -26,8 +26,8 @@ #include <string.h> typedef struct { - const void* SERD_NULLABLE buf; - size_t len; + const void* ZIX_NULLABLE buf; + size_t len; } SerdConstBuffer; #define NS_XSD "http://www.w3.org/2001/XMLSchema#" @@ -63,7 +63,7 @@ string_sink(const void* const buf, return nmemb; } -SERD_PURE_FUNC static size_t +ZIX_PURE_FUNC static size_t serd_node_pad_length(const size_t n_bytes) { const size_t pad = sizeof(SerdNode) - (n_bytes + 2) % sizeof(SerdNode); @@ -84,7 +84,7 @@ serd_node_meta(SerdNode* const node) return node + 1 + (serd_node_pad_length(node->length) / sizeof(SerdNode)); } -SERD_PURE_FUNC static const SerdNode* +ZIX_PURE_FUNC static const SerdNode* serd_node_maybe_get_meta_c(const SerdNode* const node) { return (node->flags & meta_mask) ? serd_node_meta_c(node) : NULL; @@ -106,7 +106,7 @@ serd_node_check_padding(const SerdNode* node) #endif } -static SERD_PURE_FUNC size_t +static ZIX_PURE_FUNC size_t serd_node_total_size(const SerdNode* const node) { return node ? (sizeof(SerdNode) + serd_node_pad_length(node->length) + @@ -790,7 +790,7 @@ serd_node_string_view(const SerdNode* const node) return r; } -SERD_PURE_FUNC SerdURIView +ZIX_PURE_FUNC SerdURIView serd_node_uri_view(const SerdNode* const node) { assert(node); @@ -5,10 +5,10 @@ #define SERD_SRC_NODE_H #include "exess/exess.h" -#include "serd/attributes.h" #include "serd/node.h" #include "serd/string_view.h" #include "serd/uri.h" +#include "zix/attributes.h" #include <stdbool.h> #include <stddef.h> @@ -22,49 +22,49 @@ struct SerdNodeImpl { static const size_t serd_node_align = 2 * sizeof(uint64_t); -static inline char* SERD_NONNULL -serd_node_buffer(SerdNode* SERD_NONNULL node) +static inline char* ZIX_NONNULL +serd_node_buffer(SerdNode* ZIX_NONNULL node) { return (char*)(node + 1); } -static inline const char* SERD_NONNULL -serd_node_buffer_c(const SerdNode* SERD_NONNULL node) +static inline const char* ZIX_NONNULL +serd_node_buffer_c(const SerdNode* ZIX_NONNULL node) { return (const char*)(node + 1); } -static inline const char* SERD_NONNULL -serd_node_string_i(const SerdNode* const SERD_NONNULL node) +static inline const char* ZIX_NONNULL +serd_node_string_i(const SerdNode* const ZIX_NONNULL node) { return (const char*)(node + 1); } static inline bool -serd_node_pattern_match(const SerdNode* SERD_NULLABLE a, - const SerdNode* SERD_NULLABLE b) +serd_node_pattern_match(const SerdNode* ZIX_NULLABLE a, + const SerdNode* ZIX_NULLABLE b) { return !a || !b || serd_node_equals(a, b); } -SerdNode* SERD_ALLOCATED +SerdNode* ZIX_ALLOCATED serd_node_malloc(size_t length, SerdNodeFlags flags, SerdNodeType type); void -serd_node_set(SerdNode* SERD_NONNULL* SERD_NONNULL dst, - const SerdNode* SERD_NONNULL src); +serd_node_set(SerdNode* ZIX_NONNULL* ZIX_NONNULL dst, + const SerdNode* ZIX_NONNULL src); void -serd_node_zero_pad(SerdNode* SERD_NONNULL node); +serd_node_zero_pad(SerdNode* ZIX_NONNULL node); /// Create a new URI from a string, resolved against a base URI -SerdNode* SERD_ALLOCATED +SerdNode* ZIX_ALLOCATED serd_new_resolved_uri(SerdStringView string, SerdURIView base_uri); ExessResult -serd_node_get_value_as(const SerdNode* SERD_NONNULL node, - ExessDatatype value_type, - size_t value_size, - void* SERD_NONNULL value); +serd_node_get_value_as(const SerdNode* ZIX_NONNULL node, + ExessDatatype value_type, + size_t value_size, + void* ZIX_NONNULL value); #endif // SERD_SRC_NODE_H diff --git a/src/reader.h b/src/reader.h index 1c308824..9b9a217e 100644 --- a/src/reader.h +++ b/src/reader.h @@ -18,6 +18,7 @@ #include "serd/status.h" #include "serd/syntax.h" #include "serd/world.h" +#include "zix/attributes.h" #include <assert.h> #include <stdbool.h> @@ -68,10 +69,10 @@ push_node(SerdReader* reader, const char* str, size_t length); -SERD_PURE_FUNC size_t +ZIX_PURE_FUNC size_t genid_length(const SerdReader* reader); -SERD_PURE_FUNC bool +ZIX_PURE_FUNC bool tolerate_status(const SerdReader* reader, SerdStatus status); SerdNode* diff --git a/src/statement.h b/src/statement.h index d4a64da5..9b9b553e 100644 --- a/src/statement.h +++ b/src/statement.h @@ -4,21 +4,21 @@ #ifndef SERD_SRC_STATEMENT_H #define SERD_SRC_STATEMENT_H -#include "serd/attributes.h" #include "serd/caret.h" #include "serd/node.h" +#include "zix/attributes.h" #include <stdbool.h> struct SerdStatementImpl { - const SerdNode* SERD_NULLABLE nodes[4]; - SerdCaret* SERD_NULLABLE caret; + const SerdNode* ZIX_NULLABLE nodes[4]; + SerdCaret* ZIX_NULLABLE caret; }; -SERD_PURE_FUNC bool -serd_statement_is_valid(const SerdNode* SERD_NULLABLE subject, - const SerdNode* SERD_NULLABLE predicate, - const SerdNode* SERD_NULLABLE object, - const SerdNode* SERD_NULLABLE graph); +ZIX_PURE_FUNC bool +serd_statement_is_valid(const SerdNode* ZIX_NULLABLE subject, + const SerdNode* ZIX_NULLABLE predicate, + const SerdNode* ZIX_NULLABLE object, + const SerdNode* ZIX_NULLABLE graph); #endif // SERD_SRC_STATEMENT_H diff --git a/src/system.h b/src/system.h index bfe2c2f0..ba5301fd 100644 --- a/src/system.h +++ b/src/system.h @@ -4,7 +4,7 @@ #ifndef SERD_SRC_SYSTEM_H #define SERD_SRC_SYSTEM_H -#include "serd/attributes.h" +#include "zix/attributes.h" #include <stdint.h> #include <stdio.h> @@ -16,15 +16,15 @@ int serd_system_strerror(int errnum, char* buf, size_t buflen); /// Allocate a buffer aligned to `alignment` bytes -SERD_MALLOC_FUNC void* +ZIX_MALLOC_FUNC void* serd_malloc_aligned(size_t alignment, size_t size); /// Allocate a zeroed buffer aligned to `alignment` bytes -SERD_MALLOC_FUNC void* +ZIX_MALLOC_FUNC void* serd_calloc_aligned(size_t alignment, size_t size); /// Allocate an aligned buffer for I/O -SERD_MALLOC_FUNC void* +ZIX_MALLOC_FUNC void* serd_allocate_buffer(size_t size); /// Free a buffer allocated with an aligned allocation function diff --git a/src/uri_utils.h b/src/uri_utils.h index 36db5fb5..004129d2 100644 --- a/src/uri_utils.h +++ b/src/uri_utils.h @@ -46,7 +46,7 @@ uri_path_at(const SerdURIView* uri, size_t i) slash is the last in the root, then the URI is a child of the root, otherwise it may merely share some leading path components). */ -static inline SERD_PURE_FUNC SlashIndexes +static inline ZIX_PURE_FUNC SlashIndexes uri_rooted_index(const SerdURIView* uri, const SerdURIView* root) { SlashIndexes indexes = {SIZE_MAX, SIZE_MAX}; @@ -84,7 +84,7 @@ uri_rooted_index(const SerdURIView* uri, const SerdURIView* root) } /** Return true iff `uri` shares path components with `root` */ -static inline SERD_PURE_FUNC bool +static inline ZIX_PURE_FUNC bool uri_is_related(const SerdURIView* uri, const SerdURIView* root) { return root && root->scheme.length && @@ -93,7 +93,7 @@ uri_is_related(const SerdURIView* uri, const SerdURIView* root) } /** Return true iff `uri` is within the base of `root` */ -static inline SERD_PURE_FUNC bool +static inline ZIX_PURE_FUNC bool uri_is_under(const SerdURIView* uri, const SerdURIView* root) { const SlashIndexes indexes = uri_rooted_index(uri, root); |