]> code.citadel.org Git - citadel.git/blobdiff - libcitadel/lib/libcitadel.h
* Allow hashiterator to do bigger steps than 1 and to go reverse
[citadel.git] / libcitadel / lib / libcitadel.h
index f47c3cc3b9c86d3a9a81b646c2d316ff79b3f8d2..cff82af47d738c3d2a60061781a1f4369f3de898 100644 (file)
@@ -212,6 +212,12 @@ void the_mime_parser(char *partnum,
 
 typedef struct StrBuf StrBuf;
 
+typedef struct _ConstStr {
+       const char *Key;
+       long len;
+}ConstStr;
+
+
 StrBuf* NewStrBuf(void);
 StrBuf* NewStrBufDup(const StrBuf *CopyMe);
 StrBuf* NewStrBufPlain(const char* ptr, int nChars);
@@ -236,6 +242,7 @@ int StrBufTCP_read_buffered_line(StrBuf *Line,
                                 int selectresolution, 
                                 const char **Error);
 
+int StrBufSipLine(StrBuf *LineBuf, StrBuf *Buf, const char **Ptr);
 int StrBufExtract_token(StrBuf *dest, const StrBuf *Source, int parmnum, char separator);
 int StrBufSub(StrBuf *dest, const StrBuf *Source, size_t Offset, size_t nChars);
 unsigned long StrBufExtract_unsigned_long(const StrBuf* Source, int parmnum, char separator);
@@ -254,14 +261,19 @@ void StrBufVAppendPrintf(StrBuf *Buf, const char *format, va_list ap);
 void StrBufPrintf(StrBuf *Buf, const char *format, ...) __attribute__((__format__(__printf__,2,3)));
 void StrBufCutLeft(StrBuf *Buf, int nChars);
 void StrBufCutRight(StrBuf *Buf, int nChars);
+void StrBufCutAt(StrBuf *Buf, int AfternChars, const char *At);
+void StrBufTrim(StrBuf *Buf);
 void StrBufUpCase(StrBuf *Buf);
+void StrBufLowerCase(StrBuf *Buf);
 void StrBufEUid_unescapize(StrBuf *target, const StrBuf *source);
 void StrBufEUid_escapize(StrBuf *target, const StrBuf *source);
 
 void StrBufReplaceChars(StrBuf *buf, char search, char replace);
 
 int CompressBuffer(StrBuf *Buf);
-void StrBuf_RFC822_to_Utf8(StrBuf **Buf, const StrBuf* DefaultCharset);
+void StrBufConvert(StrBuf *ConvertBuf, StrBuf *TmpBuf, void *pic);
+void ctdl_iconv_open(const char *tocode, const char *fromcode, void *pic);
+void StrBuf_RFC822_to_Utf8(StrBuf *Target, const StrBuf *DecodeMe, const StrBuf* DefaultCharset, StrBuf *FoundCharset);
 int StrBufDecodeBase64(StrBuf *Buf);
 int StrBufRFC2047encode(StrBuf **target, const StrBuf *source);
 #define LB                     (1)             /* Internal escape chars */
@@ -273,6 +285,8 @@ void StrMsgEscAppend(StrBuf *Target, StrBuf *Source, const char *PlainIn);
 
 long StrTol(const StrBuf *Buf);
 int StrToi(const StrBuf *Buf);
+long StrBuf_Utf8StrLen(StrBuf *Buf);
+long StrBuf_Utf8StrCut(StrBuf *Buf, int maxlen);
 
 const char *GuessMimeType(const char *data, size_t dlen);
 const char* GuessMimeByFilename(const char *what, size_t len);
@@ -376,6 +390,9 @@ typedef int (*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);
 
+int Flathash(const char *str, long len);
+#define IKEY(a) (const char*)(&((int)a)), sizeof(int)
+
 HashList *NewHash(int Uniq, HashFunc F);
 void DeleteHash(HashList **Hash);
 void HDeleteHash(void *vHash);
@@ -385,7 +402,8 @@ int GetKey(HashList *Hash, char *HKey, long HKLen, void **Data);
 int GetHashKeys(HashList *Hash, char ***List);
 int dbg_PrintHash(HashList *Hash, PrintHashContent first, PrintHashContent Second);
 int PrintHash(HashList *Hash, TransitionFunc Trans, PrintHashDataFunc PrintEntry);
-HashPos *GetNewHashPos(void);
+HashPos *GetNewHashPos(HashList *Hash, int StepWidth);
+int GetHashPosCounter(HashPos *At);
 void DeleteHashPos(HashPos **DelMe);
 int GetNextHashPos(HashList *Hash, HashPos *At, long *HKLen, const char **HashKey, void **Data);
 void SortByHashKey(HashList *Hash, int Order);
@@ -394,6 +412,7 @@ int GetCount(HashList *Hash);
 const void *GetSearchPayload(const void *HashVoid);
 void SortByPayload(HashList *Hash, CompareFunc SortBy);
 void generic_free_handler(void *ptr);
+void reference_free_handler(void *ptr);
 
 
 void convert_spaces_to_underscores(char *str);