Main Page | Modules | Namespace List | Class Hierarchy | Data Structures | Directories | File List | Namespace Members | Data Fields | Globals

schemes.c File Reference

#include <hiker/bundlemgr.h>
#include <hiker/prv/bundlemgr_prv.h>
#include <hiker/ipc.h>
#include <string.h>
#include <stdlib.h>
#include <sqlite3.h>
#include "pm_traces.h"
#include "pm_globals.h"
#include "pm_ipc.h"
#include "pm_sql.h"

Functions

GHashTable * alp_bundle_scheme_values (const char *scheme)
 Return all data describing a scheme Given a scheme name, returns a hashtable containing keys and values describing the scheme.
gchar * alp_bundle_scheme_value (const char *scheme, const char *key)
 Return a the value for a scheme description key Given a scheme name and a key name, return the value of that key as an allocated string, or NULL if there is no such key.
gchar * alp_bundle_scheme_identify (const char *filename, const char *mimetype)
 Given a filename and/or mimetype, determine what bundle scheme is appropriate.


Function Documentation

gchar* alp_bundle_scheme_identify const char *  filename,
const char *  mimetype
 

Given a filename and/or mimetype, determine what bundle scheme is appropriate.

If there's enough information to make a guess about the type of bundle represented by a filename and/or mimetype, this routine will return the matching scheme name.

The scheme name returned may not be correct, and this does not gaurantee that attempting to install such a named bundle with that scheme will succeed -- this is strictly a front-line convenience routine.

Parameters:
[in] filename Name of file, or NULL
[in] mimetype Mimetype, or NULL
Returns:
An allocated string containng the appropriate scheme name if one appears to be appropriate. NULL otherwise. When you are done with the result, free it with g_free();

gchar* alp_bundle_scheme_value const char *  scheme,
const char *  key
 

Return a the value for a scheme description key Given a scheme name and a key name, return the value of that key as an allocated string, or NULL if there is no such key.

Parameters:
[in] scheme A scheme name. May be invalid, or NULL, in which case an error will be returned.
[in] key A key string. Results are undefined if this is NULL.
Returns:
An allocated string containing the value of the scheme field for the given key. If the value is empty, an empty string will be returned. If the key is not present, NULL will be returned. When you are done with the result, free it with g_free().

GHashTable* alp_bundle_scheme_values const char *  scheme  ) 
 

Return all data describing a scheme Given a scheme name, returns a hashtable containing keys and values describing the scheme.

As an example, the "bar" scheme has "extension" and "mimetype" keys. The value for the "extension" key is ".bar".

Parameters:
[in] scheme A scheme name. May be an invalid scheme name or NULL, in which case an error will be returned.
Returns:
An GHashTable containing allocate gchar* keys and allocated gchar* values. If the scheme isn't valid, NULL will be returned.
When you are done with the result, free it with g_hash_table_destroy().


Generated on Sat Dec 16 20:29:48 2006 for hiker-0.9 by  doxygen 1.4.4