* Began implementing some code to handle multiple recipients (but #define'd
[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 #define MSGS_EQ         6
12
13 /*
14  * Flags which may be passed to CtdlSaveMsgPointerInRoom()
15  */
16 #define SM_VERIFY_GOODNESS      1       /* Verify this is a real msg number */
17 #define SM_DO_REPL_CHECK        2       /* Perform replication checks */
18 #define SM_DONT_BUMP_REF        4       /* Don't bump reference count
19                                            (use with extreme care!!!!!!) */
20
21
22 /*
23  * Possible return codes from CtdlOutputMsg()
24  */
25 enum {
26         om_ok,
27         om_not_logged_in,
28         om_no_such_msg,
29         om_mime_error
30 };
31         
32
33
34 struct ma_info {
35         int is_ma;              /* Set to 1 if we are using this stuff */
36         int did_print;          /* One alternative has been displayed */
37 };
38
39
40 struct repl {                   /* Info for replication checking */
41         char extended_id[SIZ];
42         time_t highest;
43 };
44
45
46 /* Data structure returned by validate_recipients() */
47 struct recptypes {
48         int num_local;
49         int num_internet;
50         int num_ignet;
51         int num_error;
52         char errormsg[SIZ];
53 };
54
55
56
57 int alias (char *name);
58 void get_mm (void);
59 void cmd_msgs (char *cmdbuf);
60 void help_subst (char *strbuf, char *source, char *dest);
61 void do_help_subst (char *buffer);
62 void memfmout (int width, char *mptr, char subst, char *nl);
63 void output_mime_parts(char *);
64 void cmd_msg0 (char *cmdbuf);
65 void cmd_msg2 (char *cmdbuf);
66 void cmd_msg3 (char *cmdbuf);
67 void cmd_msg4 (char *cmdbuf);
68 void cmd_opna (char *cmdbuf);
69 long send_message (struct CtdlMessage *, FILE *);
70 void loadtroom (void);
71 long CtdlSaveMsg(struct CtdlMessage *, char *, char *, int);
72 void quickie_message (char *, char *, char *, char *);
73 void cmd_ent0 (char *entargs);
74 void cmd_dele (char *delstr);
75 void cmd_move (char *args);
76 void GetMetaData(struct MetaData *, long);
77 void PutMetaData(struct MetaData *);
78 void AdjRefCount(long, int);
79 void simple_listing(long, void *);
80 int CtdlMsgCmp(struct CtdlMessage *msg, struct CtdlMessage *template);
81 int CtdlForEachMessage(int mode, long ref,
82                         int moderation_level,
83                         char *content_type,
84                         struct CtdlMessage *compare,
85                         void (*CallBack) (long, void *),
86                         void *userdata);
87 int CtdlDeleteMessages(char *, long, char *);
88 void CtdlWriteObject(char *, char *, char *, struct usersupp *,
89                         int, int, unsigned int);
90 struct CtdlMessage *CtdlFetchMessage(long msgnum);
91 void CtdlFreeMessage(struct CtdlMessage *msg);
92 void serialize_message(struct ser_ret *, struct CtdlMessage *);
93 int is_valid_message(struct CtdlMessage *);
94 int ReplicationChecks(struct CtdlMessage *);
95 int CtdlSaveMsgPointerInRoom(char *roomname, long msgid, int flags);
96 char *CtdlReadMessageBody(char *terminator, size_t maxlen, char *exist);
97 char *CtdlGetSysConfig(char *sysconfname);
98 void CtdlPutSysConfig(char *sysconfname, char *sysconfdata);
99 int CtdlOutputMsg(long msg_num,         /* message number (local) to fetch */
100                 int mode,               /* how would you like that message? */
101                 int headers_only,       /* eschew the message body? */
102                 int do_proto,           /* do Citadel protocol responses? */
103                 int crlf);
104 int CtdlOutputPreLoadedMsg(struct CtdlMessage *,
105                 long,
106                 int mode,               /* how would you like that message? */
107                 int headers_only,       /* eschew the message body? */
108                 int do_proto,           /* do Citadel protocol responses? */
109                 int crlf);
110 int CtdlCopyMsgToRoom(long msgnum, char *dest);
111 int CtdlDoIHavePermissionToDeleteMessagesFromThisRoom(void);
112 int CtdlDoIHavePermissionToPostInThisRoom(char *errmsgbuf);
113 void CtdlSetSeen(long target_msgnum, int target_setting);