OpenSync Environment
[OpenSync Public API]

The public API of the opensync environment. More...


Functions

OSyncEnv * osync_env_new (void)
 This will create a new opensync environment.
void osync_env_free (OSyncEnv *env)
 Frees a osync environment.
void osync_env_set_option (OSyncEnv *env, const char *name, const char *value)
 Sets a options on the environment.
osync_bool osync_env_initialize (OSyncEnv *env, OSyncError **error)
 Initializes the environment (loads plugins).
osync_bool osync_env_finalize (OSyncEnv *env, OSyncError **error)
 Finalizes the environment.
osync_bool osync_env_load_formats (OSyncEnv *env, const char *path, OSyncError **error)
 Loads all format and conversion plugins.
osync_bool osync_env_load_plugins (OSyncEnv *env, const char *path, OSyncError **error)
 Loads the sync modules from a given directory.
OSyncPluginosync_env_find_plugin (OSyncEnv *env, const char *name)
 Finds the plugin with the given name.
int osync_env_num_plugins (OSyncEnv *env)
 Returns the number of loaded plugins.
OSyncPluginosync_env_nth_plugin (OSyncEnv *env, int nth)
 Returns pointer to nth plugin.
osync_bool osync_env_plugin_is_usable (OSyncEnv *env, const char *pluginname, OSyncError **error)
 Checks if a plugin is available and usable.
osync_bool osync_env_load_groups (OSyncEnv *env, const char *p, OSyncError **error)
 Loads the plugins from a given directory.
OSyncGrouposync_env_find_group (OSyncEnv *env, const char *name)
 Finds the group with the given name.
void osync_env_append_group (OSyncEnv *env, OSyncGroup *group)
 Adds the given group to the environment.
void osync_env_remove_group (OSyncEnv *env, OSyncGroup *group)
 Removes the given group from the enviroment.
int osync_env_num_groups (OSyncEnv *env)
 Counts the groups in the environment.
OSyncGrouposync_env_nth_group (OSyncEnv *env, int nth)
 Returns the nth group.


Detailed Description

The public API of the opensync environment.

Function Documentation

OSyncEnv* osync_env_new ( void   ) 

This will create a new opensync environment.

The environment will hold all information about plugins, groups etc

Returns:
A pointer to a newly allocated environment. NULL on error.

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.

Parameters:
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.

Parameters:
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

Parameters:
env Pointer to a OSyncEnv environment
error Pointer to a error struct to return a error
Returns:
TRUE on success, FALSE otherwise

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

Parameters:
env Pointer to a OSyncEnv environment
error Pointer to a error struct to return a error
Returns:
TRUE on success, FALSE otherwise

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

Parameters:
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
Returns:
TRUE if successfull, FALSE otherwise

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

Parameters:
env Pointer to a OSyncEnv environment
path The path where to look for plugins
error Pointer to a error struct to return a error
Returns:
TRUE on success, FALSE otherwise

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

Parameters:
env Pointer to a OSyncEnv environment
name The name to search for
Returns:
The plugin or NULL if not found

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

Parameters:
env Pointer to a OSyncEnv environment
Returns:
Number of plugins

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

Parameters:
env Pointer to a OSyncEnv environment
nth Which plugin to return
Returns:
Pointer to plugin

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.

Parameters:
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
Returns:
TRUE if plugin was found and is usable, FALSE otherwise

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.

Parameters:
env Pointer to a OSyncEnv environment
path The path where to look for groups
error Pointer to a error struct to return a error
Returns:
TRUE on success, FALSE otherwise

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

Parameters:
env Pointer to a OSyncEnv environment
name Name of the group to search
Returns:
Pointer to group. NULL if not found

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

Parameters:
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

Parameters:
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

Parameters:
env Pointer to a OSyncEnv environment
Returns:
Number of groups

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

Parameters:
env Pointer to a OSyncEnv environment
nth Which group to return
Returns:
Pointer to the group

Definition at line 625 of file opensync_env.c.

Referenced by osync_env_finalize(), and osync_env_find_group().


Generated on Sun Jul 26 17:27:23 2009 for OpenSync by  doxygen 1.5.9