Git init
[pkgs/e/elektra.git] / examples / lookup.c
1 #include <stdio.h>
2 #include <kdb.h>
3
4 int main(int argc,char **argv) {
5         KeySet *ks;
6         Key *key=0;
7         KDB *handle = kdbOpen();
8
9         ks=ksNew(0);
10
11         kdbGetByName(handle,ks,"system/sw/xorg",0);
12         kdbClose(handle);
13
14         ksRewind(ks);
15         key=ksLookupByName(ks,"system/sw/xorg/current/screens/screen0/displays/00/depth",
16                 KDB_O_NOCASE);
17
18         printf("*************** Name matching\n\n");
19         if (key) {
20                 /* keyToStream(key,stdout,0); */
21                 
22                 key=ksCurrent(ks);
23                 
24                 /* keyToStream(key,stdout,0);  should be the same */
25         }
26 }