2016-07-11 12:23:41 +00:00
|
|
|
#include <stdint.h>
|
2016-07-13 13:52:39 +00:00
|
|
|
#include <sys/types.h>
|
2016-07-11 12:23:41 +00:00
|
|
|
|
|
|
|
struct message;
|
|
|
|
|
2016-07-13 13:52:39 +00:00
|
|
|
// blaze822.c
|
|
|
|
|
|
|
|
struct message *blaze822(char *file); // just header
|
2016-07-14 13:21:37 +00:00
|
|
|
struct message *blaze822_file(char *file); // header + body (read(2))
|
|
|
|
struct message *blaze822_mmap(char *file); // header + body (mmap(2))
|
2016-07-13 13:52:39 +00:00
|
|
|
struct message *blaze822_mem(char *buf, size_t len); // header + body
|
|
|
|
|
2016-07-11 12:23:41 +00:00
|
|
|
char *blaze822_hdr_(struct message *mesg, const char *hdr, size_t len);
|
|
|
|
#define blaze822_hdr(mesg, hdr) blaze822_hdr_(mesg, "\0" hdr ":", 2+strlen((hdr)))
|
2016-07-16 17:44:21 +00:00
|
|
|
char *blaze822_chdr(struct message *mesg, const char *chdr);
|
2016-07-11 12:23:41 +00:00
|
|
|
|
2016-07-14 13:40:48 +00:00
|
|
|
char *blaze822_next_header(struct message *mesg, char *prev);
|
|
|
|
|
2016-07-13 13:52:39 +00:00
|
|
|
void blaze822_free(struct message *mesg);
|
2016-07-11 14:28:22 +00:00
|
|
|
|
2016-07-11 12:23:41 +00:00
|
|
|
time_t blaze822_date(char *);
|
|
|
|
char *blaze822_addr(char *, char **, char **);
|
2016-07-13 13:52:39 +00:00
|
|
|
char *blaze822_body(struct message *mesg);
|
|
|
|
size_t blaze822_bodylen(struct message *mesg);
|
2016-07-16 20:18:29 +00:00
|
|
|
size_t blaze822_headerlen(struct message *mesg);
|
2016-07-13 13:52:39 +00:00
|
|
|
|
|
|
|
// rfc2047.c
|
2016-07-11 21:40:00 +00:00
|
|
|
|
|
|
|
int blaze822_decode_rfc2047(char *, char *, size_t, char *);
|
2016-07-13 13:52:39 +00:00
|
|
|
int blaze822_decode_qp(char *start, char *stop, char **deco, size_t *decleno);
|
|
|
|
int blaze822_decode_b64(char *start, char *stop, char **deco, size_t *decleno);
|
2016-07-11 21:40:00 +00:00
|
|
|
|
2016-07-13 13:53:27 +00:00
|
|
|
// rfc2045.c
|
|
|
|
|
|
|
|
int blaze822_check_mime(struct message *msg);
|
2016-07-13 19:56:16 +00:00
|
|
|
int blaze822_mime_body(struct message *msg, char **cto, char **bodyo, size_t *bodyleno, char **bodychunko);
|
2016-07-13 13:53:27 +00:00
|
|
|
int blaze822_multipart(struct message *msg, struct message **imsg);
|
2016-07-16 20:18:46 +00:00
|
|
|
int blaze822_mime_parameter(char *s, char *name, char **starto, char **stopo);
|
2016-07-17 19:51:41 +00:00
|
|
|
|
|
|
|
// seq.c
|
|
|
|
|
|
|
|
char *blaze822_seq_open(char *file);
|
|
|
|
int blaze822_seq_load(char *map);
|
|
|
|
long blaze822_seq_find(char *ref);
|
2016-07-17 22:09:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
char *blaze822_seq_cur();
|
|
|
|
int blaze822_seq_setcur(char *s);
|
|
|
|
|
|
|
|
struct blaze822_seq_iter {
|
|
|
|
long lines;
|
|
|
|
long cur;
|
|
|
|
long start;
|
|
|
|
long stop;
|
|
|
|
|
|
|
|
long line;
|
|
|
|
char *s;
|
|
|
|
};
|
|
|
|
|
|
|
|
char *blaze822_seq_next(char *map, char *range, struct blaze822_seq_iter *iter);
|
|
|
|
int blaze822_loop(int, char **, void (*)(char *));
|
2016-07-20 12:07:46 +00:00
|
|
|
char *blaze822_home_file(char *basename);
|