Citadel Server and libcitadel version 922
[citadel.git] / libcitadel / lib / libcitadel.h
index eb02470013c866b80eeb5a9d57bf1cbfdb71799a..29f897d26e5c4b9d5b204fbc1131a7f9c7949995 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Header file for libcitadel
  *
- * Copyright (c) 1987-2016 by the citadel.org team
+ * Copyright (c) 1987-2018 by the citadel.org team
  *
  * This program is open source software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 3.
@@ -28,7 +28,7 @@
 #include <sys/types.h>
 #include <netinet/in.h>
 
-#define LIBCITADEL_VERSION_NUMBER      903
+#define LIBCITADEL_VERSION_NUMBER      922
 
 /*
  * Here's a bunch of stupid magic to make the MIME parser portable.
@@ -254,28 +254,6 @@ typedef struct _file_buffer {
        int nBlobBytesWanted;
 } IOBuffer;
 
-
-typedef struct __fd_iobuffer {
-       IOBuffer *IOB;
-       int OtherFD;
-       int SplicePipe[2];
-       int PipeSize;
-       long TotalSendSize;
-       loff_t TotalSentAlready;
-       loff_t TotalReadAlready;
-       long ChunkSize;
-       long ChunkSendRemain;
-       StrBuf *ChunkBuffer; /* just used if we don't have sendfile */
-} FDIOBuffer;
-
-
-void FDIOBufferInit(FDIOBuffer *FDB, IOBuffer *IO, int FD, long TotalSendSize);
-void FDIOBufferDelete(FDIOBuffer *FDB);
-int FileSendChunked(FDIOBuffer *FDB, const char **Err);
-int FileRecvChunked(FDIOBuffer *FDB, const char **Err);
-int FileMoveChunked(FDIOBuffer *FDB, const char **Err);
-eReadState WriteIOBAlreadyRead(FDIOBuffer *FDB, const char **Error);
-
 long StrBuf_read_one_chunk_callback (int fd, short event, IOBuffer *FB);
 int StrBuf_write_one_chunk_callback(int fd, short event, IOBuffer *FB);
 
@@ -353,6 +331,7 @@ int StrBufDestroyStreamContext(eStreamType type, vStreamT **Stream, const char *
 int StrBufStreamTranscode(eStreamType type, IOBuffer *Target, IOBuffer *In, const char* pIn, long pInLen, vStreamT *Stream, int LastChunk, const char **Err);
 
 int StrBufDecodeBase64(StrBuf *Buf);
+void StrBufDecodeQP(StrBuf *Buf);
 int StrBufDecodeBase64To(const StrBuf *BufIn, StrBuf *BufOut);
 int StrBufDecodeHex(StrBuf *Buf);
 StrBuf *StrBufRFC2047encodeMessage(const StrBuf *EncodeMe);
@@ -440,7 +419,6 @@ 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);
-void fmt_date(char *buf, size_t n, time_t thetime, int seconds);
 int is_msg_in_sequence_set(const char *mset, long msgnum);
 char *memreadline(char *start, char *buf, int maxlen);
 char *memreadlinelen(char *start, char *buf, int maxlen, int *retlen);
@@ -463,7 +441,7 @@ char *rfc2047encode(const char *line, long length);
 int is_msg_in_mset(const char *mset, long msgnum);
 int pattern2(char *search, char *patn);
 void stripltlen(char *, int *);
-char *html_to_ascii(const char *inputmsg, int msglen, int screenwidth, int do_citaformat);
+char *html_to_ascii(const char *inputmsg, int msglen, int screenwidth);
 void LoadEntityList(char *FileName);
 
 
@@ -613,7 +591,11 @@ JsonValue *NewJsonNumber(const char *Key, long keylen, long Number);
 
 JsonValue *NewJsonBigNumber(const char *Key, long keylen, double Number);
 
-JsonValue *NewJsonString(const char *Key, long keylen, StrBuf *CopyMe);
+enum {
+       NEWJSONSTRING_COPYBUF,          // make a copy of the StrBuf, source is left alone
+       NEWJSONSTRING_SMASHBUF          // smash the source StrBuf, the json object now owns that memory
+};
+JsonValue *NewJsonString(const char *Key, long keylen, StrBuf *CopyMe, int copy_or_smash);
 
 JsonValue *NewJsonPlainString(const char *Key, long keylen, const char *CopyMe, long len);
 
@@ -697,7 +679,6 @@ extern "C" {
 #define FILTERLIST     "application/x-citadel-filter-list"
 #define SIEVECONFIG    "application/x-citadel-sieve-config"
 #define XMPPMORTUARY   "application/x-citadel-xmpp-mortuary"
-#define INTERNETCFG     "application/x-citadel-internet-config"
 
 #define FILE_MAILALIAS       "__MAIL_ALIAS__"