9 * Save this program as binary.c
10 * Compile and run it as bellow.
12 * Change the data type of 'i' from int to char, and to float,
13 * and to double, and recompile it.
15 * You should not use binary types.
16 * Consider a text representation of
17 * your types and write them as string.
19 * cc -L/lib -lkdb binary.c -o binary; ./binary; cat user/tmp/bin
26 Key *key=keyNew("user/examples/bin",KEY_END);
28 KDB * handle= kdbOpen();
30 keySetBinary(key,&i,sizeof(i));
31 kdbSetKey(handle,key);
34 back=keyNew("user/examples/bin", KEY_END);
35 kdbGetKey(handle,back);
36 printf("Got back: %d\n",*(int*)keyValue(back));
38 kdbSetKey(handle,key);