NetSurf
|
#include <stdbool.h>
#include <libwapcaplet/libwapcaplet.h>
#include <datatypes/datatypes.h>
#include "netsurf/content_type.h"
#include "utils/errors.h"
Go to the source code of this file.
Functions | |
const char * | fetch_filetype (const char *unix_path) |
filetype – determine the MIME type of a local file More... | |
nserror | ami_mime_init (const char *mimefile) |
void | ami_mime_free (void) |
void | ami_mime_dump (void) |
struct Node * | ami_mime_from_datatype (struct DataType *dt, lwc_string **mimetype, struct Node *start_node) |
Return a MIME Type matching a DataType. More... | |
struct Node * | ami_mime_to_filetype (lwc_string *mimetype, lwc_string **filetype, struct Node *start_node) |
Return the DefIcons type matching a MIME type. More... | |
const char * | ami_mime_content_to_filetype (struct hlcache_handle *c) |
lwc_string * | ami_mime_content_to_cmd (struct hlcache_handle *c) |
struct Node * | ami_mime_has_cmd (lwc_string **mimetype, struct Node *start_node) |
Return all MIME types containing a plugincmd. More... | |
bool | ami_mime_compare (struct hlcache_handle *c, const char *type) |
Compare the MIME type of an hlcache_handle to a DefIcons type. More... | |
const char * | ami_content_type_to_file_type (content_type type) |
const char * ami_content_type_to_file_type | ( | content_type | type | ) |
Definition at line 141 of file filetype.c.
References CONTENT_CSS, CONTENT_HTML, CONTENT_IMAGE, CONTENT_TEXTPLAIN, and type.
Referenced by ami_mime_content_to_filetype().
bool ami_mime_compare | ( | struct hlcache_handle * | c, |
const char * | type | ||
) |
Compare the MIME type of an hlcache_handle to a DefIcons type.
Definition at line 614 of file filetype.c.
References ami_mime_to_filetype(), content_get_mime_type(), and type.
Referenced by ami_file_save(), ami_gui_menu_update_disabled(), and HOOKF().
lwc_string * ami_mime_content_to_cmd | ( | struct hlcache_handle * | c | ) |
Definition at line 595 of file filetype.c.
References ami_mime_to_plugincmd(), and content_get_mime_type().
Referenced by amiga_plugin_hack_execute().
const char * ami_mime_content_to_filetype | ( | struct hlcache_handle * | c | ) |
Definition at line 523 of file filetype.c.
References ami_content_type_to_file_type(), ami_mime_to_filetype(), content_get_mime_type(), and content_get_type().
void ami_mime_dump | ( | void | ) |
Definition at line 639 of file filetype.c.
References ami_mime_entry_locate(), AMI_MIME_MIMETYPE, ami_mime_entry::datatype, ami_mime_entry::filetype, ami_mime_entry::mimetype, NSLOG, and ami_mime_entry::plugincmd.
Referenced by ami_mime_free().
void ami_mime_free | ( | void | ) |
Definition at line 264 of file filetype.c.
References ami_mime_dump(), ami_mime_list, and FreeObjList().
Referenced by main().
struct Node * ami_mime_from_datatype | ( | struct DataType * | dt, |
lwc_string ** | mimetype, | ||
struct Node * | start_node | ||
) |
Return a MIME Type matching a DataType.
dt | a DataType structure |
mimetype | lwc_string to hold the MIME type |
start_node | node to feed back in to continue search |
Definition at line 455 of file filetype.c.
References AMI_MIME_DATATYPE, ami_mime_entry_locate(), ami_mime_guess_add_datatype(), and ami_mime_entry::mimetype.
Referenced by fetch_filetype().
struct Node * ami_mime_has_cmd | ( | lwc_string ** | mimetype, |
struct Node * | start_node | ||
) |
Return all MIME types containing a plugincmd.
mimetype | ptr to lwc_string MIME type |
start_node | node to feed back in to continue search |
Definition at line 547 of file filetype.c.
References ami_mime_entry_locate(), AMI_MIME_PLUGINCMD, and ami_mime_entry::mimetype.
Referenced by amiga_plugin_hack_init().
nserror ami_mime_init | ( | const char * | mimefile | ) |
Definition at line 177 of file filetype.c.
References AddObject(), AMI_MIME_DATATYPE, ami_mime_entry_free(), AMI_MIME_FILETYPE, ami_mime_list, AMI_MIME_MIMETYPE, AMI_MIME_PLUGINCMD, AMINS_MIME, buffer, ami_mime_entry::datatype, FClose, ami_mime_entry::filetype, FOpen, ami_mime_entry::mimetype, NewObjList(), NSERROR_NOMEM, NSERROR_OK, NSLOG, ObjectCallback(), nsObject::objstruct, and ami_mime_entry::plugincmd.
Referenced by main().
struct Node * ami_mime_to_filetype | ( | lwc_string * | mimetype, |
lwc_string ** | filetype, | ||
struct Node * | start_node | ||
) |
Return the DefIcons type matching a MIME type.
mimetype | lwc_string MIME type |
filetype | ptr to lwc_string to hold DefIcons type |
start_node | node to feed back in to continue search |
Definition at line 503 of file filetype.c.
References ami_mime_entry_locate(), AMI_MIME_MIMETYPE, and ami_mime_entry::filetype.
Referenced by ami_mime_compare(), and ami_mime_content_to_filetype().
const char * fetch_filetype | ( | const char * | unix_path | ) |
filetype – determine the MIME type of a local file
Definition at line 58 of file filetype.c.