diff options
author | David Robillard <d@drobilla.net> | 2022-12-19 20:26:13 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2023-12-02 18:49:07 -0500 |
commit | 3d79b6ee36b250644e6cf70eee8e3076d94cbb7f (patch) | |
tree | 0f734bfcfd278d6eef5ca0e82c008b7f2a6f7bba /include/serd/statement.h | |
parent | 7fb4c5264b91d5a5ce9f13a9fb4308088b31fcd4 (diff) | |
download | serd-3d79b6ee36b250644e6cf70eee8e3076d94cbb7f.tar.gz serd-3d79b6ee36b250644e6cf70eee8e3076d94cbb7f.tar.bz2 serd-3d79b6ee36b250644e6cf70eee8e3076d94cbb7f.zip |
Use Zix attributes directly
Diffstat (limited to 'include/serd/statement.h')
-rw-r--r-- | include/serd/statement.h | 61 |
1 files changed, 32 insertions, 29 deletions
diff --git a/include/serd/statement.h b/include/serd/statement.h index a1932796..2e8eddc2 100644 --- a/include/serd/statement.h +++ b/include/serd/statement.h @@ -7,6 +7,8 @@ #include "serd/attributes.h" #include "serd/caret.h" #include "serd/node.h" +#include "zix/allocator.h" +#include "zix/attributes.h" #include <stdbool.h> #include <stdint.h> @@ -60,45 +62,45 @@ typedef struct SerdStatementImpl SerdStatement; @param caret Optional caret at the origin of this statement @return A new statement that must be freed with serd_statement_free() */ -SERD_API SerdStatement* SERD_ALLOCATED -serd_statement_new(const SerdNode* SERD_NONNULL s, - const SerdNode* SERD_NONNULL p, - const SerdNode* SERD_NONNULL o, - const SerdNode* SERD_NULLABLE g, - const SerdCaret* SERD_NULLABLE caret); +SERD_API SerdStatement* ZIX_ALLOCATED +serd_statement_new(const SerdNode* ZIX_NONNULL s, + const SerdNode* ZIX_NONNULL p, + const SerdNode* ZIX_NONNULL o, + const SerdNode* ZIX_NULLABLE g, + const SerdCaret* ZIX_NULLABLE caret); /// Return a copy of `statement` -SERD_API SerdStatement* SERD_ALLOCATED -serd_statement_copy(const SerdStatement* SERD_NULLABLE statement); +SERD_API SerdStatement* ZIX_ALLOCATED +serd_statement_copy(const SerdStatement* ZIX_NULLABLE statement); /// Free `statement` SERD_API void -serd_statement_free(SerdStatement* SERD_NULLABLE statement); +serd_statement_free(SerdStatement* ZIX_NULLABLE statement); /// Return the given node of the statement -SERD_PURE_API const SerdNode* SERD_NULLABLE -serd_statement_node(const SerdStatement* SERD_NONNULL statement, - SerdField field); +SERD_PURE_API const SerdNode* ZIX_NULLABLE +serd_statement_node(const SerdStatement* ZIX_NONNULL statement, + SerdField field); /// Return the subject of the statement -SERD_PURE_API const SerdNode* SERD_NONNULL -serd_statement_subject(const SerdStatement* SERD_NONNULL statement); +SERD_PURE_API const SerdNode* ZIX_NONNULL +serd_statement_subject(const SerdStatement* ZIX_NONNULL statement); /// Return the predicate of the statement -SERD_PURE_API const SerdNode* SERD_NONNULL -serd_statement_predicate(const SerdStatement* SERD_NONNULL statement); +SERD_PURE_API const SerdNode* ZIX_NONNULL +serd_statement_predicate(const SerdStatement* ZIX_NONNULL statement); /// Return the object of the statement -SERD_PURE_API const SerdNode* SERD_NONNULL -serd_statement_object(const SerdStatement* SERD_NONNULL statement); +SERD_PURE_API const SerdNode* ZIX_NONNULL +serd_statement_object(const SerdStatement* ZIX_NONNULL statement); /// Return the graph of the statement -SERD_PURE_API const SerdNode* SERD_NULLABLE -serd_statement_graph(const SerdStatement* SERD_NONNULL statement); +SERD_PURE_API const SerdNode* ZIX_NULLABLE +serd_statement_graph(const SerdStatement* ZIX_NONNULL statement); /// Return the source location where the statement originated, or NULL -SERD_PURE_API const SerdCaret* SERD_NULLABLE -serd_statement_caret(const SerdStatement* SERD_NONNULL statement); +SERD_PURE_API const SerdCaret* ZIX_NULLABLE +serd_statement_caret(const SerdStatement* ZIX_NONNULL statement); /** Return true iff `a` is equal to `b`, ignoring statement caret metadata. @@ -107,8 +109,8 @@ serd_statement_caret(const SerdStatement* SERD_NONNULL statement); matching. */ SERD_PURE_API bool -serd_statement_equals(const SerdStatement* SERD_NULLABLE a, - const SerdStatement* SERD_NULLABLE b); +serd_statement_equals(const SerdStatement* ZIX_NULLABLE a, + const SerdStatement* ZIX_NULLABLE b); /** Return true iff the statement matches the given pattern. @@ -117,11 +119,12 @@ serd_statement_equals(const SerdStatement* SERD_NULLABLE a, statement matches if every node matches. */ SERD_PURE_API bool -serd_statement_matches(const SerdStatement* SERD_NONNULL statement, - const SerdNode* SERD_NULLABLE subject, - const SerdNode* SERD_NULLABLE predicate, - const SerdNode* SERD_NULLABLE object, - const SerdNode* SERD_NULLABLE graph); +serd_statement_matches(const SerdStatement* ZIX_NONNULL statement, + const SerdNode* ZIX_NULLABLE subject, + const SerdNode* ZIX_NULLABLE predicate, + const SerdNode* ZIX_NULLABLE object, + const SerdNode* ZIX_NULLABLE graph); + /** @} */ |