From: Wilfried Göesgens Date: Sun, 20 Jan 2008 15:05:22 +0000 (+0000) Subject: * add skelleton hash lib. X-Git-Tag: v7.86~2570 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=7c13489da931f2106777134aa35c9946a03b4732 * add skelleton hash lib. --- diff --git a/libcitadel/Makefile.in b/libcitadel/Makefile.in index 4c619e3b6..710d4f3bb 100755 --- a/libcitadel/Makefile.in +++ b/libcitadel/Makefile.in @@ -101,7 +101,7 @@ LINK_LIB = $(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) -no-undefined $(VSNFLAG) LINK_EXE = $(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) $(LDFLAGS) -o $@ LINK_CXX_EXE = $(LIBTOOL) $(LTFLAGS) --mode=link $(CXXCOMPILE) $(LDFLAGS) -o $@ -LIB_OBJS = lib/libcitadel.lo lib/mime_parser.lo lib/tools.lo lib/vcard.lo +LIB_OBJS = lib/libcitadel.lo lib/mime_parser.lo lib/tools.lo lib/vcard.lo lib/hash.lo $(LIBRARY): $(LIB_OBJS) $(LINK_LIB) $(LIB_OBJS) @@ -109,6 +109,8 @@ lib/libcitadel.lo: lib/libcitadel.c lib/libcitadel.h lib/mime_parser.lo: lib/mime_parser.c lib/libcitadel.h lib/tools.lo: lib/tools.c lib/libcitadel.h lib/vcard.lo: lib/vcard.c lib/libcitadel.h +lib/hash.lo: lib/hash +.c lib/libcitadel.h .SUFFIXES: .c .cpp .lo .o diff --git a/libcitadel/lib/hash.c b/libcitadel/lib/hash.c new file mode 100644 index 000000000..f61f136f7 --- /dev/null +++ b/libcitadel/lib/hash.c @@ -0,0 +1,37 @@ +#include "hash.h" + + +typedef struct HashList { + void *Members; + long nMembersUsed; + long MemberSize; + +}; + +typedef struct Payload { + void *Data; + char *HashKey; + DeleteHashDataFunc Destructor; +}; + +typedef struct HashKey { + long Key; + long Position; +}; + + +int GetHash(HashList *Hash, char *HKey, void **Payload) +{ +} + +void Put(HashList *Hash, char *HKey, long HKLen, void *Payload, DeleteHashDataFunc DeleteIt) +{ +} + +int GetKey(HashList *Hash, char *HKey, long HKLen, void **Payload) +{ +} + +int GetHashKeys(HashList *Hash, char **List) +{ +} diff --git a/libcitadel/lib/hash.h b/libcitadel/lib/hash.h new file mode 100644 index 000000000..3e8be3d43 --- /dev/null +++ b/libcitadel/lib/hash.h @@ -0,0 +1,14 @@ + +typedef struct HashList HashList; + +typedef struct HashKey HashKey; + +typedef void (*DeleteHashDataFunc)(void * Data); + +int GetHash(HashList *Hash, char *HKey, void **Payload); + +void Put(HashList *Hash, char *HKey, long HKLen, void *Payload, DeleteHashDataFunc DeleteIt); + +int GetKey(HashList *Hash, char *HKey, long HKLen, void **Payload); + +int GetHashKeys(HashList *Hash, char **List);