From 7c13489da931f2106777134aa35c9946a03b4732 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Wilfried=20G=C3=B6esgens?= Date: Sun, 20 Jan 2008 15:05:22 +0000 Subject: [PATCH] * add skelleton hash lib. --- libcitadel/Makefile.in | 4 +++- libcitadel/lib/hash.c | 37 +++++++++++++++++++++++++++++++++++++ libcitadel/lib/hash.h | 14 ++++++++++++++ 3 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 libcitadel/lib/hash.c create mode 100644 libcitadel/lib/hash.h 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); -- 2.30.2