+int CtdlDoIHavePermissionToReadMessagesInThisRoom(void);
+
+enum {
+ POST_LOGGED_IN,
+ POST_EXTERNAL,
+ CHECK_EXISTANCE,
+ POST_LMTP
+};
+
+int CtdlDoIHavePermissionToPostInThisRoom(char *errmsgbuf,
+ size_t n,
+ const char* RemoteIdentifier,
+ int PostPublic,
+ int is_reply
+);
+
+
+/* values for which_set */
+enum {
+ ctdlsetseen_seen,
+ ctdlsetseen_answered
+};
+void CtdlSetSeen(long *target_msgnums, int num_target_msgnums,
+ int target_setting, int which_set,
+ struct ctdluser *which_user, struct ctdlroom *which_room);
+void CtdlGetSeen(char *buf, int which_set);
+
+struct recptypes *validate_recipients(const char *recipients,
+ const char *RemoteIdentifier,
+ int Flags);
+
+void free_recipients(struct recptypes *);
+
+struct CtdlMessage *CtdlMakeMessage(
+ struct ctdluser *author, /* author's user structure */
+ char *recipient, /* NULL if it's not mail */
+ char *recp_cc, /* NULL if it's not mail */
+ char *room, /* room where it's going */
+ int type, /* see MES_ types in header file */
+ int format_type, /* variformat, plain text, MIME... */
+ char *fake_name, /* who we're masquerading as */
+ char *my_email, /* which of my email addresses to use (empty is ok) */
+ char *subject, /* Subject (optional) */
+ char *supplied_euid, /* ...or NULL if this is irrelevant */
+ char *preformatted_text, /* ...or NULL to read text from client */
+ char *references /* Thread references */
+);
+int CtdlCheckInternetMailPermission(struct ctdluser *who);
+int CtdlIsMe(char *addr, int addr_buf_len);
+
+/*
+ * Use of aide_message is deprecated.
+ * It has been replaced with CtdlAideMessage.
+ * All parameters remain the same.
+*/
+void aide_message(char *text, char *subject) __attribute__ ((deprecated));
+
+
+/*
+ * loading messages async via an FD:
+ * add IO->ReadMsg = NewAsyncMsg(...)
+ * and then call CtdlReadMessageBodyAsync() from your linreader handler.
+ */
+
+ReadAsyncMsg *NewAsyncMsg(const char *terminator, /* token signalling EOT */
+ long tlen,
+ size_t expectlen, /* if we expect a message, how long should it be? */
+ size_t maxlen, /* maximum message length */
+ char *exist, /* if non-null, append to it;
+ exist is ALWAYS freed */
+ long eLen, /* length of exist */
+ int crlf /* CRLF newlines instead of LF */
+ );
+
+eReadState CtdlReadMessageBodyAsync(AsyncIO *IO);
+void DeleteAsyncMsg(ReadAsyncMsg **Msg);
+
+extern int MessageDebugEnabled;
+
+#define MSGDBGLOG(LEVEL) if ((LEVEL != LOG_DEBUG) || (MessageDebugEnabled != 0))
+#define CCCID CCC->cs_pid
+#define MSG_syslog(LEVEL, FORMAT, ...) \
+ MSGDBGLOG(LEVEL) syslog(LEVEL, \
+ "CC[%d]" FORMAT, \
+ CCCID, __VA_ARGS__)
+
+#define MSGM_syslog(LEVEL, FORMAT) \
+ MSGDBGLOG(LEVEL) syslog(LEVEL, \
+ "CC[%d]" FORMAT, \
+ CCCID)
+
+
+
+#endif /* MSGBASE_H */