diff options
author | David Robillard <d@drobilla.net> | 2018-05-12 18:03:13 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2022-01-13 23:03:21 -0500 |
commit | 7a171498eca31ddedb0de1f372c982eca00d3d50 (patch) | |
tree | 9e36ee76aef1a6e41fac894c70421bbebf3a6847 /src/static_nodes.h | |
parent | db3799cd77f8f4e6525ea31c4d5f9400f47aa228 (diff) | |
download | serd-7a171498eca31ddedb0de1f372c982eca00d3d50.tar.gz serd-7a171498eca31ddedb0de1f372c982eca00d3d50.tar.bz2 serd-7a171498eca31ddedb0de1f372c982eca00d3d50.zip |
Set datatypes on integer, decimal, and base64 nodes
Diffstat (limited to 'src/static_nodes.h')
-rw-r--r-- | src/static_nodes.h | 38 |
1 files changed, 38 insertions, 0 deletions
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 <d@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 "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 |