]> code.citadel.org Git - citadel.git/blobdiff - libcitadel/lib/libcitadel.h
* fix hashlist iterator
[citadel.git] / libcitadel / lib / libcitadel.h
index 20e4a0a1ec72f20f38e020ff84b8c11614bdec63..cf628fe96c36ddc68ad38f38e2b491427a50f10a 100644 (file)
@@ -15,7 +15,7 @@
 #include <time.h>
 #include <stdlib.h>
 #include <stdarg.h>
-#define LIBCITADEL_VERSION_NUMBER      760
+#define LIBCITADEL_VERSION_NUMBER      766
 
 /*
  * Here's a bunch of stupid magic to make the MIME parser portable.
@@ -59,13 +59,17 @@ enum LogLevel {
 #define        VIEW_WIKI               6       /* Wiki view */
 #define VIEW_CALBRIEF          7       /* Brief Calendar view */
 #define VIEW_JOURNAL           8       /* Journal view */
-#define VIEW_DRAFTS            9       /* Drafts folder */
 
 
 #ifndef IsEmptyStr
 #define IsEmptyStr(a) ((a)[0] == '\0')
 #endif
 
+/*
+ * another word to indicate n/a for a pointer if NULL already has a "meaning"
+ */
+extern const char *StrBufNOTNULL;
+
 /*
  * Misc declarations
  */
@@ -230,6 +234,7 @@ int StrBufPlain(StrBuf *Buf, const char* ptr, int nChars);
 StrBuf* _NewConstStrBuf(const char* StringConstant, size_t SizeOfStrConstant);
 #define NewConstStrBuf(a) _NewConstStrBuf(a, sizeof(a))
 void FreeStrBuf (StrBuf **FreeMe);
+char *SmashStrBuf (StrBuf **SmashMe);
 void HFreeStrBuf (void *VFreeMe);
 int FlushStrBuf(StrBuf *buf);
 int FLUSHStrBuf(StrBuf *buf); /* expensive but doesn't leave content behind for others to find in case of errors */
@@ -275,6 +280,7 @@ int StrBufExtract_int(const StrBuf* Source, int parmnum, char separator);
 int StrBufNum_tokens(const StrBuf *source, char tok);
 int StrBufRemove_token(StrBuf *Source, int parmnum, char separator);
 
+int StrBufHaveNextToken(const StrBuf *Source, const char **pStart);
 int StrBufExtract_NextToken(StrBuf *dest, const StrBuf *Source, const char **pStart, char separator);
 int StrBufSkip_NTokenS(const StrBuf *Source, const char **pStart, char separator, int nTokens);
 unsigned long StrBufExtractNext_unsigned_long(const StrBuf* Source, const char **pStart, char separator);
@@ -284,6 +290,7 @@ int StrBufExtractNext_int(const StrBuf* Source, const char **pStart, char separa
 
 void StrBufAppendBufPlain(StrBuf *Buf, const char *AppendBuf, long AppendSize, unsigned long Offset);
 void StrBufAppendBuf(StrBuf *Buf, const StrBuf *AppendBuf, unsigned long Offset);
+size_t CurlFillStrBuf_callback(void *ptr, size_t size, size_t nmemb, void *stream);
 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. */
@@ -316,7 +323,8 @@ int StrBufSanitizeAscii(StrBuf *Buf, const char Mute);
 void StrBufUrlescAppend(StrBuf *OutBuf, const StrBuf *In, const char *PlainIn);
 long StrEscAppend(StrBuf *Target, const StrBuf *Source, const char *PlainIn, int nbsp, int nolinebreaks);
 long StrECMAEscAppend(StrBuf *Target, const StrBuf *Source, const char *PlainIn);
-void StrMsgEscAppend(StrBuf *Target, StrBuf *Source, const char *PlainIn);
+void StrMsgEscAppend(StrBuf *Target, const StrBuf *Source, const char *PlainIn);
+void StrIcalEscAppend(StrBuf *Target, const StrBuf *Source, const char *PlainIn);
 
 long StrTol(const StrBuf *Buf);
 int StrToi(const StrBuf *Buf);
@@ -426,7 +434,7 @@ 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)
+#define IKEY(a) (const char*) &a, sizeof(a)
 
 HashList *NewHash(int Uniq, HashFunc F);
 void DeleteHash(HashList **Hash);
@@ -438,7 +446,7 @@ 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(HashList *Hash, int StepWidth);
-int GetHashPosCounter(HashPos *At);
+int GetHashPosCounter(HashList *Hash, HashPos *At);
 void DeleteHashPos(HashPos **DelMe);
 int GetNextHashPos(HashList *Hash, HashPos *At, long *HKLen, const char **HashKey, void **Data);
 int GetHashAt(HashList *Hash,long At, long *HKLen, const char **HashKey, void **Data);