From 93323fe97380bad325cac617d06e4df14a27c2e9 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 25 Feb 2021 12:12:15 -0500 Subject: Split up serd_internal.h --- src/byte_sink.h | 2 +- src/macros.h | 9 +++++++++ src/n3.c | 2 +- src/namespaces.h | 10 ++++++++++ src/node.c | 2 +- src/reader.c | 2 +- src/serd_internal.h | 16 ---------------- src/system.c | 1 - src/system.h | 2 ++ src/writer.c | 2 +- 10 files changed, 26 insertions(+), 22 deletions(-) create mode 100644 src/macros.h create mode 100644 src/namespaces.h delete mode 100644 src/serd_internal.h diff --git a/src/byte_sink.h b/src/byte_sink.h index d033f227..ada5e8a9 100644 --- a/src/byte_sink.h +++ b/src/byte_sink.h @@ -4,7 +4,7 @@ #ifndef SERD_SRC_BYTE_SINK_H #define SERD_SRC_BYTE_SINK_H -#include "serd_internal.h" +#include "macros.h" #include "system.h" #include "serd/sink.h" diff --git a/src/macros.h b/src/macros.h new file mode 100644 index 00000000..518ac3e8 --- /dev/null +++ b/src/macros.h @@ -0,0 +1,9 @@ +// Copyright 2019-2020 David Robillard +// SPDX-License-Identifier: ISC + +#ifndef SERD_SRC_MACROS_H +#define SERD_SRC_MACROS_H + +#define MIN(x, y) ((x) < (y) ? (x) : (y)) + +#endif // SERD_SRC_MACROS_H diff --git a/src/n3.c b/src/n3.c index f583a9fa..f8ce2b71 100644 --- a/src/n3.c +++ b/src/n3.c @@ -1,9 +1,9 @@ // Copyright 2011-2023 David Robillard // SPDX-License-Identifier: ISC +#include "namespaces.h" #include "node.h" #include "reader.h" -#include "serd_internal.h" #include "stack.h" #include "string_utils.h" #include "try.h" diff --git a/src/namespaces.h b/src/namespaces.h new file mode 100644 index 00000000..53379168 --- /dev/null +++ b/src/namespaces.h @@ -0,0 +1,10 @@ +// Copyright 2011-2023 David Robillard +// SPDX-License-Identifier: ISC + +#ifndef SERD_SRC_NAMESPACES_H +#define SERD_SRC_NAMESPACES_H + +#define NS_XSD "http://www.w3.org/2001/XMLSchema#" +#define NS_RDF "http://www.w3.org/1999/02/22-rdf-syntax-ns#" + +#endif // SERD_SRC_NAMESPACES_H diff --git a/src/node.c b/src/node.c index a4b3dfbb..446c4014 100644 --- a/src/node.c +++ b/src/node.c @@ -3,7 +3,7 @@ #include "node.h" -#include "serd_internal.h" +#include "namespaces.h" #include "string_utils.h" #include "system.h" diff --git a/src/reader.c b/src/reader.c index 4702131e..15c45202 100644 --- a/src/reader.c +++ b/src/reader.c @@ -4,8 +4,8 @@ #include "reader.h" #include "byte_source.h" +#include "namespaces.h" #include "node.h" -#include "serd_internal.h" #include "stack.h" #include "statement.h" #include "system.h" diff --git a/src/serd_internal.h b/src/serd_internal.h deleted file mode 100644 index 49a1cd93..00000000 --- a/src/serd_internal.h +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2011-2023 David Robillard -// SPDX-License-Identifier: ISC - -#ifndef SERD_SRC_SERD_INTERNAL_H -#define SERD_SRC_SERD_INTERNAL_H - -#define NS_XSD "http://www.w3.org/2001/XMLSchema#" -#define NS_RDF "http://www.w3.org/1999/02/22-rdf-syntax-ns#" - -#define SERD_PAGE_SIZE 4096 - -#ifndef MIN -# define MIN(a, b) (((a) < (b)) ? (a) : (b)) -#endif - -#endif // SERD_SRC_SERD_INTERNAL_H diff --git a/src/system.c b/src/system.c index 567d3e1d..16a292f5 100644 --- a/src/system.c +++ b/src/system.c @@ -4,7 +4,6 @@ #include "system.h" #include "serd_config.h" -#include "serd_internal.h" #ifdef _WIN32 # include diff --git a/src/system.h b/src/system.h index 1bc19fb9..bfe2c2f0 100644 --- a/src/system.h +++ b/src/system.h @@ -9,6 +9,8 @@ #include #include +#define SERD_PAGE_SIZE 4096 + /// Write the message for a system error code (like errno) to a buffer int serd_system_strerror(int errnum, char* buf, size_t buflen); diff --git a/src/writer.c b/src/writer.c index 5b1bf412..0ba90c0b 100644 --- a/src/writer.c +++ b/src/writer.c @@ -3,8 +3,8 @@ #include "byte_sink.h" #include "env.h" +#include "namespaces.h" #include "node.h" -#include "serd_internal.h" #include "sink.h" #include "string_utils.h" #include "system.h" -- cgit v1.2.1