mailx: extract news cmd from inc
[mailx.git] / mbox.h
blob5f6c2377c2ea447ee964b70c28875a4c52856a2b
1 #define MAXMAILS (1 << 14)
2 #define MAXHDRS (1 << 6)
3 #define MAXPATHLEN (1 << 12)
5 #define STAT_NEW 0x01
6 #define STAT_OLD 0x02
7 #define STAT_READ 0x04
8 #define STAT_DEL 0x08
10 struct mail {
11 char *hdrs[MAXHDRS + 1];
12 int nhdrs;
13 char *head;
14 char *body;
15 char *stat_hdr;
16 int len;
17 int body_len;
18 unsigned orig_stat;
19 unsigned stat;
22 struct mbox {
23 struct mail mails[MAXMAILS];
24 char path[MAXPATHLEN];
25 int n;
26 char *mbox;
27 int len;
28 int size;
31 struct mbox *mbox_alloc(char *filename);
32 void mbox_free(struct mbox *mbox);
33 int mbox_inc(struct mbox *mbox);
34 int mbox_write(struct mbox *mbox);
36 int mail_head(struct mail *mail, char *dst, int len, char **hdrs, int n);
37 char *mail_hdr(struct mail *mail, char *hdr);
38 char *mail_read(struct mail *mail, char *s);
39 void mail_write(struct mail *mail, int fd);
40 int hdr_len(char *hdr);