|
ginnOS
The reference: libc, the libraries and the kernel
|
file types: the type name and the icon of a file. More...
Go to the source code of this file.
Data Structures | |
| struct | mime_type_t |
Macros | |
| #define | MIME_CONF "/usr/share/ginnos/mime.conf" |
| #define | MIME_HEAD_SIZE 64 |
Typedefs | |
| typedef struct mime_table | mime_table_t |
Functions | |
| mime_table_t * | mime_open (const char *path) |
| read a table file (MIME_CONF for the system one). | |
| mime_table_t * | mime_from_text (const char *text) |
| a table from text in memory (for tests). | |
| void | mime_close (mime_table_t *table) |
| const mime_type_t * | mime_lookup (const mime_table_t *table, const char *name, const uint8_t *head, size_t head_len) |
| the type of a file from its name and its first bytes. | |
| const mime_type_t * | mime_lookup_file (const mime_table_t *table, const char *path) |
| the type of a file on disk: inode/directory for a directory, else by its name and first bytes. | |
file types: the type name and the icon of a file.
the table is /usr/share/ginnos/mime.conf (its format is described in the file). a file is matched by its name's extension, then by its first bytes, then as text.
| #define MIME_CONF "/usr/share/ginnos/mime.conf" |
| #define MIME_HEAD_SIZE 64 |
| typedef struct mime_table mime_table_t |
| mime_table_t * mime_open | ( | const char * | path | ) |
read a table file (MIME_CONF for the system one).
| mime_table_t * mime_from_text | ( | const char * | text | ) |
a table from text in memory (for tests).
| void mime_close | ( | mime_table_t * | table | ) |
| const mime_type_t * mime_lookup | ( | const mime_table_t * | table, |
| const char * | name, | ||
| const uint8_t * | head, | ||
| size_t | head_len ) |
the type of a file from its name and its first bytes.
| name | the file name (a path is fine), or NULL. |
| head | the first bytes of the file, or NULL. |
| const mime_type_t * mime_lookup_file | ( | const mime_table_t * | table, |
| const char * | path ) |
the type of a file on disk: inode/directory for a directory, else by its name and first bytes.