Beispiel #1
0
osync_bool get_format_info(OSyncFormatEnv *env, OSyncError **error)
{
	OSyncObjFormat *format = osync_objformat_new("file", "data", error);
	if (!format)
		goto error;

	osync_objformat_set_compare_func(format, compare_file);
	osync_objformat_set_destroy_func(format, destroy_file);
	osync_objformat_set_duplicate_func(format, duplicate_file);
	osync_objformat_set_print_func(format, print_file);
	osync_objformat_set_revision_func(format, revision_file);
	osync_objformat_set_copy_func(format, copy_file);

	osync_objformat_set_marshal_func(format, marshal_file);
	osync_objformat_set_demarshal_func(format, demarshal_file);

	if (!osync_format_env_register_objformat(env, format, error))
		goto error;

	osync_objformat_unref(format);
	return TRUE;

error:
	return FALSE;
}
Beispiel #2
0
static void _format_set_functions(OSyncObjFormat *format)
{
    osync_objformat_set_compare_func(format, compare_file);
    osync_objformat_set_destroy_func(format, destroy_file);
    osync_objformat_set_duplicate_func(format, duplicate_file);
    osync_objformat_set_print_func(format, print_file);
    osync_objformat_set_revision_func(format, revision_file);
    osync_objformat_set_copy_func(format, copy_file);
    osync_objformat_set_create_func(format, create_file);

    osync_objformat_set_marshal_func(format, marshal_file);
    osync_objformat_set_demarshal_func(format, demarshal_file);
}
static void _format_set_functions(OSyncObjFormat *format)
{
	osync_objformat_set_compare_func(format, compare_file);
	osync_objformat_set_destroy_func(format, destroy_file);
	osync_objformat_set_duplicate_func(format, duplicate_file);
	osync_objformat_set_print_func(format, print_file);
	osync_objformat_set_revision_func(format, revision_file);
	osync_objformat_set_copy_func(format, copy_file);
	osync_objformat_set_create_func(format, create_file);
	
	/* TODO ... marshal function is only valid for mockformat1 not mockformat2! */
	osync_objformat_set_marshal_func(format, marshal_file);
	osync_objformat_set_demarshal_func(format, demarshal_file);
}