- Add new function for demo printing hashes
authorWilfried Goesgens <willi@arangodb.com>
Sun, 18 Oct 2015 18:14:47 +0000 (20:14 +0200)
committerWilfried Goesgens <willi@arangodb.com>
Sun, 18 Oct 2015 18:14:47 +0000 (20:14 +0200)
 - make vcard param const.

libcitadel/lib/hash.c
libcitadel/lib/libcitadel.h
libcitadel/lib/vcard.c

index ab7eec1896206b12797b442b4952114414c64285..c1e8d4d422bc16b81295b2802257d9f29a8b45d2 100644 (file)
@@ -162,6 +162,10 @@ int PrintHash(HashList *Hash, TransitionFunc Trans, PrintHashDataFunc PrintEntry
        return i;
 }
 
+const char *dbg_PrintStrBufPayload(const char *Key, void *Item, int Odd)
+{
+       return ChrPtr((StrBuf*)Item);
+}
 
 /**
  * @ingroup HashListDebug
index 31c8394a5d043670d19697ba9b8aec91a956644a..d8f246da43f9214dadb9b6a77de5bb7c6463bc6c 100644 (file)
@@ -483,7 +483,7 @@ struct vCard {
 
 
 struct vCard *vcard_new(void);
-void vcard_add_prop(struct vCard *v, char *propname, char *propvalue);
+void vcard_add_prop(struct vCard *v, const char *propname, const char *propvalue);
 struct vCard *vcard_load(char *vtext);
 struct vCard *VCardLoad(StrBuf *vbtext);
 
@@ -512,7 +512,7 @@ typedef const char *(*PrintHashContent)(void * Data);
 typedef int (*CompareFunc)(const void* Item1, const void*Item2);
 typedef long (*HashFunc)(const char *Str, long Len);
 typedef void (*TransitionFunc) (void *Item1, void *Item2, int Odd);
-typedef void (*PrintHashDataFunc) (const char *Key, void *Item, int Odd);
+typedef const char* (*PrintHashDataFunc) (const char *Key, void *Item, int Odd);
 
 long Flathash(const char *str, long len);
 long lFlathash(const char *str, long len);
@@ -529,6 +529,7 @@ 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);
 int GetHashKeys(HashList *Hash, char ***List);
+const char *dbg_PrintStrBufPayload(const char *Key, void *Item, int Odd);
 int dbg_PrintHash(HashList *Hash, PrintHashContent first, PrintHashContent Second);
 int PrintHash(HashList *Hash, TransitionFunc Trans, PrintHashDataFunc PrintEntry);
 HashPos *GetNewHashPos(const HashList *Hash, int StepWidth);
index 3264774d7405ac6274f0896ed1ff7635d792290b..f12a4efb599642dd7a2931de9e0c58fce25869fb 100644 (file)
@@ -93,7 +93,7 @@ void remove_charset_attribute(char *strbuf)
  * propname    name of new property
  * propvalue   value of new property
  */
-void vcard_add_prop(struct vCard *v, char *propname, char *propvalue) {
+void vcard_add_prop(struct vCard *v, const char *propname, const char *propvalue) {
        ++v->numprops;
        v->prop = realloc(v->prop,
                (v->numprops * sizeof(struct vCardProp)) );