Add an API to be able to pass information to the vio module.

Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Olivier Goffart 2012-12-04 13:42:16 +01:00 committed by Andreas Schneider
parent bec2c4a2ea
commit 68fdf56db7
4 changed files with 49 additions and 21 deletions

View file

@ -937,3 +937,10 @@ int csync_set_iconv_codec(const char *from)
return 0;
}
#endif
int csync_set_module_property(CSYNC* ctx, const char* key, void* value)
{
return csync_vio_set_property(ctx, key, value);
}
/* vim: set ts=8 sw=2 et cindent: */

View file

@ -513,6 +513,19 @@ const char *csync_get_status_string(CSYNC *ctx);
int csync_set_iconv_codec(const char *from);
#endif
/**
* @brief Set a property to module
*
* @param ctx The csync context.
*
* @param key The property key
*
* @param value An opaque pointer to the data.
*
* @return 0 on success, less than 0 if an error occured.
*/
int csync_set_module_property(CSYNC *ctx, const char *key, void *value);
#ifdef __cplusplus
}
#endif

View file

@ -586,3 +586,11 @@ char *csync_vio_get_status_string(CSYNC *ctx)
}
return NULL;
}
int csync_vio_set_property(CSYNC* ctx, const char* key, void* data)
{
int rc = -1;
if(VIO_METHOD_HAS_FUNC(ctx->module.method, set_property))
rc = ctx->module.method->set_property(key, data);
return rc;
}