* Bug fix: Memory corruption when alpine searches for a string that is
[alpine.git] / pith / mimetype.h
blob55e9c7a6c87da0d1b402375f1526b0d15f5eec3a
1 /*
2 * $Id: mimetype.h 769 2007-10-24 00:15:40Z hubert@u.washington.edu $
4 * ========================================================================
5 * Copyright 2006-2007 University of Washington
6 * Copyright 2013-2021 Eduardo Chappa
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * ========================================================================
17 #ifndef PITH_MIMETYPE_INCLUDED
18 #define PITH_MIMETYPE_INCLUDED
22 * Struct passed mime.types search functions
24 typedef struct {
25 union {
26 char *ext;
27 char *mime_type;
28 } from;
29 union {
30 struct {
31 int type;
32 char *subtype;
33 } mime;
34 char *ext;
35 } to;
36 } MT_MAP_T;
39 typedef int (* MT_OPERATORPROC)(MT_MAP_T *, FILE *);
42 /* exported prototypes */
43 int set_mime_type_by_extension(BODY *, char *);
44 int set_mime_extension_by_type(char *, char *);
45 int check_mime_type_by_extension(char *, char *);
46 int mt_srch_by_ext(MT_MAP_T *, FILE *);
47 int mt_get_file_ext(char *, char **);
48 int mt_srch_mime_type(MT_OPERATORPROC, MT_MAP_T *);
49 int mt_translate_type(char *);
52 #endif /* PITH_MIMETYPE_INCLUDED */