LMMS
Loading...
Searching...
No Matches
sratom.h
Go to the documentation of this file.
1/*
2 Copyright 2012-2016 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
20
21#ifndef SRATOM_SRATOM_H
22#define SRATOM_SRATOM_H
23
24#include <stdint.h>
25
26#include "lv2/urid.h"
27#include "lv2/atom.h"
28#include "lv2/atom-forge.h"
29#include "serd/serd.h"
30#include "sord/sord.h"
31
32#ifdef SRATOM_SHARED
33# ifdef _WIN32
34# define SRATOM_LIB_IMPORT __declspec(dllimport)
35# define SRATOM_LIB_EXPORT __declspec(dllexport)
36# else
37# define SRATOM_LIB_IMPORT __attribute__((visibility("default")))
38# define SRATOM_LIB_EXPORT __attribute__((visibility("default")))
39# endif
40# ifdef SRATOM_INTERNAL
41# define SRATOM_API SRATOM_LIB_EXPORT
42# else
43# define SRATOM_API SRATOM_LIB_IMPORT
44# endif
45#else
46# define SRATOM_API
47#endif
48
49#ifdef __cplusplus
50extern "C" {
51#endif
52
58
62typedef struct SratomImpl Sratom;
63
88
93Sratom*
95
100void
101sratom_free(Sratom* sratom);
102
110void
111sratom_set_env(Sratom* sratom,
112 SerdEnv* env);
113
120void
121sratom_set_sink(Sratom* sratom,
122 const char* base_uri,
124 SerdEndSink end_sink,
125 void* handle);
126
135void
137 bool pretty_numbers);
138
143void
146
153int
154sratom_write(Sratom* sratom,
156 uint32_t flags,
157 const SerdNode* subject,
158 const SerdNode* predicate,
161 const void* body);
162
168void
169sratom_read(Sratom* sratom,
172 SordModel* model,
173 const SordNode* subject);
174
180char*
183 const char* base_uri,
184 const SerdNode* subject,
185 const SerdNode* predicate,
188 const void* body);
189
197 const char* base_uri,
198 const SerdNode* subject,
199 const SerdNode* predicate,
200 const char* str);
201
209 const void* buf,
210 uint32_t size);
211
219
223
224#ifdef __cplusplus
225} /* extern "C" */
226#endif
227
228#endif /* SRATOM_SRATOM_H */
CAdPlugDatabase::CRecord::RecordType type
Definition adplugdb.cpp:93
static uint8_t unmap(const uint8_t in)
Definition base64.c:94
void * LV2_Atom_Forge_Sink_Handle
Definition atom-forge.h:79
intptr_t LV2_Atom_Forge_Ref
Definition atom-forge.h:82
SerdStatus(* SerdStatementSink)(void *SERD_NULLABLE handle, SerdStatementFlags flags, const SerdNode *SERD_NULLABLE graph, const SerdNode *SERD_NONNULL subject, const SerdNode *SERD_NONNULL predicate, const SerdNode *SERD_NONNULL object, const SerdNode *SERD_NULLABLE object_datatype, const SerdNode *SERD_NULLABLE object_lang)
Definition serd.h:632
SerdStatus(* SerdEndSink)(void *SERD_NULLABLE handle, const SerdNode *SERD_NONNULL node)
Definition serd.h:649
struct SerdEnvImpl SerdEnv
Lexical environment for relative URIs or CURIEs (base URI and namespaces).
Definition serd.h:91
struct SordWorldImpl SordWorld
Definition sord.h:57
struct SordNodeImpl SordNode
Definition sord.h:88
struct SordModelImpl SordModel
Definition sord.h:66
SRATOM_API void sratom_set_pretty_numbers(Sratom *sratom, bool pretty_numbers)
Definition sratom.c:129
SRATOM_API void sratom_free(Sratom *sratom)
Definition sratom.c:96
SRATOM_API LV2_Atom * sratom_forge_deref(LV2_Atom_Forge_Sink_Handle handle, LV2_Atom_Forge_Ref ref)
Definition sratom.c:868
SRATOM_API void sratom_set_sink(Sratom *sratom, const char *base_uri, SerdStatementSink sink, SerdEndSink end_sink, void *handle)
Definition sratom.c:111
SRATOM_API Sratom * sratom_new(LV2_URID_Map *map)
Definition sratom.c:80
SRATOM_API int sratom_write(Sratom *sratom, LV2_URID_Unmap *unmap, uint32_t flags, const SerdNode *subject, const SerdNode *predicate, uint32_t type_urid, uint32_t size, const void *body)
Definition sratom.c:242
SRATOM_API LV2_Atom_Forge_Ref sratom_forge_sink(LV2_Atom_Forge_Sink_Handle handle, const void *buf, uint32_t size)
Definition sratom.c:857
SRATOM_API void sratom_read(Sratom *sratom, LV2_Atom_Forge *forge, SordWorld *world, SordModel *model, const SordNode *node)
Definition sratom.c:827
SRATOM_API void sratom_set_env(Sratom *sratom, SerdEnv *env)
Definition sratom.c:105
SRATOM_API char * sratom_to_turtle(Sratom *sratom, LV2_URID_Unmap *unmap, const char *base_uri, const SerdNode *subject, const SerdNode *predicate, uint32_t type, uint32_t size, const void *body)
Definition sratom.c:524
SRATOM_API void sratom_set_object_mode(Sratom *sratom, SratomObjectMode object_mode)
Definition sratom.c:135
SRATOM_API LV2_Atom * sratom_from_turtle(Sratom *sratom, const char *base_uri, const SerdNode *subject, const SerdNode *predicate, const char *str)
Definition sratom.c:875
SratomObjectMode
Definition sratom.h:70
struct SratomImpl Sratom
Definition sratom.h:58
@ SRATOM_OBJECT_MODE_BLANK_SUBJECT
Definition sratom.h:82
@ SRATOM_OBJECT_MODE_BLANK
Definition sratom.h:74
static size_t sink(const void *buf, size_t len, SerdWriter *writer)
Definition writer.c:177
#define SRATOM_API
Definition sratom.h:40
static LilvWorld * world
Definition lilv_test.c:64
unsigned int uint32_t
Definition mid.cpp:100
Definition atom-forge.h:102
Definition atom.h:106
Definition urid.h:69
Definition urid.h:105
A syntactic RDF node.
Definition serd.h:199
Definition sratom.c:41
SratomObjectMode object_mode
Definition sratom.c:55
SerdNode base_uri
Definition sratom.c:45
bool pretty_numbers
Definition sratom.c:68
void * handle
Definition sratom.c:49
LV2_URID_Map * map
Definition sratom.c:42
SerdEnv * env
Definition sratom.c:44
LV2_Atom_Forge forge
Definition sratom.c:43
ulg size
Definition extract.c:2350