regex: updates from neatvi
[neatmail.git] / mail.h
blob501f48be99616bceb8b216f7ecaf0158ad7a8884
1 /* neatmail header */
3 int ex(char *argv[]);
4 int mk(char *argv[]);
5 int pg(char *argv[]);
6 int pn(char *argv[]);
7 int me(char *argv[]);
9 struct mbox;
11 struct mbox *mbox_open(char **path);
12 void mbox_free(struct mbox *mbox);
13 int mbox_save(struct mbox *mbox);
14 int mbox_copy(struct mbox *mbox, char *path);
15 int mbox_len(struct mbox *mbox);
16 int mbox_get(struct mbox *mbox, int i, char **msg, long *msz);
17 int mbox_set(struct mbox *mbox, int i, char *msg, long msz);
18 int mbox_pos(struct mbox *mbox, int n, int *idx);
19 int mbox_ith(char *path, int n, char **msg, long *msz);
20 int mbox_off(char *path, long beg, long end, char **msg, long *msz);
22 char *msg_get(char *msg, long msz, char *hdr);
23 int msg_set(char *msg, long msglen, char **mod, long *modlen, char *hdr, char *val);
24 char *msg_hdrdec(char *hdr);
25 int msg_demime(char *msg, long msglen, char **mod, long *modlen);
26 char *base64(char *s, int len);
28 int hdrlen(char *hdr, long len);
29 int startswith(char *r, char *s);
30 long xread(int fd, void *buf, long len);
31 long xwrite(int fd, void *buf, long len);
32 int xpipe(char *cmd, char *ibuf, long ilen, char **obuf, long *olen);
34 struct sbuf *sbuf_make(void);
35 char *sbuf_buf(struct sbuf *sb);
36 char *sbuf_done(struct sbuf *sb);
37 void sbuf_chr(struct sbuf *sbuf, int c);
38 void sbuf_mem(struct sbuf *sbuf, char *s, int len);
39 void sbuf_str(struct sbuf *sbuf, char *s);
40 int sbuf_len(struct sbuf *sbuf);
41 void sbuf_printf(struct sbuf *sbuf, char *s, ...);
42 void sbuf_free(struct sbuf *sb);