Main Page | Class List | File List | Class Members | File Members | Related Pages

gi_mime.h File Reference

Manages MIME type associations for efficiency and ease. More...

#include "gi_path.h"

Go to the source code of this file.

Functions

EXTERN_C_BEGIN LIBGIFT_EXPORT
bool 
gi_mime_load (const char *mime_types, const char *mime_magic)
LIBGIFT_EXPORT void gi_mime_unload (void)
LIBGIFT_EXPORT char * gi_mime_get (GiPath *gipath)
LIBGIFT_EXPORT char * gi_mime_lookup (const char *mime)


Detailed Description

Manages MIME type associations for efficiency and ease.

This system is also capable of using libmagic to access sophisticated magic databases.


Function Documentation

LIBGIFT_EXPORT char* gi_mime_get GiPath gipath  ) 
 

Attempt to determine the MIME type of the file described by `gipath'. If this process fails, a safe fallback will be returned instead of NULL.

Returns:
The MIME type as determined either by the extension of the path, or through /usr/bin/file's libmagic. Fallback value is "application/octet-stream".

EXTERN_C_BEGIN LIBGIFT_EXPORT bool gi_mime_load const char *  mime_types,
const char *  mime_magic
 

Initialize the internal MIME table(s).

Parameters:
mime_types Pathname describing the mime.types file which contains mappings for file extensions.
mime_magic Magic data for /usr/bin/file's libmagic. If NULL is specified, libmagic's compile-time default will be used.

LIBGIFT_EXPORT char* gi_mime_lookup const char *  mime  ) 
 

Access the internally managed MIME type buffer that matches the supplied MIME type. If no match is found, a new type will be added and the newly allocated buffer will be returned.


Generated on Sun Aug 22 07:56:40 2004 by doxygen 1.3.7