* Completed the MSGP and MSG4 commands to set the client's preferred MIME
[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         char chosen_part[SIZ];  /* Which part of a m/a did we choose? */
38 };
39
40
41 struct repl {                   /* Info for replication checking */
42         char extended_id[SIZ];
43         time_t highest;
44 };
45
46
47 /* Data structure returned by validate_recipients() */
48 struct recptypes {
49         int num_local;
50         int num_internet;
51         int num_ignet;
52         int num_room;
53         int num_error;
54         char errormsg[SIZ];
55         char recp_local[SIZ];
56         char recp_internet[SIZ];
57         char recp_ignet[SIZ];
58         char recp_room[SIZ];
59         char display_recp[SIZ];
60 };
61
62
63
64 int alias (char *name);
65 void get_mm (void);
66 void cmd_msgs (char *cmdbuf);
67 void help_subst (char *strbuf, char *source, char *dest);
68 void do_help_subst (char *buffer);
69 void memfmout (int width, char *mptr, char subst, char *nl);
70 void output_mime_parts(char *);
71 void cmd_msg0 (char *cmdbuf);
72 void cmd_msg2 (char *cmdbuf);
73 void cmd_msg3 (char *cmdbuf);
74 void cmd_msg4 (char *cmdbuf);
75 void cmd_msgp (char *cmdbuf);
76 void cmd_opna (char *cmdbuf);
77 long send_message (struct CtdlMessage *, FILE *);
78 void loadtroom (void);
79 long CtdlSubmitMsg(struct CtdlMessage *, struct recptypes *, char *);
80 void quickie_message (char *, char *, char *, char *);
81 void cmd_ent0 (char *entargs);
82 void cmd_dele (char *delstr);
83 void cmd_move (char *args);
84 void GetMetaData(struct MetaData *, long);
85 void PutMetaData(struct MetaData *);
86 void AdjRefCount(long, int);
87 void simple_listing(long, void *);
88 int CtdlMsgCmp(struct CtdlMessage *msg, struct CtdlMessage *template);
89 int CtdlForEachMessage(int mode, long ref,
90                         char *content_type,
91                         struct CtdlMessage *compare,
92                         void (*CallBack) (long, void *),
93                         void *userdata);
94 int CtdlDeleteMessages(char *, long, char *);
95 void CtdlWriteObject(char *, char *, char *, struct usersupp *,
96                         int, int, unsigned int);
97 struct CtdlMessage *CtdlFetchMessage(long msgnum);
98 void CtdlFreeMessage(struct CtdlMessage *msg);
99 void serialize_message(struct ser_ret *, struct CtdlMessage *);
100 int is_valid_message(struct CtdlMessage *);
101 int ReplicationChecks(struct CtdlMessage *);
102 int CtdlSaveMsgPointerInRoom(char *roomname, long msgid, int flags);
103 char *CtdlReadMessageBody(char *terminator, size_t maxlen, char *exist);
104 char *CtdlGetSysConfig(char *sysconfname);
105 void CtdlPutSysConfig(char *sysconfname, char *sysconfdata);
106 int CtdlOutputMsg(long msg_num,         /* message number (local) to fetch */
107                 int mode,               /* how would you like that message? */
108                 int headers_only,       /* eschew the message body? */
109                 int do_proto,           /* do Citadel protocol responses? */
110                 int crlf);
111 int CtdlOutputPreLoadedMsg(struct CtdlMessage *,
112                 long,
113                 int mode,               /* how would you like that message? */
114                 int headers_only,       /* eschew the message body? */
115                 int do_proto,           /* do Citadel protocol responses? */
116                 int crlf);
117 int CtdlCopyMsgToRoom(long msgnum, char *dest);
118 int CtdlDoIHavePermissionToDeleteMessagesFromThisRoom(void);
119 int CtdlDoIHavePermissionToPostInThisRoom(char *errmsgbuf, size_t n);
120 void CtdlSetSeen(long target_msgnum, int target_setting);
121 struct recptypes *validate_recipients(char *recipients);
122 void CtdlGetSeen(char *buf);