X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=libcitadel%2Flib%2Flibcitadel.h;h=ab17da016b1561670a4bbc02a9f0221050269ba4;hb=d1ed6a1fd27a8308bb0a25a552651f1a3b3157db;hp=83bbddcf3ac9bab72d147d30e6abca16be6ec62c;hpb=de6dafd0aac285c563882de551187a6c4217478a;p=citadel.git diff --git a/libcitadel/lib/libcitadel.h b/libcitadel/lib/libcitadel.h index 83bbddcf3..ab17da016 100644 --- a/libcitadel/lib/libcitadel.h +++ b/libcitadel/lib/libcitadel.h @@ -15,7 +15,7 @@ #include #include #include -#define LIBCITADEL_VERSION_NUMBER 760 +#define LIBCITADEL_VERSION_NUMBER 763 /* * Here's a bunch of stupid magic to make the MIME parser portable. @@ -217,12 +217,13 @@ typedef struct _ConstStr { const char *Key; long len; }ConstStr; - +#define CKEY(a) (a).Key, (a).len StrBuf* NewStrBuf(void); StrBuf* NewStrBufDup(const StrBuf *CopyMe); StrBuf* NewStrBufPlain(const char* ptr, int nChars); long StrBufShrinkToFit(StrBuf *Buf, int Force); +void ReAdjustEmptyBuf(StrBuf *Buf, long ThreshHold, long NewSize); int StrBufPlain(StrBuf *Buf, const char* ptr, int nChars); StrBuf* _NewConstStrBuf(const char* StringConstant, size_t SizeOfStrConstant); @@ -282,6 +283,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. */ @@ -294,6 +296,7 @@ void StrBufCutAt(StrBuf *Buf, int AfternChars, const char *At); void StrBufTrim(StrBuf *Buf); void StrBufUpCase(StrBuf *Buf); void StrBufLowerCase(StrBuf *Buf); +void StrBufStripSlashes(StrBuf *Dir, int RemoveTrailingSlash); void StrBufEUid_unescapize(StrBuf *target, const StrBuf *source); void StrBufEUid_escapize(StrBuf *target, const StrBuf *source); @@ -313,7 +316,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); @@ -333,11 +337,6 @@ const char *GetIconFilename(char *MimeType, size_t len); /* tools */ -int Ctdl_IsUtf8SequenceStart(char Char); -int Ctdl_GetUtf8SequenceLength(char Char); -int Ctdl_Utf8StrLen(char *str); -char *Ctdl_Utf8StrCut(char *str, int maxlen); - int safestrncpy(char *dest, const char *src, size_t n); int num_tokens (const char *source, char tok); @@ -351,6 +350,7 @@ size_t CtdlEncodeBase64(char *dest, const char *source, size_t sourcelen, int li int CtdlDecodeBase64(char *dest, const char *source, size_t length); unsigned int decode_hex(char *Source); int CtdlDecodeQuotedPrintable(char *decoded, char *encoded, int sourcelen); +void StripSlashes(char *Dir, int TrailingSlash); size_t striplt(char *); int haschar(const char *st, int ch); void remove_token(char *source, int parmnum, char separator); @@ -427,7 +427,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);