4
* Copyright 2007 PCMan <pcman.tw@gmail.com>
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
22
#ifndef _MIME_CACHE_H_INCLUDED_
23
#define _MIME_CACHE_H_INCLUDED_
26
#include <sys/types.h>
34
gboolean has_reverse_suffix : 1; /* since mime.cache v1.1, shared mime info v0.4 */
35
gboolean has_str_weight : 1; /* since mime.cache v1.1, shared mime info v0.4 */
51
guint32 n_suffix_roots;
52
const char* suffix_roots;
55
guint32 magic_max_extent;
58
typedef struct _MimeCache MimeCache;
60
MimeCache* mime_cache_new( const char* file_path );
61
gboolean mime_cache_load( MimeCache* cache, const char* file_path );
62
gboolean mime_cache_reload( MimeCache* cache );
63
void mime_cache_free( MimeCache* cache );
65
const char* mime_cache_lookup_literal( MimeCache* cache, const char* filename );
66
const char* mime_cache_lookup_glob( MimeCache* cache, const char* filename, int *glob_len );
67
const char* mime_cache_lookup_suffix( MimeCache* cache, const char* filename, const char** suffix_pos );
68
const char* mime_cache_lookup_magic( MimeCache* cache, const char* data, int len );
69
const char** mime_cache_lookup_parents( MimeCache* cache, const char* mime_type );
70
const char* mime_cache_lookup_alias( MimeCache* cache, const char* mime_type );