10 struct mbox
*mbox_open(char *path
);
11 void mbox_free(struct mbox
*mbox
);
12 int mbox_save(struct mbox
*mbox
);
13 int mbox_copy(struct mbox
*mbox
, char *path
);
14 int mbox_len(struct mbox
*mbox
);
15 void mbox_get(struct mbox
*mbox
, int i
, char **msg
, long *msz
);
16 void mbox_set(struct mbox
*mbox
, int i
, char *msg
, long msz
);
17 int mbox_ith(char *path
, int n
, char **msg
, long *msz
);
19 char *msg_get(char *msg
, long msz
, char *hdr
);
20 int msg_set(char *msg
, long msglen
, char **mod
, long *modlen
, char *hdr
, char *val
);
21 char *msg_hdrdec(char *hdr
);
22 int msg_demime(char *msg
, long msglen
, char **mod
, long *modlen
);
24 int hdrlen(char *hdr
, long len
);
25 int startswith(char *r
, char *s
);
26 long xread(int fd
, void *buf
, long len
);
27 long xwrite(int fd
, void *buf
, long len
);
28 int xpipe(char *cmd
, char *ibuf
, long ilen
, char **obuf
, long *olen
);
30 struct sbuf
*sbuf_make(void);
31 char *sbuf_buf(struct sbuf
*sb
);
32 char *sbuf_done(struct sbuf
*sb
);
33 void sbuf_chr(struct sbuf
*sbuf
, int c
);
34 void sbuf_mem(struct sbuf
*sbuf
, char *s
, int len
);
35 void sbuf_str(struct sbuf
*sbuf
, char *s
);
36 int sbuf_len(struct sbuf
*sbuf
);
37 void sbuf_printf(struct sbuf
*sbuf
, char *s
, ...);
38 void sbuf_free(struct sbuf
*sb
);