NeoMutt  2018-07-16 +2481-68dcde
Teaching an old dog new tricks
DOXYGEN
mime.h File Reference

Constants and macros for managing MIME encoding. More...

+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define hexval(ch)   IndexHex[(unsigned int) (ch)]
 
#define is_multipart(body)
 
#define TYPE(body)   ((body->type == TYPE_OTHER) && body->xtype ? body->xtype : BodyTypes[(body->type)])
 
#define ENCODING(x)   BodyEncodings[(x)]
 

Enumerations

enum  ContentType {
  TYPE_OTHER, TYPE_AUDIO, TYPE_APPLICATION, TYPE_IMAGE,
  TYPE_MESSAGE, TYPE_MODEL, TYPE_MULTIPART, TYPE_TEXT,
  TYPE_VIDEO, TYPE_ANY
}
 Content-Type. More...
 
enum  ContentEncoding {
  ENC_OTHER, ENC_7BIT, ENC_8BIT, ENC_QUOTED_PRINTABLE,
  ENC_BASE64, ENC_BINARY, ENC_UUENCODED
}
 Content-Transfer-Encoding. More...
 
enum  ContentDisposition { DISP_INLINE, DISP_ATTACH, DISP_FORM_DATA, DISP_NONE }
 Content-Disposition values. More...
 

Variables

const int IndexHex [128]
 Lookup table for ASCII hex digits. More...
 
const char *const BodyTypes []
 Common MIME body types. More...
 
const char *const BodyEncodings []
 Common MIME body encodings. More...
 
const char MimeSpecials []
 Characters that need special treatment in MIME. More...
 

Detailed Description

Constants and macros for managing MIME encoding.

Authors
  • Michael R. Elkins

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Definition in file mime.h.

Macro Definition Documentation

◆ hexval

#define hexval (   ch)    IndexHex[(unsigned int) (ch)]

Definition at line 75 of file mime.h.

◆ is_multipart

#define is_multipart (   body)
Value:
(((body)->type == TYPE_MULTIPART) || \
(((body)->type == TYPE_MESSAGE) && ((body)->subtype) && \
((strcasecmp((body)->subtype, "rfc822") == 0) || \
(strcasecmp((body)->subtype, "news") == 0))))
Type: 'message/*'.
Definition: mime.h:35
Type: 'multipart/*'.
Definition: mime.h:37

Definition at line 77 of file mime.h.

◆ TYPE

#define TYPE (   body)    ((body->type == TYPE_OTHER) && body->xtype ? body->xtype : BodyTypes[(body->type)])

Definition at line 83 of file mime.h.

◆ ENCODING

#define ENCODING (   x)    BodyEncodings[(x)]

Definition at line 85 of file mime.h.

Enumeration Type Documentation

◆ ContentType

Content-Type.

Enumerator
TYPE_OTHER 

Unknown Content-Type.

TYPE_AUDIO 

Type: 'audio/*'.

TYPE_APPLICATION 

Type: 'application/*'.

TYPE_IMAGE 

Type: 'image/*'.

TYPE_MESSAGE 

Type: 'message/*'.

TYPE_MODEL 

Type: 'model/*'.

TYPE_MULTIPART 

Type: 'multipart/*'.

TYPE_TEXT 

Type: 'text/*'.

TYPE_VIDEO 

Type: 'video/*'.

TYPE_ANY 

Type: '*' or '.*'.

Definition at line 29 of file mime.h.

30 {
31  TYPE_OTHER,
32  TYPE_AUDIO,
34  TYPE_IMAGE,
35  TYPE_MESSAGE,
36  TYPE_MODEL,
38  TYPE_TEXT,
39  TYPE_VIDEO,
40  TYPE_ANY,
41 };
Unknown Content-Type.
Definition: mime.h:31
Type: 'audio/*'.
Definition: mime.h:32
Type: '*' or '.*'.
Definition: mime.h:40
Type: 'video/*'.
Definition: mime.h:39
Type: 'text/*'.
Definition: mime.h:38
Type: 'message/*'.
Definition: mime.h:35
Type: 'multipart/*'.
Definition: mime.h:37
Type: 'model/*'.
Definition: mime.h:36
Type: 'image/*'.
Definition: mime.h:34
Type: 'application/*'.
Definition: mime.h:33

◆ ContentEncoding

Content-Transfer-Encoding.

Enumerator
ENC_OTHER 

Encoding unknown.

ENC_7BIT 

7-bit text

ENC_8BIT 

8-bit text

ENC_QUOTED_PRINTABLE 

Quoted-printable text.

ENC_BASE64 

Base-64 encoded text.

ENC_BINARY 

Binary.

ENC_UUENCODED 

UUEncoded text.

Definition at line 46 of file mime.h.

47 {
48  ENC_OTHER,
49  ENC_7BIT,
50  ENC_8BIT,
52  ENC_BASE64,
53  ENC_BINARY,
55 };
7-bit text
Definition: mime.h:49
8-bit text
Definition: mime.h:50
Base-64 encoded text.
Definition: mime.h:52
Binary.
Definition: mime.h:53
Quoted-printable text.
Definition: mime.h:51
Encoding unknown.
Definition: mime.h:48
UUEncoded text.
Definition: mime.h:54

◆ ContentDisposition

Content-Disposition values.

Enumerator
DISP_INLINE 

Content is inline.

DISP_ATTACH 

Content is attached.

DISP_FORM_DATA 

Content is form-data.

DISP_NONE 

No preferred disposition.

Definition at line 60 of file mime.h.

61 {
62  DISP_INLINE,
63  DISP_ATTACH,
65  DISP_NONE,
66 };
Content is form-data.
Definition: mime.h:64
Content is attached.
Definition: mime.h:63
No preferred disposition.
Definition: mime.h:65
Content is inline.
Definition: mime.h:62

Variable Documentation

◆ IndexHex

const int IndexHex[128]

Lookup table for ASCII hex digits.

Definition at line 36 of file mime.c.

◆ BodyTypes

const char* const BodyTypes[]

Common MIME body types.

Definition at line 51 of file mime.c.

◆ BodyEncodings

const char* const BodyEncodings[]

Common MIME body encodings.

Definition at line 59 of file mime.c.

◆ MimeSpecials

const char MimeSpecials[]

Characters that need special treatment in MIME.

Definition at line 67 of file mime.c.