summaryrefslogtreecommitdiff
path: root/external/redland/redland/librdf.h
blob: 1650f66f998d0f1f0cbadec65be9b78913720193 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
/* -*- Mode: c; c-basic-offset: 2 -*-
 *
 * redland.h - Redland RDF Application Framework public API
 *
 * Copyright (C) 2000-2011, David Beckett http://www.dajobe.org/
 * Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/
 *
 * This package is Free Software and part of Redland http://librdf.org/
 *
 * It is licensed under the following three licenses as alternatives:
 *   1. GNU Lesser General Public License (LGPL) V2.1 or any newer version
 *   2. GNU General Public License (GPL) V2 or any newer version
 *   3. Apache License, V2.0 or any newer version
 *
 * You may not use this file except in compliance with at least one of
 * the above three licenses.
 *
 * See LICENSE.html or LICENSE.txt at the top of this package for the
 * complete terms and further detail along with the license texts for
 * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively.
 *
 *
 */


#ifndef LIBRDF_H
#define LIBRDF_H

#ifndef LIBRDF_OBJC_FRAMEWORK
/* raptor */
#include <raptor2.h>
/* rasqal: uses raptor */
#include <rasqal.h>
/* librdf: uses rasqal and raptor */
#else
#include <Redland/raptor2.h>
#include <Redland/rasqal.h>
#endif

#ifdef __cplusplus
extern "C" {
#endif

#include <stdio.h>

#ifndef REDLAND_API
#  ifdef WIN32
#    ifdef __GNUC__
#      undef _declspec
#      define _declspec(x) __declspec(x)
#    endif
#    ifdef REDLAND_STATIC
#      define REDLAND_API
#    else
#      ifdef LIBRDF_INTERNAL
#        define REDLAND_API _declspec(dllexport)
#      else
#        define REDLAND_API _declspec(dllimport)
#      endif
#    endif
#  else
#    define REDLAND_API
#  endif
#endif

#ifndef REDLAND_CALLBACK_STDCALL
#  if defined(WIN32) && defined(USE_STDCALL_CALLBACKS)
#    define REDLAND_CALLBACK_STDCALL _stdcall
#  else
#    define REDLAND_CALLBACK_STDCALL
#  endif
#endif

/* Use gcc 3.1+ feature to allow marking of deprecated API calls.
 * This gives a warning during compiling.
 */
#if ( __GNUC__ == 3 && __GNUC_MINOR__ > 0 ) || __GNUC__ > 3
#define REDLAND_DEPRECATED __attribute__((deprecated))
#define REDLAND_NORETURN __attribute__((__noreturn__))
#else
#define REDLAND_DEPRECATED
#define REDLAND_NORETURN
#endif


#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
#define REDLAND_PRINTF_FORMAT(string_index, first_to_check_index) \
  __attribute__((__format__(__printf__, string_index, first_to_check_index)))
#else
#define REDLAND_PRINTF_FORMAT(string_index, first_to_check_index)
#endif


/* Public defines */

/**
 * LIBRDF_VERSION:
 *
 * Redland librdf library version number
 *
 * Format: major * 10000 + minor * 100 + release
 */
#define LIBRDF_VERSION 10016

/**
 * LIBRDF_VERSION_STRING:
 *
 * Redland librdf library version string
 */
#define LIBRDF_VERSION_STRING "1.0.16"

/**
 * LIBRDF_VERSION_MAJOR:
 *
 * Redland librdf library major version
 */
#define LIBRDF_VERSION_MAJOR 1

/**
 * LIBRDF_VERSION_MINOR:
 *
 * Redland librdf library minor version
 */
#define LIBRDF_VERSION_MINOR 0

/**
 * LIBRDF_VERSION_RELEASE:
 *
 * Redland librdf library release
 */
#define LIBRDF_VERSION_RELEASE 16



/* Public typedefs (references to private structures) */

/**
 * librdf_world:
 *
 * Redland world class.
 */
typedef struct librdf_world_s librdf_world;

/**
 * librdf_hash:
 *
 * Redland hash class.
 */
typedef struct librdf_hash_s librdf_hash;

/**
 * librdf_hash_cursor:
 *
 * Redland hash cursor class.
 */
typedef struct librdf_hash_cursor_s librdf_hash_cursor;

/**
 * librdf_digest:
 *
 * Redland content digest class.
 */
typedef struct librdf_digest_s librdf_digest;

/**
 * librdf_digest_factory:
 *
 * Redland digest factory class.
 */
typedef struct librdf_digest_factory_s librdf_digest_factory;

/**
 * librdf_uri:
 *
 * Redland URI class.
 */
typedef struct raptor_uri_s librdf_uri;

/**
 * librdf_list:
 *
 * Redland list class.
 */
typedef struct librdf_list_s librdf_list;

/**
 * librdf_iterator:
 *
 * Redland iterator class.
 */
typedef struct librdf_iterator_s librdf_iterator;

/**
 * librdf_node:
 *
 * Redland node class.
 */
typedef raptor_term librdf_node;

/**
 * librdf_statement:
 *
 * Redland statement class.
 */
typedef raptor_statement librdf_statement;

/**
 * librdf_model:
 *
 * Redland model class.
 */
typedef struct librdf_model_s librdf_model;

/**
 * librdf_model_factory:
 *
 * Redland model factory class.
 */
typedef struct librdf_model_factory_s librdf_model_factory;

/**
 * librdf_storage:
 *
 * Redland storage class.
 */
typedef struct librdf_storage_s librdf_storage;

/**
 * librdf_storage_factory:
 *
 * Redland storage factory class.
 */
typedef struct librdf_storage_factory_s librdf_storage_factory;

/**
 * librdf_stream:
 *
 * Redland stream class.
 */
typedef struct librdf_stream_s librdf_stream;

/**
 * librdf_parser:
 *
 * Redland parser class.
 */
typedef struct librdf_parser_s librdf_parser;

/**
 * librdf_parser_factory:
 *
 * Redland parser factory class.
 */
typedef struct librdf_parser_factory_s librdf_parser_factory;

/**
 * librdf_query:
 *
 * Redland query class.
 */
typedef struct librdf_query_s librdf_query;

/**
 * librdf_query_factory:
 *
 * Redland query factory class.
 */
typedef struct librdf_query_factory_s librdf_query_factory;

/**
 * librdf_query_results:
 *
 * Redland query results class.
 */
typedef struct librdf_query_results_s librdf_query_results;

/**
 * librdf_query_results_formatter:
 *
 * Redland query results formatter class.
 */
typedef struct librdf_query_results_formatter_s librdf_query_results_formatter;

/**
 * librdf_serializer:
 *
 * Redland serializer class.
 */
typedef struct librdf_serializer_s librdf_serializer;

/**
 * librdf_serializer_factory:
 *
 * Redland serializer factory class.
 */
typedef struct librdf_serializer_factory_s librdf_serializer_factory;


/* Public statics */

/**
 * librdf_short_copyright_string:
 *
 * Short copyright string (one line).
 */
REDLAND_API
extern const char * const librdf_short_copyright_string;

/**
 * librdf_copyright_string:
 *
 * Copyright string (multiple lines).
 */
REDLAND_API
extern const char * const librdf_copyright_string;

/**
 * librdf_version_string:
 *
 * Redland librdf version as a string.
 */
REDLAND_API
extern const char * const librdf_version_string;

/**
 * librdf_version_major:
 *
 * Redland librdf major version number.
 */
REDLAND_API
extern const unsigned int librdf_version_major;

/**
 * librdf_version_minor:
 *
 * Redland librdf minor version number.
 */
REDLAND_API
extern const unsigned int librdf_version_minor;

/**
 * librdf_version_release:
 *
 * Redland librdf release version number.
 */
REDLAND_API
extern const unsigned int librdf_version_release;

/**
 * librdf_version_decimal:
 *
 * Redland librdf version as a decimal number.
 *
 * Format: major * 10000 + minor * 100 + release
 */
REDLAND_API
extern const unsigned int librdf_version_decimal;

/**
 * librdf_license_string:
 *
 * Redland librdf license string.
 */
REDLAND_API
extern const char * const librdf_license_string;

/**
 * librdf_home_url_string:
 *
 * Redland librdf home page URL.
 */
REDLAND_API
extern const char * const librdf_home_url_string;

/* Required for va_list in error handler function registrations
 * which are in the public API
 */
#include <stdarg.h>


/* internal interfaces  */
#ifdef LIBRDF_INTERNAL
#include <rdf_internal.h>
#endif

/* public interfaces */

/* FIXME: Should be replaced with automatically pulled
 * definitions from the listed rdf_*.h header files.
 */

#ifndef LIBRDF_OBJC_FRAMEWORK
#include <rdf_log.h>
#include <rdf_digest.h>
#include <rdf_hash.h>
#include <rdf_init.h>
#include <rdf_iterator.h>
#include <rdf_uri.h>
#include <rdf_node.h>
#include <rdf_concepts.h>
#include <rdf_statement.h>
#include <rdf_model.h>
#include <rdf_storage.h>
#include <rdf_parser.h>
#include <rdf_raptor.h>
#include <rdf_serializer.h>
#include <rdf_stream.h>
#include <rdf_query.h>
#include <rdf_utf8.h>
#else
#include <Redland/rdf_log.h>
#include <Redland/rdf_digest.h>
#include <Redland/rdf_hash.h>
#include <Redland/rdf_init.h>
#include <Redland/rdf_iterator.h>
#include <Redland/rdf_uri.h>
#include <Redland/rdf_node.h>
#include <Redland/rdf_concepts.h>
#include <Redland/rdf_statement.h>
#include <Redland/rdf_model.h>
#include <Redland/rdf_storage.h>
#include <Redland/rdf_parser.h>
#include <Redland/rdf_raptor.h>
#include <Redland/rdf_serializer.h>
#include <Redland/rdf_stream.h>
#include <Redland/rdf_query.h>
#include <Redland/rdf_utf8.h>
#endif

#ifdef __cplusplus
}
#endif

#endif