NetSurf
Functions
filetype.h File Reference
#include <stdbool.h>
#include <libwapcaplet/libwapcaplet.h>
#include <datatypes/datatypes.h>
#include "netsurf/content_type.h"
#include "utils/errors.h"
Include dependency graph for filetype.h:
This graph shows which files directly or indirectly include this file:

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)
 

Function Documentation

◆ ami_content_type_to_file_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().

Here is the caller graph for this function:

◆ ami_mime_compare()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ami_mime_content_to_cmd()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ami_mime_content_to_filetype()

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().

Here is the call graph for this function:

◆ ami_mime_dump()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ami_mime_from_datatype()

struct Node * ami_mime_from_datatype ( struct DataType *  dt,
lwc_string **  mimetype,
struct Node *  start_node 
)

Return a MIME Type matching a DataType.

Parameters
dta DataType structure
mimetypelwc_string to hold the MIME type
start_nodenode to feed back in to continue search
Returns
node or NULL if no match

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ami_mime_has_cmd()

struct Node * ami_mime_has_cmd ( lwc_string **  mimetype,
struct Node *  start_node 
)

Return all MIME types containing a plugincmd.

Parameters
mimetypeptr to lwc_string MIME type
start_nodenode to feed back in to continue search
Returns
node or NULL if no match

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ami_mime_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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ami_mime_to_filetype()

struct Node * ami_mime_to_filetype ( lwc_string *  mimetype,
lwc_string **  filetype,
struct Node *  start_node 
)

Return the DefIcons type matching a MIME type.

Parameters
mimetypelwc_string MIME type
filetypeptr to lwc_string to hold DefIcons type
start_nodenode to feed back in to continue search
Returns
node or NULL if no match

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fetch_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.