* Temporary hack to ig_tcp_server() to listen on an arbitrary port if the
[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 #define SM_DONT_BUMP_REF        3       /* Don't bump reference count
18                                            (use with extreme care!!!!!!) */
19
20
21 /*
22  * Possible return codes from CtdlOutputMsg()
23  */
24 enum {
25         om_ok,
26         om_not_logged_in,
27         om_no_such_msg,
28         om_mime_error
29 };
30         
31
32
33 struct ma_info {
34         char prefix[256];       /* Prefix for a multipart/alternative */
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[256];
42         time_t highest;
43 };
44
45
46 int alias (char *name);
47 void get_mm (void);
48 void cmd_msgs (char *cmdbuf);
49 void help_subst (char *strbuf, char *source, char *dest);
50 void do_help_subst (char *buffer);
51 void memfmout (int width, char *mptr, char subst);
52 void output_mime_parts(char *);
53 void cmd_msg0 (char *cmdbuf);
54 void cmd_msg2 (char *cmdbuf);
55 void cmd_msg3 (char *cmdbuf);
56 void cmd_msg4 (char *cmdbuf);
57 void cmd_opna (char *cmdbuf);
58 long send_message (struct CtdlMessage *, int, FILE *);
59 void loadtroom (void);
60 long CtdlSaveMsg(struct CtdlMessage *, char *, char *, int, int);
61 void quickie_message (char *, char *, char *, char *);
62 struct CtdlMessage *make_message (struct usersupp *, char *,
63                    char *, int, int, int, char *);
64 void cmd_ent0 (char *entargs);
65 void cmd_ent3 (char *entargs);
66 void cmd_dele (char *delstr);
67 void cmd_move (char *args);
68 void GetSuppMsgInfo(struct SuppMsgInfo *, long);
69 void PutSuppMsgInfo(struct SuppMsgInfo *);
70 void AdjRefCount(long, int);
71 void simple_listing(long);
72 int CtdlMsgCmp(struct CtdlMessage *msg, struct CtdlMessage *template);
73 void CtdlForEachMessage(int mode, long ref,
74                         char *content_type,
75                         struct CtdlMessage *compare,
76                         void (*CallBack) (long msgnum) );
77 int CtdlDeleteMessages(char *, long, char *);
78 void CtdlWriteObject(char *, char *, char *, struct usersupp *,
79                         int, int, unsigned int);
80 struct CtdlMessage *CtdlFetchMessage(long msgnum);
81 void CtdlFreeMessage(struct CtdlMessage *msg);
82 void serialize_message(struct ser_ret *, struct CtdlMessage *);
83 int is_valid_message(struct CtdlMessage *);
84 int ReplicationChecks(struct CtdlMessage *);
85 int CtdlSaveMsgPointerInRoom(char *roomname, long msgid, int flags);
86 char *CtdlReadMessageBody(char *terminator, size_t maxlen, char *exist);
87 char *CtdlGetSysConfig(char *sysconfname);
88 void CtdlPutSysConfig(char *sysconfname, char *sysconfdata);
89 int CtdlOutputMsg(long msg_num,         /* message number (local) to fetch */
90                 int mode,               /* how would you like that message? */
91                 int headers_only,       /* eschew the message body? */
92                 int do_proto,           /* do Citadel protocol responses? */
93                 FILE *outfp,
94                 int outsock,
95                 int crlf);