From 6f2d3942dff7e176f4771ea6134ffcc88e33ef42 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 19 Oct 2019 03:29:26 +0200 Subject: Move MIN macro to int_math.h --- src/base64.c | 2 +- src/byte_sink.c | 2 +- src/int_math.h | 2 ++ src/n3.c | 2 +- src/namespaces.h | 36 ++++++++++++++++++++++++++++++++++++ src/node.c | 2 +- src/reader.c | 2 +- src/serd_internal.h | 42 ------------------------------------------ src/static_nodes.h | 2 +- src/system.c | 1 - src/system.h | 2 ++ src/world.c | 2 +- src/writer.c | 2 +- 13 files changed, 48 insertions(+), 51 deletions(-) create mode 100644 src/namespaces.h delete mode 100644 src/serd_internal.h (limited to 'src') diff --git a/src/base64.c b/src/base64.c index bcf6b361..56c3c0a1 100644 --- a/src/base64.c +++ b/src/base64.c @@ -14,7 +14,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include "serd_internal.h" +#include "int_math.h" #include "string_utils.h" #include "serd/serd.h" diff --git a/src/byte_sink.c b/src/byte_sink.c index 965d9666..a4eb8098 100644 --- a/src/byte_sink.c +++ b/src/byte_sink.c @@ -14,7 +14,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include "serd_internal.h" +#include "int_math.h" #include "system.h" #include "serd/serd.h" diff --git a/src/int_math.h b/src/int_math.h index 34ceba64..b2e66856 100644 --- a/src/int_math.h +++ b/src/int_math.h @@ -19,6 +19,8 @@ #include +#define MIN(x, y) ((x) < (y) ? (x) : (y)) + static const uint64_t POW10[] = {1ull, 10ull, 100ull, diff --git a/src/n3.c b/src/n3.c index 8b3ab9d7..129a7c44 100644 --- a/src/n3.c +++ b/src/n3.c @@ -15,9 +15,9 @@ */ #include "byte_source.h" +#include "namespaces.h" #include "node.h" #include "reader.h" -#include "serd_internal.h" #include "stack.h" #include "string_utils.h" #include "uri_utils.h" diff --git a/src/namespaces.h b/src/namespaces.h new file mode 100644 index 00000000..b5228a4d --- /dev/null +++ b/src/namespaces.h @@ -0,0 +1,36 @@ +/* + Copyright 2011-2020 David Robillard + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ + +#ifndef SERD_NAMESPACES_H +#define SERD_NAMESPACES_H + +#include "world.h" + +#if defined(HAVE_POSIX_MEMALIGN) +# include +#endif + +#include +#include +#include +#include +#include +#include + +#define NS_XSD "http://www.w3.org/2001/XMLSchema#" +#define NS_RDF "http://www.w3.org/1999/02/22-rdf-syntax-ns#" + +#endif // SERD_NAMESPACES_H diff --git a/src/node.c b/src/node.c index a2b0c1c5..633f4567 100644 --- a/src/node.c +++ b/src/node.c @@ -16,7 +16,7 @@ #include "node.h" -#include "serd_internal.h" +#include "namespaces.h" #include "static_nodes.h" #include "string_utils.h" #include "system.h" diff --git a/src/reader.c b/src/reader.c index 86960857..668cd38d 100644 --- a/src/reader.c +++ b/src/reader.c @@ -17,7 +17,7 @@ #include "reader.h" #include "system.h" -#include "serd_internal.h" +#include "namespaces.h" #include "stack.h" #include "statement.h" #include "world.h" diff --git a/src/serd_internal.h b/src/serd_internal.h deleted file mode 100644 index 94e780bb..00000000 --- a/src/serd_internal.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - Copyright 2011-2020 David Robillard - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ - -#ifndef SERD_INTERNAL_H -#define SERD_INTERNAL_H - -#include "world.h" - -#if defined(HAVE_POSIX_MEMALIGN) -# include -#endif - -#include -#include -#include -#include -#include -#include - -#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_INTERNAL_H diff --git a/src/static_nodes.h b/src/static_nodes.h index 1399f580..f4794d72 100644 --- a/src/static_nodes.h +++ b/src/static_nodes.h @@ -17,8 +17,8 @@ #ifndef SERD_STATIC_NODES_H #define SERD_STATIC_NODES_H +#include "namespaces.h" #include "node.h" -#include "serd_internal.h" typedef struct StaticNode { SerdNode node; diff --git a/src/system.c b/src/system.c index 5141bf40..acc593ed 100644 --- a/src/system.c +++ b/src/system.c @@ -19,7 +19,6 @@ #include "system.h" #include "serd_config.h" -#include "serd_internal.h" #include #include diff --git a/src/system.h b/src/system.h index 903fdb3d..1d791bc7 100644 --- a/src/system.h +++ b/src/system.h @@ -20,6 +20,8 @@ #include #include +#define SERD_PAGE_SIZE 4096 + /** fread-like wrapper for getc (which is faster). */ static inline size_t serd_file_read_byte(void* buf, size_t size, size_t nmemb, void* stream) diff --git a/src/world.c b/src/world.c index 45f31ea6..5375e8b5 100644 --- a/src/world.c +++ b/src/world.c @@ -18,9 +18,9 @@ #include "world.h" +#include "namespaces.h" #include "node.h" #include "serd_config.h" -#include "serd_internal.h" #if defined(HAVE_POSIX_FADVISE) # include diff --git a/src/writer.c b/src/writer.c index 4f41b303..2686cc8a 100644 --- a/src/writer.c +++ b/src/writer.c @@ -16,10 +16,10 @@ #include "env.h" #include "node.h" -#include "serd_internal.h" #include "sink.h" #include "stack.h" #include "string_utils.h" +#include "system.h" #include "uri_utils.h" #include "world.h" -- cgit v1.2.1