ze-filter  (ze-filter-0.8.0-develop-180218)
ze-demime.h
Go to the documentation of this file.
1 /*
2  *
3  * ze-filter - Mail Server Filter for sendmail
4  *
5  * Copyright (c) 2001-2018 - Jose-Marcio Martins da Cruz
6  *
7  * Auteur : Jose Marcio Martins da Cruz
8  * jose.marcio.mc@gmail.org
9  *
10  * Historique :
11  * Creation : janvier 2002
12  *
13  * This program is free software, but with restricted license :
14  *
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19  *
20  * More details about ze-filter license can be found at ze-filter
21  * web site : http://foss.jose-marcio.org
22  */
23 
24 
25 #ifndef __ZE_DEMIME_H
26 
32 #define MIME_ERROR_UNUSED_BOUNDARY 0
33 
34 #define MIME_TYPE_TEXT (1 << 8)
35 #define MIME_TYPE_IMAGE (2 << 8)
36 #define MIME_TYPE_AUDIO (3 << 8)
37 #define MIME_TYPE_VIDEO (4 << 8)
38 #define MIME_TYPE_APPLICATION (5 << 8)
39 #define MIME_TYPE_EXTENSION_TOKEN (6 << 8)
40 #define MIME_TYPE_MESSAGE (7 << 8)
41 #define MIME_TYPE_MULTIPART (8 << 8)
42 
43 
44 #define MIME_ENCODE_NONE 0
45 #define MIME_ENCODE_7BIT 0
46 #define MIME_ENCODE_8BIT 2
47 #define MIME_ENCODE_BINARY 3
48 #define MIME_ENCODE_BASE64 4
49 #define MIME_ENCODE_QUOTED_PRINTABLE 5
50 #define MIME_ENCODE_OTHER 6
51 
53 
54 #define MIME_TYPE_LENGTH 64
55 #define CHARSET_LENGTH 64
56 
57 
58 
60 {
61  char *buf;
62  size_t size;
63  int level;
64  int encode;
65  char *mime;
66  int type;
67  char *name;
68  char *filename;
69  char *boundary;
70  char *charset;
73 
75 };
76 
77 typedef bool (*demime_F) (char *, size_t, char *, int, int, void *, mime_part_T *);
78 
79 
80 bool decode_mime_buffer(char *, char *, size_t, int,
81  uint32_t *,
82  demime_F ,
83  void *);
84 
85 bool decode_mime_file(char *, char *,
86  uint32_t *,
87  demime_F ,
88  void *);
89 
90 int which_mime_encoding(char *);
91 char *mime_encode_name(int);
92 
93 int which_mime_type(char *s);
94 char *mime_type_name(int);
95 
96 void set_mime_debug(bool);
97 
100 #define __ZE_DEMIME_H
101 #endif
char * mime_type_name(int)
Definition: ze-demime.c:686
int encode
Definition: ze-demime.h:64
char * buf
Definition: ze-demime.h:61
void set_mime_debug(bool)
Definition: ze-demime.c:69
size_t size
Definition: ze-demime.h:62
bool decode_mime_file(char *, char *, uint32_t *, demime_F, void *)
Definition: ze-demime.c:584
char * mime
Definition: ze-demime.h:65
Error dont have limits h nor values h typedef int bool
Definition: ze-sys.h:261
char * mime_encode_name(int)
Definition: ze-demime.c:642
char * filename
Definition: ze-demime.h:68
int nb_boundary
Definition: ze-demime.h:72
bool decode_mime_buffer(char *, char *, size_t, int, uint32_t *, demime_F, void *)
Definition: ze-demime.c:154
struct mime_part_T * mime_part_P
Definition: ze-demime.h:52
int nb_multipart
Definition: ze-demime.h:71
int which_mime_encoding(char *)
Definition: ze-demime.c:619
char * name
Definition: ze-demime.h:67
int which_mime_type(char *s)
Definition: ze-demime.c:662
char * charset
Definition: ze-demime.h:70
long uint32_t
Definition: ze-sys.h:489
bool(* demime_F)(char *, size_t, char *, int, int, void *, mime_part_T *)
Definition: ze-demime.h:77
char * boundary
Definition: ze-demime.h:69
rfc2822_hdr_T * hdrs
Definition: ze-demime.h:74