1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29 #ifndef MIMECONF_H
30 #define MIMECONF_H
31
32 #include "conf.h"
33
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37
38 #define CFG_MIME_ADD(list_begin, list_end, directive) \
39 cx_linked_list_add((
void**)list_begin, (
void**)list_end, -
1, offsetof(MimeDirective, next), directive)
40
41 typedef struct _mime_dir MimeDirective;
42
43 typedef struct _mime_conf {
44 ConfigParser parser;
45 MimeDirective *directives_begin;
46 MimeDirective *directives_end;
47 int ntypes;
48 } MimeConfig;
49
50 struct _mime_dir {
51 cxmutstr type;
52
53 ssize_t nextensions;
54 cxstring *extensions;
55
56 MimeDirective *next;
57 };
58
59 MimeConfig *load_mime_config(
const char *file);
60
61 void free_mime_config(MimeConfig *conf);
62
63 int mimeconf_parse(
void *p, ConfigLine *begin, ConfigLine *end, cxmutstr line);
64
65 #ifdef __cplusplus
66 }
67 #endif
68
69 #endif
70
71