Macros | Functions
mime.h File Reference

Determining MIME type of files. More...

Macros

#define VTM_MIME_TEXT_PLAIN   "text/plain"
 
#define VTM_MIME_TEXT_HTML   "text/html"
 
#define VTM_MIME_IMAGE_JPEG   "image/jpeg"
 
#define VTM_MIME_IMAGE_PNG   "image/png"
 
#define VTM_MIME_APP_JAVASCRIPT   "application/javascript"
 
#define VTM_MIME_APP_JSON   "application/json"
 

Functions

VTM_API const char * vtm_mime_type_for_name (const char *filename)
 
VTM_API const char * vtm_mime_type_for_ext (const char *ext)
 

Function Documentation

VTM_API const char* vtm_mime_type_for_name ( const char *  filename)

Determines the (presumed) MIME type for the given filename.

This function internally calls vtm_mime_type_for_ext().

Parameters
filename
Returns
MIME type string if a corresponding MIME type was found
NULL if no suitable MIME type was found
VTM_API const char* vtm_mime_type_for_ext ( const char *  ext)

Determines the (presumed) MIME type for the given file extension.

Parameters
extthe extension
Returns
MIME type string if a corresponding MIME type was found
NULL if no suitable MIME type was found