Mercurial > hg > piper-cpp
comparison ext/sord/src/sord_internal.h @ 226:c5cdc9e6a4bf
Add these external library files
author | Chris Cannam <cannam@all-day-breakfast.com> |
---|---|
date | Fri, 09 Jun 2017 16:41:31 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
225:025b3e2f7c17 | 226:c5cdc9e6a4bf |
---|---|
1 /* | |
2 Copyright 2011-2015 David Robillard <http://drobilla.net> | |
3 | |
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. | |
7 | |
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. | |
15 */ | |
16 | |
17 #ifndef SORD_SORD_INTERNAL_H | |
18 #define SORD_SORD_INTERNAL_H | |
19 | |
20 #include <stddef.h> | |
21 #include <stdint.h> | |
22 | |
23 #include "sord/sord.h" | |
24 | |
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 | |
30 | |
31 /** Resource node metadata */ | |
32 typedef struct { | |
33 size_t refs_as_obj; ///< References as a quad object | |
34 } SordResourceMetadata; | |
35 | |
36 /** Literal node metadata */ | |
37 typedef struct { | |
38 SordNode* datatype; ///< Optional literal data type URI | |
39 char lang[16]; ///< Optional language tag | |
40 } SordLiteralMetadata; | |
41 | |
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; | |
50 }; | |
51 | |
52 #endif /* SORD_SORD_INTERNAL_H */ |