* add wrapper to destruct nested hashes
authorWilfried Göesgens <willi@citadel.org>
Mon, 8 Sep 2008 21:02:49 +0000 (21:02 +0000)
committerWilfried Göesgens <willi@citadel.org>
Mon, 8 Sep 2008 21:02:49 +0000 (21:02 +0000)
libcitadel/debian/files
libcitadel/lib/hash.c
libcitadel/lib/libcitadel.h

index d2ac0561c0b0a03d7eab551e7db9c29484f59207..73fc3064e0412a561172b5a5c47e4c6ec0596e3b 100644 (file)
@@ -1,3 +1,3 @@
-libcitadel1_7.38-8_i386.deb libs optional
-libcitadel1-dbg_7.38-8_i386.deb libdevel optional
-libcitadel-dev_7.38-8_i386.deb libdevel optional
+libcitadel1_7.38-8_amd64.deb libs optional
+libcitadel1-dbg_7.38-8_amd64.deb libdevel optional
+libcitadel-dev_7.38-8_amd64.deb libdevel optional
index 9ab2aa6e3db5440ef412c170dbb12c676edc46a7..d6c5b474535f18e841bbdabfbb12786d04da2314 100644 (file)
@@ -195,6 +195,15 @@ static void DeleteHashPayload (Payload *Data)
                free(Data->Data);
 }
 
+/**
+ * \brief Destructor for nested hashes
+ */
+void HDeleteHash(void *vHash)
+{
+       HashList *FreeMe = (HashList*)vHash;
+       DeleteHash(&FreeMe);
+}
+
 /**
  * \brief destroy a hashlist and all of its members
  * Crashing? do 'print *FreeMe->LookupTable[i]'
index 1fb7c481050649d7d568fbfc9c631d959580f306..eef88e808f09af4a7f78d8c324edc4de75d2dd88 100644 (file)
@@ -358,6 +358,7 @@ typedef void (*PrintHashDataFunc) (const char *Key, void *Item, int Odd);
 
 HashList *NewHash(int Uniq, HashFunc F);
 void DeleteHash(HashList **Hash);
+void HDeleteHash(void *vHash);
 int GetHash(HashList *Hash, const char *HKey, long HKLen, void **Data);
 void Put(HashList *Hash, const char *HKey, long HKLen, void *Data, DeleteHashDataFunc DeleteIt);
 int GetKey(HashList *Hash, char *HKey, long HKLen, void **Data);