1/* -*- Mode: c; c-basic-offset: 2 -*-
2 *
3 * redland.h - Redland RDF Application Framework public API
4 *
5 * Copyright (C) 2000-2011, David Beckett http://www.dajobe.org/
6 * Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/
7 *
8 * This package is Free Software and part of Redland http://librdf.org/
9 *
10 * It is licensed under the following three licenses as alternatives:
11 * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version
12 * 2. GNU General Public License (GPL) V2 or any newer version
13 * 3. Apache License, V2.0 or any newer version
14 *
15 * You may not use this file except in compliance with at least one of
16 * the above three licenses.
17 *
18 * See LICENSE.html or LICENSE.txt at the top of this package for the
19 * complete terms and further detail along with the license texts for
20 * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively.
21 *
22 *
23 */
24
25
26#ifndef LIBRDF_H
27#define LIBRDF_H
28
29#ifndef LIBRDF_OBJC_FRAMEWORK
30/* raptor */
31#include <raptor2.h>
32/* rasqal: uses raptor */
33#include <rasqal.h>
34/* librdf: uses rasqal and raptor */
35#else
36#include <Redland/raptor2.h>
37#include <Redland/rasqal.h>
38#endif
39
40#ifdef __cplusplus
41extern "C" {
42#endif
43
44#include <stdio.h>
45
46#ifndef REDLAND_API
47# ifdef WIN32
48# ifdef __GNUC__
49# undef _declspec
50# define _declspec(x) __declspec(x)
51# endif
52# ifdef REDLAND_STATIC
53# define REDLAND_API
54# else
55# ifdef LIBRDF_INTERNAL
56# define REDLAND_API _declspec(dllexport)
57# else
58# define REDLAND_API _declspec(dllimport)
59# endif
60# endif
61# else
62# define REDLAND_API
63# endif
64#endif
65
66#ifndef REDLAND_CALLBACK_STDCALL
67# if defined(WIN32) && defined(USE_STDCALL_CALLBACKS)
68# define REDLAND_CALLBACK_STDCALL _stdcall
69# else
70# define REDLAND_CALLBACK_STDCALL
71# endif
72#endif
73
74/* Use gcc 3.1+ feature to allow marking of deprecated API calls.
75 * This gives a warning during compiling.
76 */
77#if ( __GNUC__ == 3 && __GNUC_MINOR__ > 0 ) || __GNUC__ > 3
78#define REDLAND_DEPRECATED __attribute__((deprecated))
79#define REDLAND_NORETURN __attribute__((__noreturn__))
80#else
81#define REDLAND_DEPRECATED
82#define REDLAND_NORETURN
83#endif
84
85
86#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
87#define REDLAND_PRINTF_FORMAT(string_index, first_to_check_index) \
88 __attribute__((__format__(__printf__, string_index, first_to_check_index)))
89#else
90#define REDLAND_PRINTF_FORMAT(string_index, first_to_check_index)
91#endif
92
93
94/* Public defines */
95
96/**
97 * LIBRDF_VERSION:
98 *
99 * Redland librdf library version number
100 *
101 * Format: major * 10000 + minor * 100 + release
102 */
103#define LIBRDF_VERSION 10017
104
105/**
106 * LIBRDF_VERSION_STRING:
107 *
108 * Redland librdf library version string
109 */
110#define LIBRDF_VERSION_STRING "1.0.17"
111
112/**
113 * LIBRDF_VERSION_MAJOR:
114 *
115 * Redland librdf library major version
116 */
117#define LIBRDF_VERSION_MAJOR 1
118
119/**
120 * LIBRDF_VERSION_MINOR:
121 *
122 * Redland librdf library minor version
123 */
124#define LIBRDF_VERSION_MINOR 0
125
126/**
127 * LIBRDF_VERSION_RELEASE:
128 *
129 * Redland librdf library release
130 */
131#define LIBRDF_VERSION_RELEASE 17
132
133
134
135/* Public typedefs (references to private structures) */
136
137/**
138 * librdf_world:
139 *
140 * Redland world class.
141 */
142typedef struct librdf_world_s librdf_world;
143
144/**
145 * librdf_hash:
146 *
147 * Redland hash class.
148 */
149typedef struct librdf_hash_s librdf_hash;
150
151/**
152 * librdf_hash_cursor:
153 *
154 * Redland hash cursor class.
155 */
156typedef struct librdf_hash_cursor_s librdf_hash_cursor;
157
158/**
159 * librdf_digest:
160 *
161 * Redland content digest class.
162 */
163typedef struct librdf_digest_s librdf_digest;
164
165/**
166 * librdf_digest_factory:
167 *
168 * Redland digest factory class.
169 */
170typedef struct librdf_digest_factory_s librdf_digest_factory;
171
172/**
173 * librdf_uri:
174 *
175 * Redland URI class.
176 */
177typedef struct raptor_uri_s librdf_uri;
178
179/**
180 * librdf_list:
181 *
182 * Redland list class.
183 */
184typedef struct librdf_list_s librdf_list;
185
186/**
187 * librdf_iterator:
188 *
189 * Redland iterator class.
190 */
191typedef struct librdf_iterator_s librdf_iterator;
192
193/**
194 * librdf_node:
195 *
196 * Redland node class.
197 */
198typedef raptor_term librdf_node;
199
200/**
201 * librdf_statement:
202 *
203 * Redland statement class.
204 */
205typedef raptor_statement librdf_statement;
206
207/**
208 * librdf_model:
209 *
210 * Redland model class.
211 */
212typedef struct librdf_model_s librdf_model;
213
214/**
215 * librdf_model_factory:
216 *
217 * Redland model factory class.
218 */
219typedef struct librdf_model_factory_s librdf_model_factory;
220
221/**
222 * librdf_storage:
223 *
224 * Redland storage class.
225 */
226typedef struct librdf_storage_s librdf_storage;
227
228/**
229 * librdf_storage_factory:
230 *
231 * Redland storage factory class.
232 */
233typedef struct librdf_storage_factory_s librdf_storage_factory;
234
235/**
236 * librdf_stream:
237 *
238 * Redland stream class.
239 */
240typedef struct librdf_stream_s librdf_stream;
241
242/**
243 * librdf_parser:
244 *
245 * Redland parser class.
246 */
247typedef struct librdf_parser_s librdf_parser;
248
249/**
250 * librdf_parser_factory:
251 *
252 * Redland parser factory class.
253 */
254typedef struct librdf_parser_factory_s librdf_parser_factory;
255
256/**
257 * librdf_query:
258 *
259 * Redland query class.
260 */
261typedef struct librdf_query_s librdf_query;
262
263/**
264 * librdf_query_factory:
265 *
266 * Redland query factory class.
267 */
268typedef struct librdf_query_factory_s librdf_query_factory;
269
270/**
271 * librdf_query_results:
272 *
273 * Redland query results class.
274 */
275typedef struct librdf_query_results_s librdf_query_results;
276
277/**
278 * librdf_query_results_formatter:
279 *
280 * Redland query results formatter class.
281 */
282typedef struct librdf_query_results_formatter_s librdf_query_results_formatter;
283
284/**
285 * librdf_serializer:
286 *
287 * Redland serializer class.
288 */
289typedef struct librdf_serializer_s librdf_serializer;
290
291/**
292 * librdf_serializer_factory:
293 *
294 * Redland serializer factory class.
295 */
296typedef struct librdf_serializer_factory_s librdf_serializer_factory;
297
298
299/* Public statics */
300
301/**
302 * librdf_short_copyright_string:
303 *
304 * Short copyright string (one line).
305 */
306REDLAND_API
307extern const char * const librdf_short_copyright_string;
308
309/**
310 * librdf_copyright_string:
311 *
312 * Copyright string (multiple lines).
313 */
314REDLAND_API
315extern const char * const librdf_copyright_string;
316
317/**
318 * librdf_version_string:
319 *
320 * Redland librdf version as a string.
321 */
322REDLAND_API
323extern const char * const librdf_version_string;
324
325/**
326 * librdf_version_major:
327 *
328 * Redland librdf major version number.
329 */
330REDLAND_API
331extern const unsigned int librdf_version_major;
332
333/**
334 * librdf_version_minor:
335 *
336 * Redland librdf minor version number.
337 */
338REDLAND_API
339extern const unsigned int librdf_version_minor;
340
341/**
342 * librdf_version_release:
343 *
344 * Redland librdf release version number.
345 */
346REDLAND_API
347extern const unsigned int librdf_version_release;
348
349/**
350 * librdf_version_decimal:
351 *
352 * Redland librdf version as a decimal number.
353 *
354 * Format: major * 10000 + minor * 100 + release
355 */
356REDLAND_API
357extern const unsigned int librdf_version_decimal;
358
359/**
360 * librdf_license_string:
361 *
362 * Redland librdf license string.
363 */
364REDLAND_API
365extern const char * const librdf_license_string;
366
367/**
368 * librdf_home_url_string:
369 *
370 * Redland librdf home page URL.
371 */
372REDLAND_API
373extern const char * const librdf_home_url_string;
374
375/* Required for va_list in error handler function registrations
376 * which are in the public API
377 */
378#include <stdarg.h>
379
380
381/* internal interfaces */
382#ifdef LIBRDF_INTERNAL
383#include <rdf_internal.h>
384#endif
385
386/* public interfaces */
387
388/* FIXME: Should be replaced with automatically pulled
389 * definitions from the listed rdf_*.h header files.
390 */
391
392#ifndef LIBRDF_OBJC_FRAMEWORK
393#include <rdf_log.h>
394#include <rdf_digest.h>
395#include <rdf_hash.h>
396#include <rdf_init.h>
397#include <rdf_iterator.h>
398#include <rdf_uri.h>
399#include <rdf_node.h>
400#include <rdf_concepts.h>
401#include <rdf_statement.h>
402#include <rdf_model.h>
403#include <rdf_storage.h>
404#include <rdf_parser.h>
405#include <rdf_raptor.h>
406#include <rdf_serializer.h>
407#include <rdf_stream.h>
408#include <rdf_query.h>
409#include <rdf_utf8.h>
410#else
411#include <Redland/rdf_log.h>
412#include <Redland/rdf_digest.h>
413#include <Redland/rdf_hash.h>
414#include <Redland/rdf_init.h>
415#include <Redland/rdf_iterator.h>
416#include <Redland/rdf_uri.h>
417#include <Redland/rdf_node.h>
418#include <Redland/rdf_concepts.h>
419#include <Redland/rdf_statement.h>
420#include <Redland/rdf_model.h>
421#include <Redland/rdf_storage.h>
422#include <Redland/rdf_parser.h>
423#include <Redland/rdf_raptor.h>
424#include <Redland/rdf_serializer.h>
425#include <Redland/rdf_stream.h>
426#include <Redland/rdf_query.h>
427#include <Redland/rdf_utf8.h>
428#endif
429
430#ifdef __cplusplus
431}
432#endif
433
434#endif
435