9e55685b51031b461beec109c83b5a06450ead25
[citadel.git] / citadel / msgbase.h
1 /* $Id$ */
2
3 #define aide_message(text)      quickie_message("Citadel",NULL,AIDEROOM,text)
4
5 #define MSGS_ALL        0
6 #define MSGS_OLD        1
7 #define MSGS_NEW        2
8 #define MSGS_FIRST      3
9 #define MSGS_LAST       4
10 #define MSGS_GT         5
11
12 /*
13  * Flags which may be passed to CtdlSaveMsgPointerInRoom()
14  */
15 #define SM_VERIFY_GOODNESS      1       /* Verify this is a real msg number */
16 #define SM_DO_REPL_CHECK        2       /* Perform replication checks */
17
18
19 /*
20  * Possible return codes from CtdlOutputMsg()
21  */
22 enum {
23         om_ok,
24         om_not_logged_in,
25         om_no_such_msg,
26         om_mime_error
27 };
28         
29
30
31 struct ma_info {
32         char prefix[256];       /* Prefix for a multipart/alternative */
33         int is_ma;              /* Set to 1 if we are using this stuff */
34         int did_print;          /* One alternative has been displayed */
35 };
36
37
38 struct repl {                   /* Info for replication checking */
39         char extended_id[256];
40         time_t highest;
41 };
42
43
44 int alias (char *name);
45 void get_mm (void);
46 void cmd_msgs (char *cmdbuf);
47 void help_subst (char *strbuf, char *source, char *dest);
48 void do_help_subst (char *buffer);
49 void memfmout (int width, char *mptr, char subst);
50 void output_mime_parts(char *);
51 void cmd_msg0 (char *cmdbuf);
52 void cmd_msg2 (char *cmdbuf);
53 void cmd_msg3 (char *cmdbuf);
54 void cmd_msg4 (char *cmdbuf);
55 void cmd_opna (char *cmdbuf);
56 long send_message (struct CtdlMessage *, int, FILE *);
57 void loadtroom (void);
58 long CtdlSaveMsg(struct CtdlMessage *, char *, char *, int, int);
59 void quickie_message (char *, char *, char *, char *);
60 struct CtdlMessage *make_message (struct usersupp *, char *,
61                    char *, int, int, int, char *);
62 void cmd_ent0 (char *entargs);
63 void cmd_ent3 (char *entargs);
64 void cmd_dele (char *delstr);
65 void cmd_move (char *args);
66 void GetSuppMsgInfo(struct SuppMsgInfo *, long);
67 void PutSuppMsgInfo(struct SuppMsgInfo *);
68 void AdjRefCount(long, int);
69 void simple_listing(long);
70 int CtdlMsgCmp(struct CtdlMessage *msg, struct CtdlMessage *template);
71 void CtdlForEachMessage(int mode, long ref,
72                         char *content_type,
73                         struct CtdlMessage *compare,
74                         void (*CallBack) (long msgnum) );
75 int CtdlDeleteMessages(char *, long, char *);
76 void CtdlWriteObject(char *, char *, char *, struct usersupp *,
77                         int, int, unsigned int);
78 struct CtdlMessage *CtdlFetchMessage(long msgnum);
79 void CtdlFreeMessage(struct CtdlMessage *msg);
80 void serialize_message(struct ser_ret *, struct CtdlMessage *);
81 int is_valid_message(struct CtdlMessage *);
82 int ReplicationChecks(struct CtdlMessage *);
83 int CtdlSaveMsgPointerInRoom(char *roomname, long msgid, int flags);
84 char *CtdlReadMessageBody(char *terminator, size_t maxlen, char *exist);
85 char *CtdlGetSysConfig(char *sysconfname);
86 void CtdlPutSysConfig(char *sysconfname, char *sysconfdata);
87 int CtdlOutputMsg(long msg_num,         /* message number (local) to fetch */
88                 int mode,               /* how would you like that message? */
89                 int headers_only,       /* eschew the message body? */
90                 int do_proto,           /* do Citadel protocol responses? */
91                 FILE *outfp,
92                 int outsock,
93                 int crlf);