X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=libcitadel%2Flib%2Flibcitadel.h;h=66dba61e220d00f0ec7a256154cec18788c4269f;hb=9c730b7051a96ed62fe0e0dd6c7eb650754988bd;hp=0855af01e7d7cc061a0eda551e0bb1b0ad55f9b7;hpb=cf0c30c3922871d4febc6f29669c2e61d41a2cfb;p=citadel.git diff --git a/libcitadel/lib/libcitadel.h b/libcitadel/lib/libcitadel.h index 0855af01e..66dba61e2 100644 --- a/libcitadel/lib/libcitadel.h +++ b/libcitadel/lib/libcitadel.h @@ -204,6 +204,7 @@ typedef struct StrBuf StrBuf; StrBuf* NewStrBuf(void); StrBuf* NewStrBufPlain(const char* ptr, int nChars); +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); @@ -213,7 +214,8 @@ int FlushStrBuf(StrBuf *buf); inline const char *ChrPtr(StrBuf *Str); inline int StrLength(StrBuf *Str); -int StrBufTCP_read_line(StrBuf *buf, int fd, int append, const char **Error); +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); 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); @@ -222,16 +224,23 @@ long StrBufExtract_long(const StrBuf* Source, int parmnum, char separator); int StrBufExtract_int(const StrBuf* Source, int parmnum, char separator); 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, StrBuf *AppendBuf, size_t Offset); +#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); +#endif 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 StrBufEUid_unescapize(StrBuf *target, StrBuf *source); void StrBufEUid_escapize(StrBuf *target, StrBuf *source); +int CompressBuffer(StrBuf *Buf); + long StrTol(StrBuf *Buf); -const char *GuessMimeType(char *data, size_t dlen); +const char *GuessMimeType(const char *data, size_t dlen); const char* GuessMimeByFilename(const char *what, size_t len); /* Run once at Programstart */