]> code.citadel.org Git - citadel.git/blobdiff - libcitadel/lib/libcitadel.h
* add wrapper to destruct nested hashes
[citadel.git] / libcitadel / lib / libcitadel.h
index 81415177d61e155687d062060f8329e5d1d4b7a0..eef88e808f09af4a7f78d8c324edc4de75d2dd88 100644 (file)
@@ -214,6 +214,7 @@ int FlushStrBuf(StrBuf *buf);
 
 inline const char *ChrPtr(const StrBuf *Str);
 inline int StrLength(const StrBuf *Str);
+long StrBufPeek(StrBuf *Buf, const char* ptr, long nThChar, char PeekValue);
 
 int StrBufTCP_read_line(StrBuf *buf, int *fd, int append, const char **Error);
 int StrBufReadBLOB(StrBuf *Buf, int *fd, int append, long nBytes, const char **Error);
@@ -227,6 +228,7 @@ inline int StrBufNum_tokens(const StrBuf *source, char tok);
 
 void StrBufAppendBufPlain(StrBuf *Buf, const char *AppendBuf, long AppendSize, size_t Offset);
 void StrBufAppendBuf(StrBuf *Buf, const StrBuf *AppendBuf, size_t Offset);
+void StrBufAppendPrintf(StrBuf *Buf, const char *format, ...);
 #ifdef SHOW_ME_VAPPEND_PRINTF
 /* so owe don't create an include depndency, this is just visible on demand. */
 void StrBufVAppendPrintf(StrBuf *Buf, const char *format, va_list ap);
@@ -242,6 +244,12 @@ void StrBufReplaceChars(StrBuf *buf, char search, char replace);
 int CompressBuffer(StrBuf *Buf);
 int StrBufDecodeBase64(StrBuf *Buf);
 int StrBufRFC2047encode(StrBuf **target, const StrBuf *source);
+#define LB                     (1)             /* Internal escape chars */
+#define RB                     (2)
+#define QU                     (3)
+void StrBufUrlescAppend(StrBuf *OutBuf, const StrBuf *In, const char *PlainIn);
+long StrEscAppend(StrBuf *Target, const StrBuf *Source, const char *PlainIn, int nbsp, int nolinebreaks);
+void StrMsgEscAppend(StrBuf *Target, StrBuf *Source, const char *PlainIn);
 
 long StrTol(const StrBuf *Buf);
 int StrToi(const StrBuf *Buf);
@@ -350,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);
@@ -358,7 +367,7 @@ int dbg_PrintHash(HashList *Hash, PrintHashContent first, PrintHashContent Secon
 int PrintHash(HashList *Hash, TransitionFunc Trans, PrintHashDataFunc PrintEntry);
 HashPos *GetNewHashPos(void);
 void DeleteHashPos(HashPos **DelMe);
-int GetNextHashPos(HashList *Hash, HashPos *At, long *HKLen, char **HashKey, void **Data);
+int GetNextHashPos(HashList *Hash, HashPos *At, long *HKLen, const char **HashKey, void **Data);
 void SortByHashKey(HashList *Hash, int Order);
 void SortByHashKeyStr(HashList *Hash);
 int GetCount(HashList *Hash);