From cd3d9986f40fd4e605ac2e8168512065439173e2 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 1 Oct 2022 20:12:13 -0400 Subject: Split up public API header --- src/attributes.h | 25 ------------------------- src/base64.c | 2 +- src/base64.h | 2 +- src/byte_sink.h | 2 +- src/byte_source.c | 2 -- src/byte_source.h | 4 +++- src/env.c | 2 +- src/n3.c | 6 +++++- src/node.c | 5 ++++- src/node.h | 3 ++- src/reader.c | 4 ++++ src/reader.h | 10 ++++++++-- src/serd_internal.h | 2 +- src/serdi.c | 11 ++++++++++- src/string.c | 5 ++++- src/string_utils.h | 2 +- src/system.h | 2 +- src/uri.c | 8 ++++++-- src/uri_utils.h | 2 +- src/writer.c | 14 ++++++++++++-- 20 files changed, 66 insertions(+), 47 deletions(-) delete mode 100644 src/attributes.h (limited to 'src') diff --git a/src/attributes.h b/src/attributes.h deleted file mode 100644 index 11c699f3..00000000 --- a/src/attributes.h +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2019-2023 David Robillard -// SPDX-License-Identifier: ISC - -#ifndef SERD_SRC_ATTRIBUTES_H -#define SERD_SRC_ATTRIBUTES_H - -#if defined(__GNUC__) -# define SERD_LOG_FUNC(fmt, arg1) __attribute__((format(printf, fmt, arg1))) -#else -# define SERD_LOG_FUNC(fmt, arg1) -#endif - -#ifdef __GNUC__ -# define SERD_MALLOC_FUNC __attribute__((malloc)) -#else -# define SERD_MALLOC_FUNC -#endif - -#ifdef __GNUC__ -# define SERD_NODISCARD __attribute__((warn_unused_result)) -#else -# define SERD_NODISCARD -#endif - -#endif // SERD_SRC_ATTRIBUTES_H diff --git a/src/base64.c b/src/base64.c index 13f08ab0..14f45b71 100644 --- a/src/base64.c +++ b/src/base64.c @@ -6,7 +6,7 @@ #include "serd_internal.h" #include "string_utils.h" -#include "serd/serd.h" +#include "serd/string.h" #include #include diff --git a/src/base64.h b/src/base64.h index 21a6878c..d3e2b6e1 100644 --- a/src/base64.h +++ b/src/base64.h @@ -4,7 +4,7 @@ #ifndef SERD_SRC_BASE64_H #define SERD_SRC_BASE64_H -#include "serd/serd.h" +#include "serd/attributes.h" #include #include diff --git a/src/byte_sink.h b/src/byte_sink.h index 39248c8c..0b4a83b1 100644 --- a/src/byte_sink.h +++ b/src/byte_sink.h @@ -7,7 +7,7 @@ #include "serd_internal.h" #include "system.h" -#include "serd/serd.h" +#include "serd/sink.h" #include #include diff --git a/src/byte_source.c b/src/byte_source.c index 72a2366e..b56e0102 100644 --- a/src/byte_source.c +++ b/src/byte_source.c @@ -5,8 +5,6 @@ #include "system.h" -#include "serd/serd.h" - #include #include #include diff --git a/src/byte_source.h b/src/byte_source.h index 218e47fa..b6cba5d4 100644 --- a/src/byte_source.h +++ b/src/byte_source.h @@ -4,7 +4,9 @@ #ifndef SERD_SRC_BYTE_SOURCE_H #define SERD_SRC_BYTE_SOURCE_H -#include "serd/serd.h" +#include "serd/attributes.h" +#include "serd/status.h" +#include "serd/stream.h" #include #include diff --git a/src/env.c b/src/env.c index 0227d54c..de7ff889 100644 --- a/src/env.c +++ b/src/env.c @@ -1,7 +1,7 @@ // Copyright 2011-2023 David Robillard // SPDX-License-Identifier: ISC -#include "serd/serd.h" +#include "serd/env.h" #include #include diff --git a/src/n3.c b/src/n3.c index 294731c7..f808e74a 100644 --- a/src/n3.c +++ b/src/n3.c @@ -8,7 +8,11 @@ #include "try.h" #include "uri_utils.h" -#include "serd/serd.h" +#include "serd/node.h" +#include "serd/reader.h" +#include "serd/statement.h" +#include "serd/status.h" +#include "serd/syntax.h" #include #include diff --git a/src/node.c b/src/node.c index 015901f5..5e5b3852 100644 --- a/src/node.c +++ b/src/node.c @@ -6,7 +6,10 @@ #include "base64.h" #include "string_utils.h" -#include "serd/serd.h" +#include "serd/buffer.h" +#include "serd/node.h" +#include "serd/string.h" +#include "serd/uri.h" #include #include diff --git a/src/node.h b/src/node.h index 5d0e9c80..58673284 100644 --- a/src/node.h +++ b/src/node.h @@ -4,7 +4,8 @@ #ifndef SERD_SRC_NODE_H #define SERD_SRC_NODE_H -#include "serd/serd.h" +#include "serd/attributes.h" +#include "serd/node.h" #include diff --git a/src/reader.c b/src/reader.c index f34de787..00f5e73f 100644 --- a/src/reader.c +++ b/src/reader.c @@ -9,6 +9,10 @@ #include "serd_internal.h" +#include "serd/memory.h" +#include "serd/stream.h" +#include "serd/uri.h" + #include #include #include diff --git a/src/reader.h b/src/reader.h index c0bf3765..e24bb31a 100644 --- a/src/reader.h +++ b/src/reader.h @@ -4,11 +4,17 @@ #ifndef SERD_SRC_READER_H #define SERD_SRC_READER_H -#include "attributes.h" #include "byte_source.h" #include "stack.h" -#include "serd/serd.h" +#include "serd/attributes.h" +#include "serd/error.h" +#include "serd/node.h" +#include "serd/reader.h" +#include "serd/sink.h" +#include "serd/statement.h" +#include "serd/status.h" +#include "serd/syntax.h" #include #include diff --git a/src/serd_internal.h b/src/serd_internal.h index 7fcae691..b3221ae7 100644 --- a/src/serd_internal.h +++ b/src/serd_internal.h @@ -4,7 +4,7 @@ #ifndef SERD_SRC_SERD_INTERNAL_H #define SERD_SRC_SERD_INTERNAL_H -#include "serd/serd.h" +#include "serd/error.h" #include diff --git a/src/serdi.c b/src/serdi.c index 421e5df8..27e6d782 100644 --- a/src/serdi.c +++ b/src/serdi.c @@ -4,7 +4,16 @@ #include "serd_config.h" #include "string_utils.h" -#include "serd/serd.h" +#include "serd/attributes.h" +#include "serd/env.h" +#include "serd/error.h" +#include "serd/node.h" +#include "serd/reader.h" +#include "serd/sink.h" +#include "serd/status.h" +#include "serd/syntax.h" +#include "serd/uri.h" +#include "serd/writer.h" #ifdef _WIN32 # ifdef _MSC_VER diff --git a/src/string.c b/src/string.c index b0ffe51a..4d8f4f09 100644 --- a/src/string.c +++ b/src/string.c @@ -3,7 +3,10 @@ #include "string_utils.h" -#include "serd/serd.h" +#include "serd/memory.h" +#include "serd/node.h" +#include "serd/status.h" +#include "serd/string.h" #include #include diff --git a/src/string_utils.h b/src/string_utils.h index 723df710..86795dcb 100644 --- a/src/string_utils.h +++ b/src/string_utils.h @@ -4,7 +4,7 @@ #ifndef SERD_SRC_STRING_UTILS_H #define SERD_SRC_STRING_UTILS_H -#include "serd/serd.h" +#include "serd/node.h" #include #include diff --git a/src/system.h b/src/system.h index 1a749bae..081b60c4 100644 --- a/src/system.h +++ b/src/system.h @@ -4,7 +4,7 @@ #ifndef SERD_SRC_SYSTEM_H #define SERD_SRC_SYSTEM_H -#include "attributes.h" +#include "serd/attributes.h" #include diff --git a/src/uri.c b/src/uri.c index def2b326..0d403ce9 100644 --- a/src/uri.c +++ b/src/uri.c @@ -4,7 +4,11 @@ #include "string_utils.h" #include "uri_utils.h" -#include "serd/serd.h" +#include "serd/buffer.h" +#include "serd/status.h" +#include "serd/stream.h" +#include "serd/string_view.h" +#include "serd/uri.h" #include #include @@ -268,7 +272,7 @@ serd_uri_resolve(const SerdURIView* const r, return; } - t->path_base.buf = NULL; + t->path_base.buf = ""; t->path_base.len = 0; if (r->scheme.len) { *t = *r; diff --git a/src/uri_utils.h b/src/uri_utils.h index b275cf5f..3974b5ce 100644 --- a/src/uri_utils.h +++ b/src/uri_utils.h @@ -4,7 +4,7 @@ #ifndef SERD_SRC_URI_UTILS_H #define SERD_SRC_URI_UTILS_H -#include "serd/serd.h" +#include "serd/attributes.h" #include "string_utils.h" diff --git a/src/writer.c b/src/writer.c index eea85ddf..612c2620 100644 --- a/src/writer.c +++ b/src/writer.c @@ -1,7 +1,6 @@ // Copyright 2011-2023 David Robillard // SPDX-License-Identifier: ISC -#include "attributes.h" #include "byte_sink.h" #include "serd_internal.h" #include "stack.h" @@ -9,7 +8,18 @@ #include "try.h" #include "uri_utils.h" -#include "serd/serd.h" +#include "serd/attributes.h" +#include "serd/buffer.h" +#include "serd/env.h" +#include "serd/error.h" +#include "serd/node.h" +#include "serd/statement.h" +#include "serd/status.h" +#include "serd/stream.h" +#include "serd/string_view.h" +#include "serd/syntax.h" +#include "serd/uri.h" +#include "serd/writer.h" #include #include -- cgit v1.2.1