OpenSync
0.22
|
The public API of the opensync environment. More...
Functions | |
OSyncEnv * | osync_env_new (void) |
This will create a new opensync environment. More... | |
void | osync_env_free (OSyncEnv *env) |
Frees a osync environment. More... | |
void | osync_env_set_option (OSyncEnv *env, const char *name, const char *value) |
Sets a options on the environment. More... | |
osync_bool | osync_env_initialize (OSyncEnv *env, OSyncError **error) |
Initializes the environment (loads plugins) More... | |
osync_bool | osync_env_finalize (OSyncEnv *env, OSyncError **error) |
Finalizes the environment. More... | |
osync_bool | osync_env_load_formats (OSyncEnv *env, const char *path, OSyncError **error) |
Loads all format and conversion plugins. More... | |
osync_bool | osync_env_load_plugins (OSyncEnv *env, const char *path, OSyncError **error) |
Loads the sync modules from a given directory. More... | |
OSyncPlugin * | osync_env_find_plugin (OSyncEnv *env, const char *name) |
Finds the plugin with the given name. More... | |
int | osync_env_num_plugins (OSyncEnv *env) |
Returns the number of loaded plugins. More... | |
OSyncPlugin * | osync_env_nth_plugin (OSyncEnv *env, int nth) |
Returns pointer to nth plugin. More... | |
osync_bool | osync_env_plugin_is_usable (OSyncEnv *env, const char *pluginname, OSyncError **error) |
Checks if a plugin is available and usable. More... | |
osync_bool | osync_env_load_groups (OSyncEnv *env, const char *p, OSyncError **error) |
Loads the plugins from a given directory. More... | |
OSyncGroup * | osync_env_find_group (OSyncEnv *env, const char *name) |
Finds the group with the given name. More... | |
void | osync_env_append_group (OSyncEnv *env, OSyncGroup *group) |
Adds the given group to the environment. More... | |
void | osync_env_remove_group (OSyncEnv *env, OSyncGroup *group) |
Removes the given group from the enviroment. More... | |
int | osync_env_num_groups (OSyncEnv *env) |
Counts the groups in the environment. More... | |
OSyncGroup * | osync_env_nth_group (OSyncEnv *env, int nth) |
Returns the nth group. More... | |
The public API of the opensync environment.
OSyncEnv* osync_env_new | ( | void | ) |
This will create a new opensync environment.
The environment will hold all information about plugins, groups etc
Definition at line 186 of file opensync_env.c.
void osync_env_free | ( | OSyncEnv * | env | ) |
Frees a osync environment.
Frees a osync environment and all resources.
env | Pointer to the environment to free |
Definition at line 207 of file opensync_env.c.
void osync_env_set_option | ( | OSyncEnv * | env, |
const char * | name, | ||
const char * | value | ||
) |
Sets a options on the environment.
env | Pointer to the environment |
name | Name of the option to set |
value | Value to set |
Definition at line 222 of file opensync_env.c.
Referenced by osync_env_new().
osync_bool osync_env_initialize | ( | OSyncEnv * | env, |
OSyncError ** | error | ||
) |
Initializes the environment (loads plugins)
This will load all available plugins from disk. You can configure the location to look for plugins before calling this function
env | Pointer to a OSyncEnv environment |
error | Pointer to a error struct to return a error |
Definition at line 240 of file opensync_env.c.
osync_bool osync_env_finalize | ( | OSyncEnv * | env, |
OSyncError ** | error | ||
) |
Finalizes the environment.
This will finalize the environment and unload and free all loaded plugins
env | Pointer to a OSyncEnv environment |
error | Pointer to a error struct to return a error |
Definition at line 289 of file opensync_env.c.
osync_bool osync_env_load_formats | ( | OSyncEnv * | env, |
const char * | path, | ||
OSyncError ** | error | ||
) |
Loads all format and conversion plugins.
This command will load all plugins for the conversion system. If you dont change the path before it will load the plugins from the default location
env | The format environment |
path | The path to load from or NULL if to load from default path |
error | The location to return a error to |
Definition at line 334 of file opensync_env.c.
Referenced by osync_env_initialize().
osync_bool osync_env_load_plugins | ( | OSyncEnv * | env, |
const char * | path, | ||
OSyncError ** | error | ||
) |
Loads the sync modules from a given directory.
Loads all sync modules from a directory into a osync environment
env | Pointer to a OSyncEnv environment |
path | The path where to look for plugins |
error | Pointer to a error struct to return a error |
Definition at line 363 of file opensync_env.c.
Referenced by osync_env_initialize().
OSyncPlugin* osync_env_find_plugin | ( | OSyncEnv * | env, |
const char * | name | ||
) |
Finds the plugin with the given name.
Finds the plugin with the given name
env | Pointer to a OSyncEnv environment |
name | The name to search for |
Definition at line 391 of file opensync_env.c.
Referenced by osync_env_plugin_is_usable(), and osync_member_instance_plugin().
int osync_env_num_plugins | ( | OSyncEnv * | env | ) |
Returns the number of loaded plugins.
Returns the number of loaded plugins. 0 if used before initialization
env | Pointer to a OSyncEnv environment |
Definition at line 413 of file opensync_env.c.
Referenced by osync_env_find_plugin().
OSyncPlugin* osync_env_nth_plugin | ( | OSyncEnv * | env, |
int | nth | ||
) |
Returns pointer to nth plugin.
Returns pointer to nth plugin
env | Pointer to a OSyncEnv environment |
nth | Which plugin to return |
Definition at line 427 of file opensync_env.c.
Referenced by osync_env_find_plugin().
osync_bool osync_env_plugin_is_usable | ( | OSyncEnv * | env, |
const char * | pluginname, | ||
OSyncError ** | error | ||
) |
Checks if a plugin is available and usable.
env | The environment in which the plugin should be loaded |
pluginname | The name of the plugin to check for |
error | If the return was FALSE, will contain the information why the plugin is not available |
Definition at line 440 of file opensync_env.c.
osync_bool osync_env_load_groups | ( | OSyncEnv * | env, |
const char * | p, | ||
OSyncError ** | error | ||
) |
Loads the plugins from a given directory.
Loads all plugins from a directory into a osync environment. The directory must exist prior to opening.
env | Pointer to a OSyncEnv environment |
path | The path where to look for groups |
error | Pointer to a error struct to return a error |
Definition at line 472 of file opensync_env.c.
Referenced by osync_env_initialize().
OSyncGroup* osync_env_find_group | ( | OSyncEnv * | env, |
const char * | name | ||
) |
Finds the group with the given name.
Finds the group with the given name
env | Pointer to a OSyncEnv environment |
name | Name of the group to search |
Definition at line 563 of file opensync_env.c.
void osync_env_append_group | ( | OSyncEnv * | env, |
OSyncGroup * | group | ||
) |
Adds the given group to the environment.
Adds the given group to the environment
env | Pointer to a OSyncEnv environment |
group | The group to add |
Definition at line 585 of file opensync_env.c.
Referenced by osync_group_new().
void osync_env_remove_group | ( | OSyncEnv * | env, |
OSyncGroup * | group | ||
) |
Removes the given group from the enviroment.
Removes the given group from the environment
env | Pointer to a OSyncEnv environment |
group | The group to add |
Definition at line 598 of file opensync_env.c.
Referenced by osync_group_free().
int osync_env_num_groups | ( | OSyncEnv * | env | ) |
Counts the groups in the environment.
Returns the number of groups
env | Pointer to a OSyncEnv environment |
Definition at line 611 of file opensync_env.c.
Referenced by osync_env_find_group().
OSyncGroup* osync_env_nth_group | ( | OSyncEnv * | env, |
int | nth | ||
) |
Returns the nth group.
Returns the nth groups from the environment
env | Pointer to a OSyncEnv environment |
nth | Which group to return |
Definition at line 625 of file opensync_env.c.
Referenced by osync_env_finalize(), and osync_env_find_group().