aboutsummaryrefslogtreecommitdiffstats
path: root/src/static_nodes.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-05-12 18:03:13 +0200
committerDavid Robillard <d@drobilla.net>2020-10-27 13:13:58 +0100
commit4f4408029cd8cefc1804d75a03f5c3f0ee7922fa (patch)
treef4e97788064e7659e06e31f68170ac9ce645f54a /src/static_nodes.h
parent8b20b3e3bfd186b7b0bbd082a979c7fb86a52479 (diff)
downloadserd-4f4408029cd8cefc1804d75a03f5c3f0ee7922fa.tar.gz
serd-4f4408029cd8cefc1804d75a03f5c3f0ee7922fa.tar.bz2
serd-4f4408029cd8cefc1804d75a03f5c3f0ee7922fa.zip
Set datatypes on integer, decimal, and base64 nodes
Diffstat (limited to 'src/static_nodes.h')
-rw-r--r--src/static_nodes.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/static_nodes.h b/src/static_nodes.h
new file mode 100644
index 00000000..62e38c91
--- /dev/null
+++ b/src/static_nodes.h
@@ -0,0 +1,36 @@
+/*
+ Copyright 2019-2020 David Robillard <http://drobilla.net>
+
+ 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_STATIC_NODES_H
+#define SERD_STATIC_NODES_H
+
+#include "node.h"
+#include "serd_internal.h"
+
+typedef struct StaticNode {
+ SerdNode node;
+ char buf[sizeof(NS_XSD "base64Binary")];
+} StaticNode;
+
+#define DEFINE_XSD_NODE(name) \
+ static const StaticNode serd_xsd_##name = { \
+ {sizeof(NS_XSD #name) - 1, 0, SERD_URI}, NS_XSD #name};
+
+DEFINE_XSD_NODE(base64Binary)
+DEFINE_XSD_NODE(decimal)
+DEFINE_XSD_NODE(integer)
+
+#endif // SERD_STATIC_NODES_H