~ubuntu-branches/ubuntu/oneiric/gconf/oneiric-proposed

« back to all changes in this revision

Viewing changes to doc/gconf/tmpl/gconf-backend.sgml

  • Committer: Bazaar Package Importer
  • Author(s): Takuo KITAME
  • Date: 2002-03-17 01:51:39 UTC
  • Revision ID: james.westby@ubuntu.com-20020317015139-z4f8fdg1hoe049g0
Tags: upstream-1.0.9
ImportĀ upstreamĀ versionĀ 1.0.9

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!-- ##### SECTION Title ##### -->
 
2
gconf-backend
 
3
 
 
4
<!-- ##### SECTION Short_Description ##### -->
 
5
 
 
6
 
 
7
<!-- ##### SECTION Long_Description ##### -->
 
8
<para>
 
9
 
 
10
</para>
 
11
 
 
12
<!-- ##### SECTION See_Also ##### -->
 
13
<para>
 
14
 
 
15
</para>
 
16
 
 
17
<!-- ##### STRUCT GConfBackendVTable ##### -->
 
18
<para>
 
19
The #GConfBackendVTable is a table of methods that any GConf backend must
 
20
implement.  The dynamically loaded library module should export a function
 
21
called gconf_backend_get_vtable() that returns a pointer to a
 
22
#GConfBackendVTable.
 
23
</para>
 
24
 
 
25
<para>
 
26
Here are the methods the backend must implement, and their specification:
 
27
 
 
28
<informaltable pgwide=1 frame="none">
 
29
<tgroup cols="2"><colspec colwidth="2*"><colspec colwidth="8*">
 
30
<tbody>
 
31
 
 
32
<row>
 
33
<entry>@shutdown</entry> 
 
34
<entry>Called prior to unloading the dynamic
 
35
module. Should ensure that no functions or static/global variables from the
 
36
module will ever be accessed again. Should free any memory that the backend
 
37
no longer needs.
 
38
</entry>
 
39
</row>
 
40
 
 
41
<row>
 
42
<entry>@resolve_address</entry> 
 
43
 
 
44
<entry>
 
45
Should create a #GConfSource for accessing the supplied address. Should set the
 
46
%GCONF_SOURCE_ALL_READABLE and %GCONF_SOURCE_ALL_WRITEABLE flags if
 
47
appropriate. If these are not set, the backend must implement the @writable and
 
48
@readable methods. If <symbol>NULL</symbol> is returned, then the error should
 
49
be set.
 
50
</entry>
 
51
 
 
52
</row>
 
53
 
 
54
<row>
 
55
<entry>@lock</entry> 
 
56
 
 
57
<entry>If the backend is thread safe (does its own locking or whatever), then
 
58
@lock and @unlock can be <symbol>NULL</symbol>.  If the backend requires a lock
 
59
for each source, then @lock and @unlock should lock/unlock that lock. If the
 
60
backend has a global lock for all uses of the backend, then @lock and @unlock
 
61
should ignore their arguments and lock the entire backend.
 
62
</entry>
 
63
 
 
64
</row>
 
65
 
 
66
 
 
67
<row>
 
68
<entry>@unlock</entry>
 
69
<entry>See description of @lock.</entry>
 
70
</row>
 
71
 
 
72
 
 
73
<row>
 
74
<entry>@readable</entry> 
 
75
 
 
76
<entry>
 
77
If the %GCONF_SOURCE_ALL_READABLE flag is set, this method is never called and
 
78
may be <symbol>NULL</symbol>. If %GCONF_SOURCE_ALL_READABLE is unset, and this
 
79
method is <symbol>NULL</symbol>, then the source is write-only. If this method
 
80
is implemented, it should return <symbol>TRUE</symbol> if the given key could be
 
81
read from the given source. <symbol>TRUE</symbol> should be returned even if the
 
82
key is unset; this function returns something similar to permissions, it is not
 
83
asking whether the key exists. <emphasis>If an error is set, then
 
84
<symbol>FALSE</symbol> must be returned.</emphasis>
 
85
</entry>
 
86
 
 
87
</row>
 
88
 
 
89
 
 
90
<row>
 
91
<entry>@writable</entry>
 
92
<entry>Analagous to @readable, but for writing.</entry>
 
93
</row>
 
94
 
 
95
 
 
96
<row>
 
97
<entry>@query_value</entry>
 
98
 
 
99
<entry>This method must be implemented if the source is readable. It returns the
 
100
value of a key.  The "locales" argument is a <symbol>NULL</symbol>-terminated
 
101
vector of locale names, where the first locale in the vector is the preferred
 
102
locale, the next is the second choice, etc. if the "schema_name" argument is
 
103
non-<symbol>NULL</symbol>, then it should be filled with an allocated string
 
104
giving the name of the schema attached to the key, if and only if
 
105
<symbol>NULL</symbol> is returned. This is an optimization to avoid looking up
 
106
the same key again in the database if it's unset and we need to ask for its
 
107
default value from the schema. If <symbol>NULL</symbol> is returned, indicating
 
108
that the key is unset, then schema_name should not be filled in. If this method
 
109
sets an error, <symbol>NULL</symbol> must be returned. It may not set an error
 
110
while also returning a value. The returned value will be destroyed by the
 
111
caller, so should be a copy of the backend's internal data.
 
112
</entry>
 
113
</row>
 
114
 
 
115
<row>
 
116
<entry>@query_metainfo</entry>
 
117
 
 
118
<entry>This method must be implemented. If any metainfo is
 
119
available about a key, it returns a #GConfMetaInfo with that metainfo set.  If
 
120
none is available, <symbol>NULL</symbol> is returned. <symbol>NULL</symbol>
 
121
should also be returned if an error is set.
 
122
</entry>
 
123
 
 
124
</row>
 
125
 
 
126
 
 
127
<row>
 
128
<entry>@set_value</entry>
 
129
 
 
130
<entry>This method must be implemented if the source is
 
131
writable. It sets the value of a key. If the key is already set, its value
 
132
should be replaced. Setting a value should update the modification time of the
 
133
key.
 
134
</entry>
 
135
 
 
136
</row>
 
137
 
 
138
 
 
139
<row>
 
140
<entry>@all_entries</entry>
 
141
 
 
142
<entry>This method must be implemented. It returns a list of all keys in the
 
143
given directory for which some information is available (metainfo or
 
144
values). The returned list should contain #GConfEntry objects. On error,
 
145
<symbol>NULL</symbol> should be returned and the error set. Subdirectories
 
146
should not be included in the returned list. The list and the #GConfEntry
 
147
objects will be freed by the caller.
 
148
</entry>
 
149
 
 
150
</row>
 
151
 
 
152
 
 
153
<row>
 
154
<entry>@all_subdirs</entry>
 
155
 
 
156
<entry>This method must be implemented. It returns a list of all the subdirectories in a given
 
157
directory.  It should return the subdirectories as relative paths, i.e. there
 
158
should not be any slashes in the subdirectory name. Each subdirectory in the list
 
159
should be an allocated string; the list and the strings will be freed by the caller.
 
160
</entry>
 
161
 
 
162
</row>
 
163
 
 
164
 
 
165
<row>
 
166
<entry>@unset_value</entry>
 
167
 
 
168
<entry>If the given key has a value, then this method should unset the value.
 
169
If a value is unset, subsequent calls to @query_value should return
 
170
<symbol>NULL</symbol>. If the locale string passed in to @unset_value is
 
171
non-<symbol>NULL</symbol>, then only the value for that locale should be
 
172
unset. If <symbol>NULL</symbol>, the value should be globally unset for all
 
173
locales.
 
174
</entry>
 
175
 
 
176
</row>
 
177
 
 
178
 
 
179
<row>
 
180
<entry>@dir_exists</entry>
 
181
 
 
182
<entry>
 
183
Determines whether a directory exists. Should return
 
184
<symbol>TRUE</symbol> if there is a directory with the given name.
 
185
</entry>
 
186
 
 
187
</row>
 
188
 
 
189
 
 
190
<row>
 
191
<entry>@remove_dir</entry>
 
192
 
 
193
<entry>
 
194
Should remove a directory, recursively: including all its subdirectories and 
 
195
all the values and keys inside the directory.
 
196
</entry>
 
197
 
 
198
</row>
 
199
 
 
200
 
 
201
<row>
 
202
<entry>@set_schema</entry>
 
203
 
 
204
<entry>Should associate a schema name with a key.
 
205
</entry>
 
206
 
 
207
</row>
 
208
 
 
209
 
 
210
<row>
 
211
<entry>@sync_all</entry>
 
212
 
 
213
<entry>
 
214
Should ensure that all data is stored on permanent media, or whatever makes
 
215
sense for the backend. Called periodically by the GConf daemon.
 
216
</entry>
 
217
 
 
218
</row>
 
219
 
 
220
 
 
221
<row>
 
222
<entry>@destroy_source</entry>
 
223
 
 
224
<entry>
 
225
Should destroy a source obtained with @resolve_address.
 
226
</entry>
 
227
 
 
228
</row>
 
229
 
 
230
 
 
231
</tbody></tgroup></informaltable>
 
232
</para>
 
233
 
 
234
@shutdown: 
 
235
@resolve_address: 
 
236
@lock: 
 
237
@unlock: 
 
238
@readable: 
 
239
@writable: 
 
240
@query_value: 
 
241
@query_metainfo: 
 
242
@set_value: 
 
243
@all_entries: 
 
244
@all_subdirs: 
 
245
@unset_value: 
 
246
@dir_exists: 
 
247
@remove_dir: 
 
248
@set_schema: 
 
249
@sync_all: 
 
250
@destroy_source: 
 
251
@clear_cache: 
 
252
 
 
253
<!-- ##### STRUCT GConfBackend ##### -->
 
254
<para>
 
255
 
 
256
</para>
 
257
 
 
258
@name: 
 
259
@refcount: 
 
260
@vtable: 
 
261
@module: 
 
262
 
 
263
<!-- ##### FUNCTION gconf_address_backend ##### -->
 
264
<para>
 
265
 
 
266
</para>
 
267
 
 
268
@address: 
 
269
@Returns: 
 
270
 
 
271
 
 
272
<!-- ##### FUNCTION gconf_address_resource ##### -->
 
273
<para>
 
274
 
 
275
</para>
 
276
 
 
277
@address: 
 
278
@Returns: 
 
279
 
 
280
 
 
281
<!-- ##### FUNCTION gconf_backend_file ##### -->
 
282
<para>
 
283
 
 
284
</para>
 
285
 
 
286
@address: 
 
287
@Returns: 
 
288
 
 
289
 
 
290
<!-- ##### FUNCTION gconf_get_backend ##### -->
 
291
<para>
 
292
 
 
293
</para>
 
294
 
 
295
@address: 
 
296
@err: 
 
297
@Returns: 
 
298
 
 
299
 
 
300
<!-- ##### FUNCTION gconf_backend_ref ##### -->
 
301
<para>
 
302
 
 
303
</para>
 
304
 
 
305
@backend: 
 
306
 
 
307
 
 
308
<!-- ##### FUNCTION gconf_backend_unref ##### -->
 
309
<para>
 
310
 
 
311
</para>
 
312
 
 
313
@backend: 
 
314
 
 
315
 
 
316
<!-- ##### FUNCTION gconf_backend_resolve_address ##### -->
 
317
<para>
 
318
 
 
319
</para>
 
320
 
 
321
@backend: 
 
322
@address: 
 
323
@err: 
 
324
@Returns: 
 
325
 
 
326