| Evolution-Data-Server Manual: Backend Utilities (libebackend) | ||||
|---|---|---|---|---|
| Top | Description | ||||
gboolean e_data_server_module_init (const gchar *module_path,GError **error); GList * e_data_server_get_extensions_for_type (GType type); void e_data_server_extension_list_free (GList *extensions); void e_data_server_module_remove_unused (void); void e_data_server_module_add_type (GType type); void eds_module_initialize (GTypeModule *module); void eds_module_shutdown (void); void eds_module_list_types (const GType **types,gint *num_types);
An EDataServerModule loads backend modules from the directory given
in e_data_server_module_init(). Each backend module must export three
functions. The first two -- eds_module_initialize() and
eds_module_list_types() -- are called immediately after the backend
module is loaded. The last one -- eds_module_shutdown() -- is called
when the backend module is unloaded.
gboolean e_data_server_module_init (const gchar *module_path,GError **error);
Loads all backend modules in module_path. If an error occurs,
the function sets error and returns FALSE.
|
directory of backend modules |
|
return location for a GError, or NULL
|
Returns : |
TRUE on success, FALSE on failure |
GList * e_data_server_get_extensions_for_type
(GType type);
Returns a list of objects derived from type which have been registered
through eds_module_list_types() or e_data_server_module_add_type().
Free the returned list using e_data_server_extension_list_free().
|
a GType |
Returns : |
a list of extension objects |
void e_data_server_extension_list_free (GList *extensions);
Frees a list of objects returned by
e_data_server_get_extensions_for_type().
|
a list of extension objects |
void e_data_server_module_remove_unused (void);
Unrefs all loaded modules, so that unused modules are unloaded from the system.
void e_data_server_module_add_type (GType type);
Creates an instance of type and adds the instance to an internal list
which can be queried using e_data_server_get_extensions_for_type().
|
a GType |
void eds_module_initialize (GTypeModule *module);
Each backend module must define this function. The module should call
g_type_module_register_type() to register all dynamically-loaded types.
|
a GTypeModule |
void eds_module_shutdown (void);
Each backend module must define this function. The module should release resources and perform any necessary cleanup actions prior to the service being shut down.
void eds_module_list_types (const GType **types,gint *num_types);
Each backend module must define this function. The module should
point types to a list of types registered in eds_module_initialize()
and also set num_types to the length of that list.
|
return location for a GType list |
|
the length of the GType list |