| File src/int/file_magic.c changed (mode: 100644) (index 37e7b8738..14beba879) |
| ... |
... |
static int lookup_in_cache(fsddata_t *cache, const char path[], |
| 57 |
57 |
filemon_t *filemon, cache_data_t **data); |
filemon_t *filemon, cache_data_t **data); |
| 58 |
58 |
static void update_cache(fsddata_t *cache, const char path[], |
static void update_cache(fsddata_t *cache, const char path[], |
| 59 |
59 |
const char mimetype[], filemon_t *filemon, cache_data_t *data); |
const char mimetype[], filemon_t *filemon, cache_data_t *data); |
| 60 |
|
static int get_gtk_mimetype(const char filename[], char buf[], size_t buf_sz); |
|
|
60 |
|
static int get_glib_mimetype(const char filename[], char buf[], size_t buf_sz); |
| 61 |
61 |
static int get_magic_mimetype(const char filename[], char buf[], size_t buf_sz); |
static int get_magic_mimetype(const char filename[], char buf[], size_t buf_sz); |
| 62 |
62 |
static int get_file_mimetype(const char filename[], char buf[], size_t buf_sz); |
static int get_file_mimetype(const char filename[], char buf[], size_t buf_sz); |
| 63 |
63 |
static assoc_records_t get_handlers(const char mime_type[]); |
static assoc_records_t get_handlers(const char mime_type[]); |
| |
| ... |
... |
get_mimetype(const char file[], int resolve_symlinks) |
| 96 |
96 |
return mimetype; |
return mimetype; |
| 97 |
97 |
} |
} |
| 98 |
98 |
|
|
| 99 |
|
if(get_gtk_mimetype(file, mimetype, sizeof(mimetype)) == -1) |
|
|
99 |
|
if(get_glib_mimetype(file, mimetype, sizeof(mimetype)) == -1) |
| 100 |
100 |
{ |
{ |
| 101 |
101 |
if(get_magic_mimetype(file, mimetype, sizeof(mimetype)) == -1) |
if(get_magic_mimetype(file, mimetype, sizeof(mimetype)) == -1) |
| 102 |
102 |
{ |
{ |
| |
| ... |
... |
update_cache(fsddata_t *cache, const char path[], const char mimetype[], |
| 175 |
175 |
} |
} |
| 176 |
176 |
|
|
| 177 |
177 |
static int |
static int |
| 178 |
|
get_gtk_mimetype(const char filename[], char buf[], size_t buf_sz) |
|
|
178 |
|
get_glib_mimetype(const char filename[], char buf[], size_t buf_sz) |
| 179 |
179 |
{ |
{ |
| 180 |
180 |
#ifdef HAVE_GLIB |
#ifdef HAVE_GLIB |
| 181 |
181 |
GFile *file; |
GFile *file; |