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 | |
30 | typedef void (*librdf_raptor_init_handler)(void* user_data, raptor_world* raptor_world_ptr); |
31 | typedef 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 |
45 | extern "C" { |
46 | #endif |
47 | |
48 | REDLAND_API |
49 | librdf_world* librdf_new_world(void); |
50 | REDLAND_API |
51 | void librdf_free_world(librdf_world *world); |
52 | REDLAND_API |
53 | void librdf_world_open(librdf_world *world); |
54 | |
55 | REDLAND_API |
56 | void librdf_world_init_mutex(librdf_world *world); |
57 | |
58 | REDLAND_API |
59 | void librdf_world_set_rasqal(librdf_world* world, rasqal_world* rasqal_world_ptr); |
60 | |
61 | REDLAND_API |
62 | void librdf_world_set_raptor_init_handler(librdf_world* world, void* user_data, librdf_raptor_init_handler handler); |
63 | REDLAND_API |
64 | void librdf_world_set_rasqal_init_handler(librdf_world* world, void* user_data, librdf_rasqal_init_handler handler); |
65 | |
66 | REDLAND_API |
67 | rasqal_world* librdf_world_get_rasqal(librdf_world* world); |
68 | |
69 | REDLAND_API |
70 | void librdf_world_set_error(librdf_world* world, void *user_data, librdf_log_level_func error_handler); |
71 | REDLAND_API |
72 | void librdf_world_set_warning(librdf_world* world, void *user_data, librdf_log_level_func warning_handler); |
73 | REDLAND_API |
74 | void librdf_world_set_logger(librdf_world* world, void *user_data, librdf_log_func log_handler); |
75 | |
76 | REDLAND_API |
77 | void librdf_world_set_digest(librdf_world* world, const char *name); |
78 | |
79 | REDLAND_API |
80 | void librdf_free_memory(void *ptr); |
81 | REDLAND_API |
82 | void* librdf_alloc_memory(size_t size); |
83 | REDLAND_API |
84 | void* 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 | |
104 | REDLAND_API |
105 | librdf_node* librdf_world_get_feature(librdf_world* world, librdf_uri *feature); |
106 | REDLAND_API |
107 | int librdf_world_set_feature(librdf_world* world, librdf_uri *feature, librdf_node* value); |
108 | |
109 | /* OLD INTERFACES */ |
110 | REDLAND_API REDLAND_DEPRECATED |
111 | void librdf_init_world(char *digest_factory_name, void* not_used2); |
112 | REDLAND_API REDLAND_DEPRECATED |
113 | void librdf_destroy_world(void); |
114 | |
115 | #ifdef LIBRDF_INTERNAL |
116 | const char* librdf_basename(const char *name); |
117 | #endif |
118 | |
119 | #ifdef __cplusplus |
120 | } |
121 | #endif |
122 | |
123 | #endif |
124 | |