Main Page | Modules | Data Structures | File List | Data Fields

kdbprivate.h

00001 /***************************************************************************
00002       kdbprivate.h  -  Private stuff for the kdb implementation
00003                              -------------------
00004     begin                : Mon Apr 12 2004
00005     copyright            : (C) 2004 by Avi Alkalay
00006     email                : avi@unix.sh
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the BSD License (revised).                      *
00013  *                                                                         *
00014  ***************************************************************************/
00015 
00016 
00017 /* Subversion stuff
00018 
00019 $Id: kdbprivate.h 461 2005-10-26 21:32:24Z aviram $
00020 
00021 */
00022 
00023 #ifndef KDBPRIVATE_H
00024 #define KDBPRIVATE_H
00025 
00026 /* Elektra data directories */
00027 #define KDB_DB_SYSTEM            "/etc/kdb"
00028 #define KDB_DB_USER              ".kdb"   /* $HOME/.kdb */
00029 
00030 
00031 
00032 #define BUFFER_SIZE 100
00033 
00034 #ifdef UT_NAMESIZE
00035 #define USER_NAME_SIZE UT_NAMESIZE
00036 #else
00037 #define USER_NAME_SIZE 100
00038 #endif
00039 
00040 
00041 #ifndef DEFFILEMODE
00042 #define DEFFILEMODE 0666
00043 #endif
00044 
00045 
00046 
00047 #define UTF8_TO   1
00048 #define UTF8_FROM 0
00049 
00050 
00051 
00052 /* These define the type for pointers to all the kdb functions */
00053 typedef int (*kdbOpenPtr)();
00054 typedef int (*kdbClosePtr)();
00055 typedef int (*kdbStatKeyPtr)(Key *);
00056 typedef int (*kdbGetKeyPtr)(Key *);
00057 typedef int (*kdbSetKeyPtr)(Key *);
00058 typedef int (*kdbRenamePtr)(Key *, const char *);
00059 typedef int (*kdbRemoveKeyPtr)(const Key *);
00060 typedef int (*kdbGetChildKeysPtr)(const Key *, KeySet *, unsigned long);
00061 typedef int (*kdbSetKeysPtr)(KeySet *);
00062 typedef uint32_t (*kdbMonitorKeyPtr)(Key *, uint32_t,unsigned long, unsigned);
00063 typedef uint32_t (*kdbMonitorKeysPtr)(KeySet *, uint32_t,unsigned long, unsigned);
00064 
00065 
00066 
00067  
00068  
00082 struct _Key {
00087     uint8_t       type;
00088      
00093     uid_t          uid;
00094      
00099     uid_t          gid;
00100      
00105     mode_t         access;
00106        
00111     time_t         atime;
00112        
00117     time_t         mtime;
00118      
00123     time_t         ctime;
00124      
00129     size_t         commentSize;
00130      
00135     size_t         dataSize;
00136     size_t         recordSize;  
00142     uint32_t      flags;
00143      
00148     char *         key;
00149      
00154     char *         comment;
00155      
00160     char *         userDomain;
00161      
00166     void *         data;        
00167     struct _Key *  next;        
00168 };
00169 
00170 
00171 
00172 
00173 
00174 
00175 
00189 struct _KeySet {
00190     struct _Key * start;   
00191     struct _Key * end;     
00192     struct _Key * cursor;  
00193     size_t        size;    
00194 };
00195 
00196 
00197 
00198 
00199 
00200 
00201 
00202 #ifdef __cplusplus
00203 extern "C" {
00204 #endif
00205 
00206 
00207 
00208 ssize_t encode(void *unencoded, size_t size, char *returned);
00209 ssize_t unencode(char *encoded, void *returned);
00210 
00211 int kdbNeedsUTF8Conversion();
00212 int UTF8Engine(int direction, char **string, size_t *inputByteSize);
00213 
00214 
00215 
00216 
00217 #ifdef __cplusplus
00218 }
00219 #endif
00220 
00221 
00222 
00223 
00224 #endif /* KDBPRIVATE_H */

Generated on Sun Feb 19 10:05:36 2006 for Elektra Project by  doxygen 1.3.9.1