Functions |
int | mime_type_get_mime_type (const char *file_extension, char **mime_type) |
| Gets the MIME type for the given file extension.
|
int | mime_type_get_file_extension (const char *mime_type, char ***file_extension, int *length) |
| Gets file extensions for the given MIME type.
|
The MIME Type API provides functions to map MIME types to file extensions and vice versa.
Required Header
#include <mime_type.h>
Overview
The MIME Type API provides functions to map MIME types to file extensions and vice versa. Conversions are provided from file extensions to MIME types and from MIME types to file extensions.
Note that some MIME types have multiple file extensions or no extension, and the MIME type is 'application/octet-stream' if the given file extension is not associated with specific file formats
Enumeration Type Documentation
Enumeration for error.
- Since :
- 2.3.1
- Enumerator:
MIME_TYPE_ERROR_NONE |
Successful
|
MIME_TYPE_ERROR_INVALID_PARAMETER |
Invalid parameter
|
MIME_TYPE_ERROR_OUT_OF_MEMORY |
Out of memory
|
MIME_TYPE_ERROR_IO_ERROR |
Internal I/O error
|
Function Documentation
Gets file extensions for the given MIME type.
- Since :
- 2.3.1
- Parameters:
-
[in] | mime_type | The MIME type |
[out] | file_extension | The array of file extensions without the leading dot ('.') |
[out] | length | The length of the array of file extensions otherwise zero if there none are present |
- Returns:
0
on success, otherwise a negative error value.
- Return values:
-
- See also:
- mime_type_get_mime_type()
Gets the MIME type for the given file extension.
- Since :
- 2.3.1
- Parameters:
-
[in] | file_extension | The file extension without the leading dot ('.') |
[out] | mime_type | The MIME type for the given file extension
The MIME type is 'application/octet-stream' if the given file extension is not associated with specific file formats |
- Returns:
0
on success, otherwise a negative error value.
- Return values:
-
- See also:
- mime_type_get_file_extension()