From 7a171498eca31ddedb0de1f372c982eca00d3d50 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 12 May 2018 18:03:13 +0200 Subject: Set datatypes on integer, decimal, and base64 nodes --- src/static_nodes.h | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 src/static_nodes.h (limited to 'src/static_nodes.h') diff --git a/src/static_nodes.h b/src/static_nodes.h new file mode 100644 index 00000000..1b1fc062 --- /dev/null +++ b/src/static_nodes.h @@ -0,0 +1,38 @@ +/* + Copyright 2019-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_STATIC_NODES_H +#define SERD_STATIC_NODES_H + +#include "serd/serd.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 -- cgit v1.2.1