OpenSync Group Environment
[OpenSync Group Module]

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


Functions

OSYNC_EXPORT OSyncGroupEnvosync_group_env_new (OSyncError **error)
 This will create a new opensync group environment.
OSYNC_EXPORT OSyncGroupEnvosync_group_env_ref (OSyncGroupEnv *env)
 Increase the reference count on an OSyncGroupEnv.
OSYNC_EXPORT void osync_group_env_unref (OSyncGroupEnv *env)
 Decrements the reference count on an OSyncGroupEnv.
OSYNC_EXPORT osync_bool osync_group_env_load_groups (OSyncGroupEnv *env, const char *path, OSyncError **error)
 Loads the plugins from a given directory.
OSYNC_EXPORT OSyncGrouposync_group_env_find_group (OSyncGroupEnv *env, const char *name)
 Finds the group with the given name.
OSYNC_EXPORT osync_bool osync_group_env_add_group (OSyncGroupEnv *env, OSyncGroup *group, OSyncError **error)
 Adds the given group to the environment.
OSYNC_EXPORT void osync_group_env_remove_group (OSyncGroupEnv *env, OSyncGroup *group)
 Removes the given group from the enviroment.
OSYNC_EXPORT int osync_group_env_num_groups (OSyncGroupEnv *env)
 Counts the groups in the environment.
OSYNC_EXPORT OSyncGrouposync_group_env_nth_group (OSyncGroupEnv *env, int nth)
 Returns the nth group.


Detailed Description

The public API of the opensync group environment.

Function Documentation

OSYNC_EXPORT OSyncGroupEnv* osync_group_env_new ( OSyncError **  error  ) 

This will create a new opensync group 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 42 of file opensync_group_env.c.

OSYNC_EXPORT OSyncGroupEnv* osync_group_env_ref ( OSyncGroupEnv env  ) 

Increase the reference count on an OSyncGroupEnv.

Use when storing a reference to the group environment. When the reference is no longer needed use osync_group_env_unref

Returns:
the passed environment

Definition at line 60 of file opensync_group_env.c.

OSYNC_EXPORT void osync_group_env_unref ( OSyncGroupEnv env  ) 

Decrements the reference count on an OSyncGroupEnv.

If the reference count reaches zero then the environment is freed and all resources are freed or unrefed

Parameters:
env Pointer to the environment to free

Definition at line 71 of file opensync_group_env.c.

OSYNC_EXPORT osync_bool osync_group_env_load_groups ( OSyncGroupEnv env,
const char *  path,
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 OSyncGroupEnv 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 92 of file opensync_group_env.c.

OSYNC_EXPORT OSyncGroup* osync_group_env_find_group ( OSyncGroupEnv env,
const char *  name 
)

Finds the group with the given name.

Finds the group with the given name

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

Definition at line 184 of file opensync_group_env.c.

Referenced by osync_group_env_add_group().

OSYNC_EXPORT osync_bool osync_group_env_add_group ( OSyncGroupEnv env,
OSyncGroup group,
OSyncError **  error 
)

Adds the given group to the environment.

Adds the given group to the environment.

Parameters:
env Pointer to a OSyncGroupEnv environment
group The group to add. The group must have a name.
error Pointer to a error struct to return a error
Returns:
FALSE if group with the same name already exists.

Definition at line 199 of file opensync_group_env.c.

Referenced by osync_group_env_load_groups().

OSYNC_EXPORT void osync_group_env_remove_group ( OSyncGroupEnv env,
OSyncGroup group 
)

Removes the given group from the enviroment.

Removes the given group from the environment

Parameters:
env Pointer to a OSyncGroupEnv environment
group The group to add

Definition at line 231 of file opensync_group_env.c.

OSYNC_EXPORT int osync_group_env_num_groups ( OSyncGroupEnv env  ) 

Counts the groups in the environment.

Returns the number of groups

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

Definition at line 240 of file opensync_group_env.c.

OSYNC_EXPORT OSyncGroup* osync_group_env_nth_group ( OSyncGroupEnv env,
int  nth 
)

Returns the nth group.

Returns the nth groups from the environment

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

Definition at line 246 of file opensync_group_env.c.


Generated on Fri Feb 13 13:33:29 2009 for OpenSync by  doxygen 1.5.7.1