Cleanup
[carla.git] / source / modules / lilv / sord-0.16.0 / src / sord_internal.h
blobbfe98f6db9d823c36924d903c17aadd03fe7fa5a
1 /*
2 Copyright 2011-2015 David Robillard <http://drobilla.net>
4 Permission to use, copy, modify, and/or distribute this software for any
5 purpose with or without fee is hereby granted, provided that the above
6 copyright notice and this permission notice appear in all copies.
8 THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 #ifndef SORD_SORD_INTERNAL_H
18 #define SORD_SORD_INTERNAL_H
20 #include <stddef.h>
21 #include <stdint.h>
23 #include "sord/sord.h"
25 #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
26 # define SORD_UNREACHABLE() __builtin_unreachable()
27 #else
28 # define SORD_UNREACHABLE() assert(false)
29 #endif
31 /** Resource node metadata */
32 typedef struct {
33 size_t refs_as_obj; ///< References as a quad object
34 } SordResourceMetadata;
36 /** Literal node metadata */
37 typedef struct {
38 SordNode* datatype; ///< Optional literal data type URI
39 char lang[16]; ///< Optional language tag
40 } SordLiteralMetadata;
42 /** Node */
43 struct SordNodeImpl {
44 SerdNode node; ///< Serd node
45 size_t refs; ///< Reference count (# of containing quads)
46 union {
47 SordResourceMetadata res;
48 SordLiteralMetadata lit;
49 } meta;
52 #endif /* SORD_SORD_INTERNAL_H */