const!
[citadel.git] / citadel / msgbase.h
index aecdb18f6c9525dce5ea8578f464b39ff152006b..4b53032eb75157e727d2b9bfcdcef85c9246f23b 100644 (file)
@@ -96,7 +96,7 @@ void flood_protect_quickie_message(const char *from,
                                   const char *subject,
                                   int nCriterions,
                                   const char **CritStr,
-                                  long *CritStrLen,
+                                  const long *CritStrLen,
                                   long ccid,
                                   long ioid,
                                   time_t NOW);
@@ -116,7 +116,7 @@ int CtdlForEachMessage(int mode,
                        struct CtdlMessage *compare,
                         ForEachMsgCallback CallBack,
                        void *userdata);
-int CtdlDeleteMessages(char *, long *, int, char *);
+int CtdlDeleteMessages(const char *, long *, int, char *);
 void CtdlWriteObject(char *req_room,                   /* Room to stuff it in */
                        char *content_type,             /* MIME type of this object */
                        char *raw_message,              /* Data to be written */
@@ -126,7 +126,7 @@ void CtdlWriteObject(char *req_room,                        /* Room to stuff it in */
                        int is_unique,                  /* Del others of this type? */
                        unsigned int flags              /* Internal save flags */
 );
-struct CtdlMessage *CtdlFetchMessage(long msgnum, int with_body);
+struct CtdlMessage *CtdlFetchMessage(long msgnum, int with_body, int run_msg_hooks);
 struct CtdlMessage * CM_Duplicate
                        (struct CtdlMessage *OrgMsg);
 int  CM_IsEmpty        (struct CtdlMessage *Msg, eMsgField which);
@@ -150,10 +150,12 @@ int  CM_IsValidMsg     (struct CtdlMessage *msg);
                Message->cm_fields[Which] + Message->cm_lengths[Which]
 
 void CtdlSerializeMessage(struct ser_ret *, struct CtdlMessage *);
+struct CtdlMessage *CtdlDeserializeMessage(long msgnum, int with_body, const char *Buffer, long Length);
 void ReplicationChecks(struct CtdlMessage *);
 int CtdlSaveMsgPointersInRoom(char *roomname, long newmsgidlist[], int num_newmsgs,
-                       int do_repl_check, struct CtdlMessage *supplied_msg, int suppress_refcount_adj);
+                             int do_repl_check, struct CtdlMessage *supplied_msg, int suppress_refcount_adj);
 int CtdlSaveMsgPointerInRoom(char *roomname, long msgid, int do_repl_check, struct CtdlMessage *msg);
+long CtdlSaveThisMessage(struct CtdlMessage *msg, long msgid, int Reply);
 char *CtdlReadMessageBody(char *terminator, long tlen, size_t maxlen, StrBuf *exist, int crlf, int *sock);
 StrBuf *CtdlReadMessageBodyBuf(char *terminator,       /* token signalling EOT */
                               long tlen,
@@ -165,14 +167,15 @@ StrBuf *CtdlReadMessageBodyBuf(char *terminator,  /* token signalling EOT */
        );
 
 int CtdlOutputMsg(long msg_num,                /* message number (local) to fetch */
-                 int mode,             /* how would you like that message? */
-                 int headers_only,     /* eschew the message body? */
-                 int do_proto,         /* do Citadel protocol responses? */
-                 int crlf,             /* 0=LF, 1=CRLF */
-                 char *section,                /* output a message/rfc822 section */
-                 int flags,            /* should the bessage be exported clean? */
-                 char **Author,        /* if you want to know the author of the message... */
-                 char **Address        /* if you want to know the sender address of the message... */
+               int mode,               /* how would you like that message? */
+               int headers_only,       /* eschew the message body? */
+               int do_proto,           /* do Citadel protocol responses? */
+               int crlf,               /* 0=LF, 1=CRLF */
+               char *section,          /* output a message/rfc822 section */
+               int flags,              /* should the bessage be exported clean? */
+               char **Author,          /* if you want to know the author of the message... */
+               char **Address,         /* if you want to know the sender address of the message... */
+               char **MessageID        /* if you want to know the Message-ID of the message... */
 );
 
 /* Flags which may be passed to CtdlOutputMsg() and CtdlOutputPreLoadedMsg() */
@@ -264,12 +267,12 @@ extern int MessageDebugEnabled;
 #define CCCID CCC->cs_pid
 #define MSG_syslog(LEVEL, FORMAT, ...)                 \
        MSGDBGLOG(LEVEL) syslog(LEVEL,                  \
-                               "CC[%d]MSG" FORMAT,     \
+                               "CC[%d]MSG " FORMAT,    \
                                CCCID, __VA_ARGS__)
 
 #define MSGM_syslog(LEVEL, FORMAT)                     \
        MSGDBGLOG(LEVEL) syslog(LEVEL,                  \
-                               "CC[%d]MSG" FORMAT,     \
+                               "CC[%d]MSG " FORMAT,    \
                                CCCID)