Mimetype mapping and URI comprehension

Mimetype mapping and URI comprehension

Functions

Description

Functions

zeitgeist_register_mimetype ()

void
zeitgeist_register_mimetype (const gchar *mimetype,
                             const gchar *interpretation_uri);

Associate a mimetype with a given interpretation type. Registered mimetypes can be looked up with zeitgeist_interpretation_for_mimetype(). You can register a regular expression as mimetype if you instead of this function invoke zeitgeist_register_mimetype_regex().

Mimetypes are first looked up by their exact name and then if none is found the regular expressions will be checked as fallbacks.

This library will install a wide range a common mimetypes for you, so unless you have very specific needs you will normally not have to call this function.

See the list of common

interpretation types.

Parameters

mimetype

A mimetype string. Fx. text/plain

 

interpretation_uri

A URI defining the interpretation type to associate with mimetype

 

zeitgeist_register_mimetype_regex ()

void
zeitgeist_register_mimetype_regex (const gchar *mimetype_regex,
                                   const gchar *interpretation_uri);

Associate a range of mimetypes with a given interpretation type. Registered mimetypes can be looked up with zeitgeist_interpretation_for_mimetype(). If you only need to register one specific mimetype it is more efficient if you instead of this function call zeitgeist_register_mimetype().

Mimetypes are first looked up by their exact name and then if none is found the regular expressions will be checked as fallbacks.

This library will install a wide range a common mimetypes for you, so unless you have very specific needs you will normally not have to call this function.

See the list of common

interpretation types.

Parameters

mimetype_regex

A regular expression matching a certain range of mimetypes. Fx. text/.* to match all text sub types.

 

interpretation_uri

A URI defining the interpretation type to associate with the matched mimetypes

 

zeitgeist_interpretation_for_mimetype ()

const gchar *
zeitgeist_interpretation_for_mimetype (const gchar *mimetype);

Look up the interpretation type associated with mimetype . Please see the list of common

interpretation types.

Parameters

mimetype

A mimetype string. Fx. text/plain

 

Returns

A URI defining the interpretation type associated with mimetype or NULL in case mimetype is unknown.


zeitgeist_register_uri_scheme ()

void
zeitgeist_register_uri_scheme (const gchar *uri_scheme,
                               const gchar *manifestation_type);

Associate a URI scheme with a given manifestation type. You can find the manifestation type of a given URI by passing it to zeitgeist_manifestation_for_uri().

This library will install a range a common URI schemes for you, so unless you have very specific needs you will normally not have to call this function.

See the list of common

manifestation types.

Parameters

uri_scheme

A URI scheme such as http://

 

zeitgeist_manifestation_for_uri ()

const gchar *
zeitgeist_manifestation_for_uri (const gchar *uri);

Look up a manifestation type for a given URI. Eg. if you pass in file:///tmp/foo.txt you will get back ZEITGEIST_NFO_FILE_DATA_OBJECT.

See the list of common

manifestation types.

Parameters

uri

A URI

 

Returns

A manifestation type for uri or NULL in case no suitable manifestation type is known

Types and Values