NetSurf
filetype.h
Go to the documentation of this file.
1/*
2 * Copyright 2010 - 2011 Chris Young <chris@unsatisfactorysoftware.co.uk>
3 *
4 * This file is part of NetSurf, http://www.netsurf-browser.org/
5 *
6 * NetSurf 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; version 2 of the License.
9 *
10 * NetSurf is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#ifndef AMIGA_FILETYPE_H
20#define AMIGA_FILETYPE_H
21
22#include <stdbool.h>
23#include <libwapcaplet/libwapcaplet.h>
24#include <datatypes/datatypes.h>
25
27#include "utils/errors.h"
28
29struct hlcache_handle;
30struct ami_mime_entry;
31
32const char *fetch_filetype(const char *unix_path);
33
34nserror ami_mime_init(const char *mimefile);
35void ami_mime_free(void);
36void ami_mime_dump(void);
37
38struct Node *ami_mime_from_datatype(struct DataType *dt,
39 lwc_string **mimetype, struct Node *start_node);
40struct Node *ami_mime_to_filetype(lwc_string *mimetype,
41 lwc_string **filetype, struct Node *start_node);
42
43const char *ami_mime_content_to_filetype(struct hlcache_handle *c);
44lwc_string *ami_mime_content_to_cmd(struct hlcache_handle *c);
45
46struct Node *ami_mime_has_cmd(lwc_string **mimetype, struct Node *start_node);
47
48bool ami_mime_compare(struct hlcache_handle *c, const char *type);
49
50/* deprecated */
52
53#endif
const char * ami_content_type_to_file_type(content_type type)
Definition: filetype.c:141
void ami_mime_free(void)
Definition: filetype.c:264
lwc_string * ami_mime_content_to_cmd(struct hlcache_handle *c)
Definition: filetype.c:595
const char * fetch_filetype(const char *unix_path)
filetype – determine the MIME type of a local file
Definition: filetype.c:58
struct Node * ami_mime_from_datatype(struct DataType *dt, lwc_string **mimetype, struct Node *start_node)
Return a MIME Type matching a DataType.
Definition: filetype.c:455
nserror ami_mime_init(const char *mimefile)
Definition: filetype.c:177
struct Node * ami_mime_to_filetype(lwc_string *mimetype, lwc_string **filetype, struct Node *start_node)
Return the DefIcons type matching a MIME type.
Definition: filetype.c:503
void ami_mime_dump(void)
Definition: filetype.c:639
bool ami_mime_compare(struct hlcache_handle *c, const char *type)
Compare the MIME type of an hlcache_handle to a DefIcons type.
Definition: filetype.c:614
const char * ami_mime_content_to_filetype(struct hlcache_handle *c)
Definition: filetype.c:523
struct Node * ami_mime_has_cmd(lwc_string **mimetype, struct Node *start_node)
Return all MIME types containing a plugincmd.
Definition: filetype.c:547
Declaration of content enumerations.
content_type
The type of a content.
Definition: content_type.h:53
Error codes.
nserror
Enumeration of error codes.
Definition: errors.h:29
const char * type
Definition: filetype.cpp:44
Definition: filetype.c:43
High-level cache handle.
Definition: hlcache.c:66