00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #include <kdb.h>
00038 #include <kdbbackend.h>
00039
00040
00041 #define BACKENDNAME "my_backend"
00042
00043
00044
00046 #ifdef PATH_MAX
00047 #define MAX_PATH_LENGTH PATH_MAX
00048
00049 #elif __USE_POSIX
00050 #define MAX_PATH_LENGTH _POSIX_PATH_MAX
00051 #else
00052 #define MAX_PATH_LENGTH 4096
00053 #endif
00054
00055
00056
00057
00133 int kdbOpen_backend() {
00134
00135 return 0;
00136 }
00137
00138
00139
00140
00154 int kdbClose_backend() {
00155
00156 return 0;
00157 }
00158
00159
00160
00171 int kdbStatKey_backend(Key *key) {
00172
00173 return 0;
00174 }
00175
00176
00187 int kdbGetKey_backend(Key *key) {
00188
00189 return 0;
00190 }
00191
00192
00193
00206 int kdbSetKey_backend(Key *key) {
00207
00208 return 0;
00209 }
00210
00211
00212
00219 int kdbRename_backend(Key *key, const char *newName) {
00220
00221 return 0;
00222 }
00223
00224
00225
00226
00233 int kdbRemoveKey_backend(const Key *key) {
00234
00235 return 0;
00236 }
00237
00238
00239
00240
00247 ssize_t kdbGetKeyChildKeys_backend(const Key *parentKey, KeySet *returned, unsigned long options) {
00248
00249 return returned->size;
00250 }
00251
00252
00263 int kdbSetKeys_backend(KeySet *ks) {
00264
00265 return 0;
00266 }
00267
00268
00277 uint32_t kdbMonitorKeys_backend(KeySet *interests, uint32_t diffMask,
00278 unsigned long iterations, unsigned sleep) {
00279 return 0;
00280 }
00281
00282
00283
00293 uint32_t kdbMonitorKey_backend(Key *interest, uint32_t diffMask,
00294 unsigned long iterations, unsigned sleep) {
00295 return 0;
00296 }
00297
00298
00314 KDBBackend *kdbBackendFactory(void) {
00315 return kdbBackendExport(BACKENDNAME,
00316 KDB_BE_OPEN, &kdbOpen_backend,
00317 KDB_BE_CLOSE, &kdbClose_backend,
00318 KDB_BE_GETKEY, &kdbGetKey_backend,
00319 KDB_BE_SETKEY, &kdbSetKey_backend,
00320 KDB_BE_STATKEY, &kdbStatKey_backend,
00321 KDB_BE_RENAME, &kdbRename_backend,
00322 KDB_BE_REMOVEKEY, &kdbRemoveKey_backend,
00323 KDB_BE_GETCHILD, &kdbGetKeyChildKeys_backend,
00324 KDB_BE_MONITORKEY, &kdbMonitorKey_backend,
00325 KDB_BE_MONITORKEYS, &kdbMonitorKeys_backend,
00326
00327
00328
00329 KDB_BE_END);
00330 }