mime.h
Go to the documentation of this file.
1 /**
2  * @file mime.h
3  * @brief MIME (Multipurpose Internet Mail Extensions)
4  *
5  * @section License
6  *
7  * Copyright (C) 2010-2018 Oryx Embedded SARL. All rights reserved.
8  *
9  * This file is part of CycloneTCP Open.
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * as published by the Free Software Foundation; either version 2
14  * of the License, or (at your option) any later version.
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. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software Foundation,
23  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24  *
25  * @author Oryx Embedded SARL (www.oryx-embedded.com)
26  * @version 1.9.0
27  **/
28 
29 #ifndef _MIME_H
30 #define _MIME_H
31 
32 //Dependencies
33 #include "core/net.h"
34 
35 //Custom MIME types
36 #ifndef MIME_CUSTOM_TYPES
37  #define MIME_CUSTOM_TYPES
38 #endif
39 
40 //C++ guard
41 #ifdef __cplusplus
42  extern "C" {
43 #endif
44 
45 
46 /**
47  * @brief MIME type
48  **/
49 
50 typedef struct
51 {
52  const char_t *extension;
53  const char_t *type;
54 } MimeType;
55 
56 
57 //MIME related functions
58 const char_t *mimeGetType(const char_t *filename);
59 
60 //C++ guard
61 #ifdef __cplusplus
62  }
63 #endif
64 
65 #endif
char_t filename[]
Definition: tftp_common.h:89
const char_t * type
Definition: mime.h:53
char char_t
Definition: compiler_port.h:41
TCP/IP stack core.
const char_t * extension
Definition: mime.h:52
const char_t * mimeGetType(const char_t *filename)
Get the MIME type from a given extension.
Definition: mime.c:111
MIME type.
Definition: mime.h:50