ezmlmx 0.68
ezmlmx
Loading...
Searching...
No Matches
mime.h
Go to the documentation of this file.
1#ifndef MIME_H
2#define MIME_H
3
4#include "stralloc.h"
5
6extern void decode_qp(const char *,unsigned int,stralloc *);
7extern void decode_b64(const char *,unsigned int,stralloc *);
8extern void encode_qp(const char *,unsigned int,stralloc *);
9extern void encode_b64(const unsigned char *,unsigned int,stralloc *,int);
10extern void decode_hdr(const char *,unsigned int,stralloc *);
11extern void concat_hdr(char *,unsigned int,stralloc *);
12extern int unfold_hdr(char *,unsigned long,stralloc *,const char *,stralloc *,int);
13
14extern unsigned int author_name(char **,char *,unsigned int);
15
16/* Characters */
17#define ESC 0x1B
18#define SI 0x0F
19#define SO 0x0E
20/* iso-2022-jp back-to-ascii seq */
21#define TOASCII "\x1B(B"
22/* to JP. Last char [B|@] must be added */
23#define TOJP "\x1B$"
24
25/* iso-2022 SI sequence as string */
26#define TOSI "\x0F"
27/* SI \n SO */
28#define SI_LF_SO "\x0F\n\x0E"
29
30/* in these bit 0 determines the number of bytes (1 or 2) in ss2/ss3 codes */
31/* it is 2 for CN,1 for JP, and they are not used for KR bit 3 for iso-2022 */
32#define CS_2022_MASK 0x08
33#define CS_2022_JP 0x08
34#define CS_2022_KR 0xA0
35#define CS_NONE 0
36#define CS_BAD 0xffff
37
38#define CS_2022_CN 0x09
39/* Other Chinese ones. bit 7 set means MSB of 2-byte seq. No ss2/ss3 considered */
40#define CS_CN 0x10
41
42#define MIME_NONE 0
43#define MIME_APPLICATION_OCTETSTREAM 1
44#define MIME_MULTI 0x80
45#define MIME_MULTI_ALTERNATIVE 0x81
46#define MIME_MULTI_MIXED 0x82
47#define MIME_MULTI_DIGEST 0x83
48#define MIME_MULTI_SIGNED 0x84
49
50#define MIME_TEXT 0x40
51#define MIME_TEXT_PLAIN 0x41
52#define MIME_TEXT_HTML 0x42
53#define MIME_TEXT_ENRICHED 0x43
54#define MIME_TEXT_VCARD 0x44
55
56#define MIME_MESSAGE 0x20
57#define MIME_MESSAGE_RFC822 0x21
58
59#define CTENC_NONE 0
60#define CTENC_QP 1
61#define CTENC_BASE64 2
62
63/* this is a linked list of mime type info. */
64typedef struct {
65 int level;
66 unsigned int mimetype;
67 unsigned int ctenc;
68 unsigned int cs; /* charset flag - expand later */
69 void *previous;
70 void *next;
71 stralloc boundary;
72 stralloc charset;
73 stralloc ctype;
74} mime_info;
75
76#endif
unsigned int author_name(char **, char *, unsigned int)
Definition author.c:19
void decode_qp(const char *, unsigned int, stralloc *)
Definition decode_qp.c:35
void encode_b64(const unsigned char *, unsigned int, stralloc *, int)
Definition encode_b64.c:75
void encode_qp(const char *, unsigned int, stralloc *)
Definition encode_qp.c:21
void decode_b64(const char *, unsigned int, stralloc *)
Definition decode_b64.c:33
void decode_hdr(const char *, unsigned int, stralloc *)
Definition decode_hdr.c:24
int unfold_hdr(char *, unsigned long, stralloc *, const char *, stralloc *, int)
Definition unfold_hdr.c:160
void concat_hdr(char *, unsigned int, stralloc *)
Definition concat_hdr.c:25
stralloc charset
Definition mime.h:72
stralloc ctype
Definition mime.h:73
unsigned int mimetype
Definition mime.h:66
void * previous
Definition mime.h:69
unsigned int cs
Definition mime.h:68
void * next
Definition mime.h:70
unsigned int ctenc
Definition mime.h:67
int level
Definition mime.h:65
stralloc boundary
Definition mime.h:71