OpenSync Filter Internals
[OpenSync Format Module Private]

OpenSync format filters internal API. More...


Typedefs

typedef struct OSyncFilter OSyncFilter
typedef struct OSyncCustomFilter OSyncCustomFilter
typedef osync_bool(* OSyncFilterFunction )(OSyncData *data, const char *config)

Enumerations

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

Functions

OSYNC_TEST_EXPORT OSyncFilterosync_filter_new (const char *objtype, OSyncFilterAction action, OSyncError **error)
 Creates a new filter.
OSYNC_TEST_EXPORT OSyncFilterosync_filter_new_custom (OSyncCustomFilter *custom_filter, const char *config, OSyncFilterAction action, OSyncError **error)
 Creates a new filter that uses a custom filter.
OSyncFilterosync_filter_ref (OSyncFilter *filter)
 Increase the reference count on a filter.
OSYNC_TEST_EXPORT void osync_filter_unref (OSyncFilter *filter)
 Decrease the reference count on a filter.
OSYNC_TEST_EXPORT void osync_filter_set_config (OSyncFilter *filter, const char *config)
 Sets the config for a filter.
OSYNC_TEST_EXPORT const char * osync_filter_get_config (OSyncFilter *filter)
 Gets the config of a filter.
OSYNC_TEST_EXPORT const char * osync_filter_get_objtype (OSyncFilter *filter)
 Gets the object type of a filter.
OSyncFilterAction osync_filter_invoke (OSyncFilter *filter, OSyncData *data)
 Invokes a filter on a data object.
OSYNC_TEST_EXPORT
OSyncCustomFilter
osync_custom_filter_new (const char *objtype, const char *objformat, const char *name, OSyncFilterFunction hook, OSyncError **error)
 Creates a new custom filter.
OSyncCustomFilterosync_custom_filter_ref (OSyncCustomFilter *filter)
 Increase the reference count on a custom filter.
OSYNC_TEST_EXPORT void osync_custom_filter_unref (OSyncCustomFilter *filter)
 Decrease the reference count on a custom filter.
osync_bool osync_custom_filter_invoke (OSyncCustomFilter *filter, OSyncData *data, const char *config)
 Invokes a custom filter on a data object.


Detailed Description

OpenSync format filters internal API.

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 (overrides previous action)
OSYNC_FILTER_DENY  The change should be prevented from passing (overrides previous action)

Definition at line 37 of file opensync_filter_internals.h.


Function Documentation

OSYNC_TEST_EXPORT OSyncFilter* osync_filter_new ( const char *  objtype,
OSyncFilterAction  action,
OSyncError **  error 
)

Creates a new filter.

Parameters:
objtype the object type handled by the filter
action the action that should be invoked by the filter
error Pointer to an error struct
Returns:
A newly allocated filter

Definition at line 29 of file opensync_filter.c.

OSYNC_TEST_EXPORT OSyncFilter* osync_filter_new_custom ( OSyncCustomFilter custom_filter,
const char *  config,
OSyncFilterAction  action,
OSyncError **  error 
)

Creates a new filter that uses a custom filter.

Parameters:
custom_filter Custom filter to use
config configuration to be used by the custom filter. Must be a null-terminated string.
action the action that should be invoked by the filter
error Pointer to an error struct
Returns:
A newly allocated filter

Definition at line 50 of file opensync_filter.c.

OSyncFilter* osync_filter_ref ( OSyncFilter filter  ) 

Increase the reference count on a filter.

Parameters:
filter Pointer to the filter

Definition at line 74 of file opensync_filter.c.

Referenced by osync_group_add_filter().

OSYNC_TEST_EXPORT void osync_filter_unref ( OSyncFilter filter  ) 

Decrease the reference count on a filter.

Parameters:
filter Pointer to the filter

Definition at line 83 of file opensync_filter.c.

Referenced by osync_group_remove_filter().

OSYNC_TEST_EXPORT 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 98 of file opensync_filter.c.

OSYNC_TEST_EXPORT 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 110 of file opensync_filter.c.

OSYNC_TEST_EXPORT const char* osync_filter_get_objtype ( OSyncFilter filter  ) 

Gets the object type of a filter.

Parameters:
filter The filter
Returns:
The object type handled by the specified filter

Definition at line 116 of file opensync_filter.c.

OSyncFilterAction osync_filter_invoke ( OSyncFilter filter,
OSyncData data 
)

Invokes a filter on a data object.

Parameters:
filter The filter
data The data to be passed into the filter
Returns:
The result of the filter (action)

Definition at line 122 of file opensync_filter.c.

OSYNC_TEST_EXPORT OSyncCustomFilter* osync_custom_filter_new ( const char *  objtype,
const char *  objformat,
const char *  name,
OSyncFilterFunction  hook,
OSyncError **  error 
)

Creates a new custom filter.

Parameters:
objtype the object type handled by the custom filter
objformat the object format handled by the custom filter
name name of the custom filter
hook the filter callback function
error Pointer to an error struct
Returns:
A newly allocated custom filter

Definition at line 147 of file opensync_filter.c.

OSyncCustomFilter* osync_custom_filter_ref ( OSyncCustomFilter filter  ) 

Increase the reference count on a custom filter.

Parameters:
filter Pointer to the custom filter

Definition at line 170 of file opensync_filter.c.

Referenced by osync_filter_new_custom(), and osync_format_env_register_filter().

OSYNC_TEST_EXPORT void osync_custom_filter_unref ( OSyncCustomFilter filter  ) 

Decrease the reference count on a custom filter.

Parameters:
filter Pointer to the custom filter

Definition at line 179 of file opensync_filter.c.

Referenced by osync_format_env_unref().

osync_bool osync_custom_filter_invoke ( OSyncCustomFilter filter,
OSyncData data,
const char *  config 
)

Invokes a custom filter on a data object.

Parameters:
filter The custom filter
data The data to be passed into the custom filter
config Configuration to be used by the custom filter. Must be a null-terminated string.
Returns:
The result of the filter (action)

Definition at line 197 of file opensync_filter.c.

Referenced by osync_filter_invoke().


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