1/* -*- Mode: c; c-basic-offset: 2 -*-
2 *
3 * rdf_init.h - Overall library initialisation / termination and memory
4 * management prototypes
5 *
6 * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/
7 * Copyright (C) 2000-2004, University of Bristol, UK http://www.bristol.ac.uk/
8 *
9 * This package is Free Software and part of Redland http://librdf.org/
10 *
11 * It is licensed under the following three licenses as alternatives:
12 * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version
13 * 2. GNU General Public License (GPL) V2 or any newer version
14 * 3. Apache License, V2.0 or any newer version
15 *
16 * You may not use this file except in compliance with at least one of
17 * the above three licenses.
18 *
19 * See LICENSE.html or LICENSE.txt at the top of this package for the
20 * complete terms and further detail along with the license texts for
21 * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively.
22 *
23 *
24 */
25
26
27#ifndef LIBRDF_INIT_H
28#define LIBRDF_INIT_H
29
30typedef void (*librdf_raptor_init_handler)(void* user_data, raptor_world* raptor_world_ptr);
31typedef void (*librdf_rasqal_init_handler)(void* user_data, rasqal_world* rasqal_world_ptr);
32
33
34#ifdef LIBRDF_INTERNAL
35#include <rdf_init_internal.h>
36#endif
37
38#ifndef LIBRDF_OBJC_FRAMEWORK
39#include <rasqal.h>
40#else
41#include <Redland/rasqal.h>
42#endif
43
44#ifdef __cplusplus
45extern "C" {
46#endif
47
48REDLAND_API
49librdf_world* librdf_new_world(void);
50REDLAND_API
51void librdf_free_world(librdf_world *world);
52REDLAND_API
53void librdf_world_open(librdf_world *world);
54
55REDLAND_API
56void librdf_world_init_mutex(librdf_world *world);
57
58REDLAND_API
59void librdf_world_set_rasqal(librdf_world* world, rasqal_world* rasqal_world_ptr);
60
61REDLAND_API
62void librdf_world_set_raptor_init_handler(librdf_world* world, void* user_data, librdf_raptor_init_handler handler);
63REDLAND_API
64void librdf_world_set_rasqal_init_handler(librdf_world* world, void* user_data, librdf_rasqal_init_handler handler);
65
66REDLAND_API
67rasqal_world* librdf_world_get_rasqal(librdf_world* world);
68
69REDLAND_API
70void librdf_world_set_error(librdf_world* world, void *user_data, librdf_log_level_func error_handler);
71REDLAND_API
72void librdf_world_set_warning(librdf_world* world, void *user_data, librdf_log_level_func warning_handler);
73REDLAND_API
74void librdf_world_set_logger(librdf_world* world, void *user_data, librdf_log_func log_handler);
75
76REDLAND_API
77void librdf_world_set_digest(librdf_world* world, const char *name);
78
79REDLAND_API
80void librdf_free_memory(void *ptr);
81REDLAND_API
82void* librdf_alloc_memory(size_t size);
83REDLAND_API
84void* librdf_calloc_memory(size_t nmemb, size_t size);
85
86/**
87 * LIBRDF_WORLD_FEATURE_GENID_BASE:
88 *
89 * World feature to set the generated ID base.
90 *
91 * Must be set before the world is opened with librdf_world_open().
92 */
93#define LIBRDF_WORLD_FEATURE_GENID_BASE "http://feature.librdf.org/genid-base"
94
95/**
96 * LIBRDF_WORLD_FEATURE_GENID_COUNTER:
97 *
98 * World feature to set the generated ID counter.
99 *
100 * Must be set before the world is opened with librdf_world_open().
101 */
102#define LIBRDF_WORLD_FEATURE_GENID_COUNTER "http://feature.librdf.org/genid-counter"
103
104REDLAND_API
105librdf_node* librdf_world_get_feature(librdf_world* world, librdf_uri *feature);
106REDLAND_API
107int librdf_world_set_feature(librdf_world* world, librdf_uri *feature, librdf_node* value);
108
109/* OLD INTERFACES */
110REDLAND_API REDLAND_DEPRECATED
111void librdf_init_world(char *digest_factory_name, void* not_used2);
112REDLAND_API REDLAND_DEPRECATED
113void librdf_destroy_world(void);
114
115#ifdef LIBRDF_INTERNAL
116const char* librdf_basename(const char *name);
117#endif
118
119#ifdef __cplusplus
120}
121#endif
122
123#endif
124