OpenSync Filter
[OpenSync Public API]

Allows filtering of changes and applying hooks to changes as they pass through opensync. More...


Enumerations

enum  OSyncFilterAction { OSYNC_FILTER_IGNORE = 0, OSYNC_FILTER_ALLOW = 1, OSYNC_FILTER_DENY = 2 }
 The action that should be invoked. More...

Functions

void osync_filter_register (OSyncGroup *group, OSyncFilter *filter)
 Registers a filter with a group.
OSyncFilterosync_filter_new (void)
 Creates a new filter.
void osync_filter_free (OSyncFilter *filter)
 Frees a filter.
OSyncFilterosync_filter_add (OSyncGroup *group, OSyncMember *sourcemember, OSyncMember *destmember, const char *sourceobjtype, const char *destobjtype, const char *detectobjtype, OSyncFilterAction action)
 Register a new filter.
void osync_filter_remove (OSyncGroup *group, OSyncFilter *filter)
 Removes a filter from a group.
OSyncFilterosync_filter_add_custom (OSyncGroup *group, OSyncMember *sourcemember, OSyncMember *destmember, const char *sourceobjtype, const char *destobjtype, const char *detectobjtype, const char *function_name)
 Register a new custom filter.
void osync_filter_set_config (OSyncFilter *filter, const char *config)
 Sets the config for a filter.
const char * osync_filter_get_config (OSyncFilter *filter)
 Gets the config of a filter.


Detailed Description

Allows filtering of changes and applying hooks to changes as they pass through opensync.

Enumeration Type Documentation

The action that should be invoked.

Enumerator:
OSYNC_FILTER_IGNORE  This filter should be ignored
OSYNC_FILTER_ALLOW  The change should be allowed to pass (Overwrites previous action)
OSYNC_FILTER_DENY  The change should be denied to pass (Overwrites previous action)

Definition at line 5 of file opensync_filter.h.


Function Documentation

void osync_filter_register ( OSyncGroup group,
OSyncFilter filter 
)

Registers a filter with a group.

Parameters:
group The group in which to register the filter
filter The filter to register

Definition at line 185 of file opensync_filter.c.

Referenced by osync_group_load().

OSyncFilter* osync_filter_new ( void   ) 

Creates a new filter.

Returns:
A newly allocated filter

Definition at line 197 of file opensync_filter.c.

Referenced by osync_group_load().

void osync_filter_free ( OSyncFilter filter  ) 

Frees a filter.

Parameters:
filter The filter to free

Definition at line 210 of file opensync_filter.c.

Referenced by osync_group_flush_filters().

OSyncFilter* osync_filter_add ( OSyncGroup group,
OSyncMember sourcemember,
OSyncMember destmember,
const char *  sourceobjtype,
const char *  destobjtype,
const char *  detectobjtype,
OSyncFilterAction  action 
)

Register a new filter.

Parameters:
group For which group to register the filter
sourcemember The member reporting the object. NULL for any
destmember The member receiving the object. NULL for any
sourceobjtype The objtype as reported by the member without detection. NULL for any
destobjtype The objtype as about being saved by the member without detection. NULL for any
detectobjtype The objtype as detected. NULL for ignore
action Set this to the action the filter should return for the object
Returns:
The new added Filter

Definition at line 236 of file opensync_filter.c.

void osync_filter_remove ( OSyncGroup group,
OSyncFilter filter 
)

Removes a filter from a group.

Parameters:
group The group to remove from
filter The filter to remove

Definition at line 260 of file opensync_filter.c.

OSyncFilter* osync_filter_add_custom ( OSyncGroup group,
OSyncMember sourcemember,
OSyncMember destmember,
const char *  sourceobjtype,
const char *  destobjtype,
const char *  detectobjtype,
const char *  function_name 
)

Register a new custom filter.

Parameters:
group The group that should store the filter
sourcemember The member reporting the object. NULL for any
destmember The member receiving the object. NULL for any
sourceobjtype The objtype as reported by the member without detection. NULL for any
destobjtype The object type has it is being added on the target. NULL for any
detectobjtype The objtype as detected. NULL for any
function_name The filter function to call to decide if to filter the object.
Returns:
The new added Filter

Definition at line 280 of file opensync_filter.c.

void osync_filter_set_config ( OSyncFilter filter,
const char *  config 
)

Sets the config for a filter.

Config must be a null-terminated string

Parameters:
filter The filter
config The new config for this filter

Definition at line 305 of file opensync_filter.c.

const char* osync_filter_get_config ( OSyncFilter filter  ) 

Gets the config of a filter.

Parameters:
filter The filter
Returns:
The config of this filter

Definition at line 320 of file opensync_filter.c.


Generated on Wed Mar 25 15:19:27 2009 for OpenSync by  doxygen 1.5.8