NetSurf
|
RISC OS filetpe interface. More...
#include "netsurf/content_type.h"
Go to the source code of this file.
Macros | |
#define | FILETYPE_ACORN_URI 0xf91 |
#define | FILETYPE_ANT_URL 0xb28 |
#define | FILETYPE_IEURL 0x1ba |
#define | FILETYPE_HTML 0xfaf |
#define | FILETYPE_JNG 0xf78 |
#define | FILETYPE_CSS 0xf79 |
#define | FILETYPE_MNG 0xf83 |
#define | FILETYPE_GIF 0x695 |
#define | FILETYPE_BMP 0x69c |
#define | FILETYPE_ICO 0x132 |
#define | FILETYPE_PNG 0xb60 |
#define | FILETYPE_JPEG 0xc85 |
#define | FILETYPE_ARTWORKS 0xd94 |
#define | FILETYPE_SVG 0xaad |
#define | FILETYPE_WEBP 0xa66 |
Functions | |
const char * | fetch_filetype (const char *unix_path) |
Determine the MIME type of a local file. More... | |
char * | fetch_mimetype (const char *ro_path) |
Find a MIME type for a local file. More... | |
int | ro_content_filetype (struct hlcache_handle *h) |
Determine the RISC OS filetype for a content. More... | |
int | ro_content_native_type (struct hlcache_handle *c) |
Determine the native RISC OS filetype to export a content as. More... | |
int | ro_content_filetype_from_mime_type (lwc_string *mime_type) |
Determine the RISC OS filetype for a MIME type. More... | |
int | ro_content_filetype_from_type (content_type type) |
Determine the RISC OS filetype from a content type. More... | |
bits | ro_filetype_from_unix_path (const char *unix_path) |
Determine the type of a local file. More... | |
RISC OS filetpe interface.
Definition in file filetype.h.
#define FILETYPE_ACORN_URI 0xf91 |
Definition at line 29 of file filetype.h.
#define FILETYPE_ANT_URL 0xb28 |
Definition at line 32 of file filetype.h.
#define FILETYPE_ARTWORKS 0xd94 |
Definition at line 65 of file filetype.h.
#define FILETYPE_BMP 0x69c |
Definition at line 53 of file filetype.h.
#define FILETYPE_CSS 0xf79 |
Definition at line 44 of file filetype.h.
#define FILETYPE_GIF 0x695 |
Definition at line 50 of file filetype.h.
#define FILETYPE_HTML 0xfaf |
Definition at line 38 of file filetype.h.
#define FILETYPE_ICO 0x132 |
Definition at line 56 of file filetype.h.
#define FILETYPE_IEURL 0x1ba |
Definition at line 35 of file filetype.h.
#define FILETYPE_JNG 0xf78 |
Definition at line 41 of file filetype.h.
#define FILETYPE_JPEG 0xc85 |
Definition at line 62 of file filetype.h.
#define FILETYPE_MNG 0xf83 |
Definition at line 47 of file filetype.h.
#define FILETYPE_PNG 0xb60 |
Definition at line 59 of file filetype.h.
#define FILETYPE_SVG 0xaad |
Definition at line 68 of file filetype.h.
#define FILETYPE_WEBP 0xa66 |
Definition at line 71 of file filetype.h.
const char * fetch_filetype | ( | const char * | unix_path | ) |
Determine the MIME type of a local file.
unix_path | Unix style path to file on disk |
Determine the MIME type of a local file.
Definition at line 58 of file filetype.c.
References ami_mime_from_datatype(), ascii_to_lower(), BUF_SIZE, buffer, cmp_type(), default_types, ext1, ext2, type_entry::file_type, hash_get(), mime_hash, type_entry::mime_type, NSLOG, path(), ro_warn_user(), type, type_buf, type_map, and TYPE_MAP_COUNT.
Referenced by fetch_rsrc_process(), and HOOKF().
char * fetch_mimetype | ( | const char * | ro_path | ) |
Find a MIME type for a local file.
ro_path | RISC OS style path to file on disk |
Definition at line 154 of file filetype.c.
References BUF_SIZE, cmp_type(), type_entry::mime_type, NSLOG, ro_warn_user(), type_map, and TYPE_MAP_COUNT.
int ro_content_filetype | ( | struct hlcache_handle * | h | ) |
Determine the RISC OS filetype for a content.
h | The handle of the content to examine. |
Definition at line 243 of file filetype.c.
References content_get_mime_type(), content_get_type(), type_entry::file_type, type_entry::mime_type, ro_content_filetype_from_mime_type(), and ro_content_filetype_from_type().
Referenced by print_send_printsave(), ro_content_native_type(), ro_gui_save_content(), ro_gui_save_object_native(), ro_gui_save_set_state(), ro_gui_url_bar_set_content_favicon(), ro_gui_view_source(), ro_gui_window_prepare_objectinfo(), and ro_gui_window_prepare_pageinfo().
int ro_content_filetype_from_mime_type | ( | lwc_string * | mime_type | ) |
Determine the RISC OS filetype for a MIME type.
mime_type | MIME type to consider |
Definition at line 288 of file filetype.c.
References type_entry::file_type, type_entry::mime_type, type_map, and TYPE_MAP_COUNT.
Referenced by ro_content_filetype(), and ro_gui_save_set_file_type().
int ro_content_filetype_from_type | ( | content_type | type | ) |
Determine the RISC OS filetype from a content type.
type | The content type to examine. |
Definition at line 315 of file filetype.c.
References CONTENT_CSS, CONTENT_HTML, CONTENT_TEXTPLAIN, FILETYPE_HTML, and type.
Referenced by ro_content_filetype(), and ro_gui_url_complete_redraw().
int ro_content_native_type | ( | struct hlcache_handle * | c | ) |
Determine the native RISC OS filetype to export a content as.
c | The content to examine |
Definition at line 263 of file filetype.c.
References FILETYPE_BMP, FILETYPE_GIF, FILETYPE_ICO, FILETYPE_JNG, FILETYPE_JPEG, FILETYPE_MNG, FILETYPE_PNG, FILETYPE_SVG, FILETYPE_WEBP, and ro_content_filetype().
Referenced by ro_gui_save_object_native(), ro_gui_save_set_state(), and ro_gui_window_content_export_types().
bits ro_filetype_from_unix_path | ( | const char * | unix_path | ) |
Determine the type of a local file.
unix_path | Unix style path to file on disk |
Definition at line 327 of file filetype.c.
References type_entry::file_type, NSLOG, path(), and ro_warn_user().
Referenced by download_ro_filetype().