Ticket #1084: ticket1084_capformats_v1.diff

File ticket1084_capformats_v1.diff, 23.6 KB (added by dgollub, 3 years ago)

Initial API desgined for OSyncFormatMerger and changes on OSyncCapabilites and retgister interface for OSyncFormatEnv - stil NOOP

  • wrapper/opensync-merger.i

     
    5151 
    5252typedef struct {} Capabilities; 
    5353%extend Capabilities { 
    54         Capabilities() { 
     54        Capabilities(const char *capsformat) { 
    5555                Error *err = NULL; 
    56                 Capabilities *caps = osync_capabilities_new(&err); 
     56                Capabilities *caps = osync_capabilities_new(capsformat, &err); 
    5757                if (raise_exception_on_error(err)) 
    5858                        return NULL; 
    5959                else 
  • opensync/opensync-format.h

     
    2525 
    2626#include "format/opensync_converter.h" 
    2727#include "format/opensync_format_env.h" 
     28#include "format/opensync_format_merger.h" 
    2829#include "format/opensync_objformat.h" 
    2930#include "format/opensync_objformat_sink.h" 
    3031 
  • opensync/CMakeLists.txt

     
    3131   format/opensync_converter.c 
    3232   format/opensync_filter.c 
    3333   format/opensync_format_env.c 
     34   format/opensync_format_merger.c 
    3435   format/opensync_objformat.c 
    3536   format/opensync_objformat_sink.c 
    3637   format/opensync_time.c 
  • opensync/opensync.h

     
    194194typedef struct OSyncObjFormat OSyncObjFormat; 
    195195typedef struct OSyncFormatConverterPath OSyncFormatConverterPath; 
    196196typedef struct OSyncFormatConverter OSyncFormatConverter; 
     197typedef struct OSyncFormatMerger OSyncFormatMerger; 
    197198typedef struct OSyncObjFormatSink OSyncObjFormatSink; 
    198199 
    199200/* Plugin component */ 
  • opensync/format/opensync_format_env_internals.h

     
    4242struct OSyncFormatEnv { 
    4343        /** A List of formats */ 
    4444        OSyncList *objformats; 
    45         /** A list of available converters */ 
     45        /** A list of available converters (OSyncFormatConverter*) */ 
    4646        OSyncList *converters; 
     47        /** A list of available mergers (OSyncFormatMerger*) */ 
     48        OSyncList *mergers; 
    4749        /** A list of filter functions */ 
    4850        OSyncList *custom_filters; 
    4951         
     
    160162OSYNC_TEST_EXPORT OSyncFormatConverter *osync_format_env_nth_converter(OSyncFormatEnv *env, int nth); 
    161163 
    162164 
     165/** @brief Finds first merger with the given objformat and capabilities format 
     166 *  
     167 * @param env Pointer to the environment 
     168 * @param objformat The object format 
     169 * @param capsformat The capabilities format 
     170 * @returns The merger, or NULL if not found 
     171 *  
     172 */ 
     173OSYNC_TEST_EXPORT OSyncFormatMerger *osync_format_env_find_merger(OSyncFormatEnv *env, OSyncObjFormat *objformat, const char *capsformat); 
     174 
    163175/*@}*/ 
    164176 
    165177#endif /* _OPENSYNC_FORMAT_ENV_INTERNALS_H_ */ 
  • opensync/format/opensync_format_merger_private.h

     
     1/* 
     2 * libopensync - A synchronization framework 
     3 * Copyright (C) 2009       Daniel Gollub <gollub@b1-systems.de> 
     4 *  
     5 * This library is free software; you can redistribute it and/or 
     6 * modify it under the terms of the GNU Lesser General Public 
     7 * License as published by the Free Software Foundation; either 
     8 * version 2.1 of the License, or (at your option) any later version. 
     9 *  
     10 * This library is distributed in the hope that it will be useful, 
     11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
     12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     13 * Lesser General Public License for more details. 
     14 *  
     15 * You should have received a copy of the GNU Lesser General Public 
     16 * License along with this library; if not, write to the Free Software 
     17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA 
     18 *  
     19 */ 
     20 
     21#ifndef OPENSYNC_FORMAT_MERGER_PRIVATE_H_ 
     22#define OPENSYNC_FORMAT_MERGER_PRIVATE_H_ 
     23 
     24/** 
     25 * @defgroup OSyncMergerPrivateAPI OpenSync Merger Private 
     26 * @ingroup OSyncFormatPrivate 
     27 * @brief Private part for creating and managing object format mergers 
     28 *  
     29 */ 
     30/*@{*/ 
     31 
     32/** @brief Represent a merger 
     33 */ 
     34struct OSyncFormatMerger { 
     35        char *capsformat; 
     36        OSyncObjFormat *objformat; 
     37        OSyncFormatMergerMergeFunc merge_func; 
     38        OSyncFormatMergerDemergeFunc demerge_func; 
     39        OSyncFormatMergerInitializeFunc initialize_func; 
     40        OSyncFormatMergerFinalizeFunc finalize_func; 
     41        int ref_count; 
     42        void *userdata; 
     43}; 
     44 
     45/*@}*/ 
     46 
     47#endif /*OPENSYNC_FORMAT_MERGER_PRIVATE_H_*/ 
  • opensync/format/opensync_format_merger.c

     
     1/* 
     2 * libopensync - A synchronization framework 
     3 * Copyright (C) 2009       Daniel Gollub <gollub@b1-systems.de> 
     4 *  
     5 * This library is free software; you can redistribute it and/or 
     6 * modify it under the terms of the GNU Lesser General Public 
     7 * License as published by the Free Software Foundation; either 
     8 * version 2.1 of the License, or (at your option) any later version. 
     9 *  
     10 * This library is distributed in the hope that it will be useful, 
     11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
     12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     13 * Lesser General Public License for more details. 
     14 *  
     15 * You should have received a copy of the GNU Lesser General Public 
     16 * License along with this library; if not, write to the Free Software 
     17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA 
     18 *  
     19 */ 
     20  
     21#include "opensync.h" 
     22#include "opensync_internals.h" 
     23 
     24#include "opensync-format.h" 
     25 
     26#include "opensync/capabilities/opensync_capabilities_internals.h" 
     27 
     28#include "opensync_format_merger_private.h" 
     29#include "opensync_format_merger_internals.h" 
     30 
     31OSyncFormatMerger *osync_format_merger_new(OSyncObjFormat *objformat, const char *capsformat, OSyncFormatMergeFunc merge_func, OSyncFormatDemergeFunc demerge_func, OSyncError **error) 
     32{ 
     33        osync_assert(capsformat); 
     34        osync_assert(objformat); 
     35 
     36        OSyncFormatMerger *merger = NULL; 
     37        osync_trace(TRACE_ENTRY, "%s(%s(%p), %s, %p, %p, %p)", __func__, __NULLSTR(osync_objformat_get_name(objformat)), objformat, __NULLSTR(capsformat), merge_func, demerge_func, error); 
     38         
     39        merger = osync_try_malloc0(sizeof(OSyncFormatMerger), error); 
     40        if (!merger) { 
     41                osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error)); 
     42                return NULL; 
     43        } 
     44         
     45        merger->objformat = objformat; 
     46        osync_objformat_ref(objformat); 
     47 
     48        merger->capsformat = osync_strdup(capsformat); 
     49         
     50        merger->merge_func = merge_func; 
     51        merger->demerge_func = demerge_func; 
     52        merger->initialize_func = NULL; 
     53        merger->finalize_func = NULL; 
     54        merger->userdata = NULL; 
     55        merger->ref_count = 1; 
     56         
     57        osync_trace(TRACE_EXIT, "%s: %p", __func__, merger); 
     58        return merger; 
     59} 
     60 
     61OSyncFormatMerger *osync_format_merger_ref(OSyncFormatMerger *merger) 
     62{ 
     63        osync_assert(merger); 
     64         
     65        g_atomic_int_inc(&(merger->ref_count)); 
     66 
     67        return merger; 
     68} 
     69 
     70void osync_format_merger_unref(OSyncFormatMerger *merger) 
     71{ 
     72        osync_assert(merger); 
     73         
     74        if (g_atomic_int_dec_and_test(&(merger->ref_count))) { 
     75                if (merger->objformat) 
     76                        osync_objformat_unref(merger->objformat); 
     77 
     78                osync_free(merger->capsformat); 
     79                         
     80                osync_free(merger); 
     81        } 
     82} 
     83 
     84OSyncObjFormat *osync_format_merger_get_objformat(OSyncFormatMerger *merger) 
     85{ 
     86        osync_return_val_if_fail(merger, NULL); 
     87        return merger->objformat; 
     88} 
     89 
     90const char *osync_format_merger_get_capsformat(OSyncFormatMerger *merger) 
     91{ 
     92        osync_return_val_if_fail(merger, NULL); 
     93        return merger->capsformat; 
     94} 
     95 
     96osync_bool osync_format_merger_merge(OSyncFormatMerger *merger, char **buffer, unsigned int *size, const char *entire_buf, unsigned int entire_size, OSyncCapabilities *caps, OSyncError **error) 
     97{ 
     98        osync_assert(merger); 
     99        osync_assert(buffer); 
     100        osync_assert(size); 
     101        osync_assert(entire_buf); 
     102        osync_assert(caps); 
     103 
     104        osync_return_val_if_fail(merger->merge_func, TRUE); 
     105         
     106        osync_trace(TRACE_ENTRY, "%s(%p, %p, %u, %p, %u, %p(%s), %p)", __func__, merger, buffer, *size, entire_buf, entire_size, caps, __NULLSTR(osync_capabilities_get_capsformat(caps)), error); 
     107         
     108        if (!merger->merge_func(buffer, size, entire_buf, entire_size, caps, merger->userdata, error)) 
     109                goto error; 
     110         
     111        osync_trace(TRACE_EXIT, "%s", __func__); 
     112        return TRUE; 
     113 
     114error: 
     115        osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error)); 
     116        return FALSE; 
     117} 
     118 
     119 
     120osync_bool osync_format_merger_demerge(OSyncFormatMerger *merger, char **buffer, unsigned int *size, OSyncCapabilities *caps, OSyncError **error) 
     121{ 
     122        osync_assert(merger); 
     123        osync_assert(buffer); 
     124        osync_assert(size); 
     125        osync_assert(caps); 
     126 
     127        osync_return_val_if_fail(merger->demerge_func, TRUE); 
     128 
     129        osync_trace(TRACE_ENTRY, "%s(%p, %p, %u, %p(%s), %p)", __func__, merger, buffer, *size, caps, __NULLSTR(osync_capabilities_get_capsformat(caps)), error); 
     130         
     131        if (!merger->demerge_func(buffer, size, caps, merger->userdata, error)) 
     132                goto error; 
     133 
     134        osync_trace(TRACE_EXIT, "%s", __func__); 
     135        return TRUE; 
     136 
     137error: 
     138        osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error)); 
     139        return FALSE; 
     140 
     141} 
     142 
     143void osync_format_merger_set_initialize_func(OSyncFormatMerger *merger, OSyncFormatMergerInitializeFunc initialize_func) 
     144{ 
     145        osync_assert(merger); 
     146        merger->initialize_func = initialize_func; 
     147         
     148} 
     149 
     150void osync_format_merger_set_finalize_func(OSyncFormatMerger *merger, OSyncFormatMergerFinalizeFunc finalize_func) 
     151{ 
     152        osync_assert(merger); 
     153        merger->finalize_func = finalize_func; 
     154} 
     155 
     156void osync_format_merger_initialize(OSyncFormatMerger *merger, const char *config, OSyncError **error) { 
     157 
     158        osync_assert(merger); 
     159 
     160        if (merger->initialize_func) { 
     161                merger->userdata = merger->initialize_func(config, error); 
     162        } 
     163} 
     164 
     165void osync_format_merger_finalize(OSyncFormatMerger *merger) 
     166{ 
     167        osync_assert(merger); 
     168 
     169        if (merger->finalize_func) { 
     170                merger->finalize_func(merger->userdata); 
     171        } 
     172} 
     173 
  • opensync/format/opensync_format_merger.h

     
     1/* 
     2 * libopensync - A synchronization framework 
     3 * Copyright (C) 2009       Daniel Gollub <gollub@b1-systems.de> 
     4 * 
     5 * This library is free software; you can redistribute it and/or 
     6 * modify it under the terms of the GNU Lesser General Public 
     7 * License as published by the Free Software Foundation; either 
     8 * version 2.1 of the License, or (at your option) any later version. 
     9 * 
     10 * This library is distributed in the hope that it will be useful, 
     11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
     12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     13 * Lesser General Public License for more details. 
     14 * 
     15 * You should have received a copy of the GNU Lesser General Public 
     16 * License along with this library; if not, write to the Free Software 
     17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA 
     18 * 
     19 */ 
     20 
     21#ifndef _OPENSYNC_FORMAT_MERGER_H_ 
     22#define _OPENSYNC_FORMAT_MERGER_H_ 
     23 
     24/** 
     25 * @defgroup OSyncMergerAPI OpenSync Merger 
     26 * @ingroup OSyncFormat 
     27 * @brief Functions for creating and managing format mergers 
     28 * 
     29 */ 
     30/*@{*/ 
     31 
     32typedef void * (* OSyncFormatMergerInitializeFunc) (const char *config, OSyncError **error); 
     33typedef void (* OSyncFormatMergerFinalizeFunc) (void *userdata); 
     34 
     35typedef osync_bool (* OSyncFormatMergerMergeFunc) (char **data, unsigned int *size, const char *entire, unsigned int entsize, OSyncCapabilities *caps, void *user_data, OSyncError **error); 
     36typedef osync_bool (* OSyncFormatMergerDemergeFunc) (char **data, unsigned int *size, OSyncCapabilities *caps, void *user_data, OSyncError **error); 
     37 
     38 
     39/** 
     40 * @brief Creates a new merger 
     41 * @param type the type of merger 
     42 * @param sourceformat the source format for the merger 
     43 * @param targetformat the target format for the merger 
     44 * @param convert_func the merger function 
     45 * @param error Pointer to an error struct 
     46 * @returns The pointer to the newly allocated merger or NULL in case of error 
     47 */ 
     48OSYNC_EXPORT OSyncFormatMerger *osync_format_merger_new(OSyncObjFormat *objformat, const char *capsformat, OSyncFormatMergerMergeFunc merge_func, OSyncFormatMergerDemergeFunc demerge_func, OSyncError **error); 
     49 
     50/** @brief Increase the reference count on a merger 
     51 * 
     52 * @param merger Pointer to the merger 
     53 * 
     54 */ 
     55OSYNC_EXPORT OSyncFormatMerger *osync_format_merger_ref(OSyncFormatMerger *merger); 
     56 
     57/** @brief Decrease the reference count on a merger 
     58 * 
     59 * @param merger Pointer to the merger 
     60 * 
     61 */ 
     62OSYNC_EXPORT void osync_format_merger_unref(OSyncFormatMerger *merger); 
     63 
     64/** 
     65 * @brief Returns the object format of a merger 
     66 * @param merger Pointer to the merger 
     67 * @returns The object format of the specified merger 
     68 */ 
     69OSYNC_EXPORT OSyncObjFormat *osync_format_merger_get_objformat(OSyncFormatMerger *merger); 
     70 
     71/** 
     72 * @brief Returns the capabilities format (name)  
     73 * @param merger Pointer to the merger 
     74 * @returns The capabilities format (name) 
     75 */ 
     76OSYNC_EXPORT const char *osync_format_merger_get_capsformat(OSyncFormatMerger *merger); 
     77 
     78/** 
     79 * @brief Sets the initialize function of a merger 
     80 * @param merger Pointer to the merger 
     81 * @param initialize_func Pointer to the initialize function 
     82 */ 
     83OSYNC_EXPORT void osync_format_merger_set_initialize_func(OSyncFormatMerger *merger, OSyncFormatMergerInitializeFunc initialize_func); 
     84 
     85/** 
     86 * @brief Sets the finalize function of a merger 
     87 * @param merger Pointer to the merger 
     88 * @param finalize_func Pointer to the finalize function 
     89 */ 
     90OSYNC_EXPORT void osync_format_merger_set_finalize_func(OSyncFormatMerger *merger, OSyncFormatMergerFinalizeFunc finalize_func); 
     91 
     92/** 
     93 * @brief Invokes initialize function of a merger 
     94 * 
     95 * @param merger Pointer to the merger which should be initialized 
     96 * @param config configuration 
     97 * @param error Pointer to an error struct 
     98 * 
     99 * @todo config is not used currently. Should be used in the future to pass a directory for xml format schema location 
     100 */ 
     101OSYNC_EXPORT void osync_format_merger_initialize(OSyncFormatMerger *merger, const char *config, OSyncError **error); 
     102 
     103/** 
     104 * @brief Invokes finalize function of a merger 
     105 * 
     106 * @param merger Pointer to the merger which should be finalized 
     107 */ 
     108OSYNC_EXPORT void osync_format_merger_finalize(OSyncFormatMerger *merger); 
     109 
     110/*@}*/ 
     111 
     112#endif /*_OPENSYNC_FORMAT_MERGER_H_*/ 
     113 
  • opensync/format/opensync_format_env.c

     
    766766                        osync_converter_unref(env->converters->data); 
    767767                        env->converters = osync_list_remove(env->converters, env->converters->data); 
    768768                } 
     769 
     770                /* Free the mergers */ 
     771                while (env->mergers) { 
     772                        osync_converter_unref(env->mergers->data); 
     773                        env->mergers = osync_list_remove(env->mergers, env->mergers->data); 
     774                } 
     775 
    769776         
    770777                /* Free the filters */ 
    771778                while (env->custom_filters) { 
     
    811818        return FALSE; 
    812819} 
    813820 
     821/* ObjFormats */ 
     822 
    814823void osync_format_env_register_objformat(OSyncFormatEnv *env, OSyncObjFormat *format) 
    815824{ 
    816825        osync_assert(env); 
     
    853862        return osync_list_copy(env->objformats); 
    854863} 
    855864 
     865/* Converters */ 
     866 
    856867void osync_format_env_register_converter(OSyncFormatEnv *env, OSyncFormatConverter *converter) 
    857868{ 
    858869        osync_assert(env); 
     
    934945        return osync_list_copy(env->converters); 
    935946} 
    936947 
     948/* Filters */ 
     949 
    937950void osync_format_env_register_filter(OSyncFormatEnv *env, OSyncCustomFilter *filter) 
    938951{ 
    939952        osync_assert(env); 
     
    11871200        return path; 
    11881201} 
    11891202 
     1203/* Mergers */ 
     1204 
     1205void osync_format_env_register_merger(OSyncFormatEnv *env, OSyncFormatMerger *merger) 
     1206{ 
     1207        osync_return_if_fail(env); 
     1208        osync_return_if_fail(merger); 
     1209         
     1210        env->mergers = osync_list_append(env->mergers, merger); 
     1211        osync_format_merger_ref(merger); 
     1212} 
     1213 
     1214OSyncFormatMerger *osync_format_env_find_merger(OSyncFormatEnv *env, OSyncObjFormat *objformat, const char *capsformat) 
     1215{ 
     1216        OSyncList *c = NULL; 
     1217 
     1218        osync_return_val_if_fail(env, NULL); 
     1219        osync_return_val_if_fail(objformat, NULL); 
     1220        osync_return_val_if_fail(capsformat, NULL); 
     1221         
     1222        for (c = env->mergers; c; c = c->next) { 
     1223                OSyncFormatMerger *merger = c->data; 
     1224                if (!osync_objformat_is_equal(objformat, osync_format_merger_get_objformat(merger))) 
     1225                        continue; 
     1226                         
     1227                if (!strcmp(capsformat, osync_format_merger_get_capsformat(merger))) 
     1228                        continue; 
     1229                 
     1230                return merger; 
     1231        } 
     1232         
     1233        return NULL; 
     1234} 
     1235 
  • opensync/format/opensync_format_env.h

     
    245245 */ 
    246246OSYNC_EXPORT OSyncFormatConverterPath *osync_format_env_find_path_formats_with_detectors(OSyncFormatEnv *env, OSyncData *sourcedata, OSyncList *targets, const char *preferred_format, OSyncError **error); 
    247247 
     248 
     249/** @brief Registers Format Merger/Demerger 
     250 *  
     251 * @param env The format environment 
     252 * @param converter Pointer of the Format Merger/Demerger  
     253 */ 
     254OSYNC_EXPORT void osync_format_env_register_merger(OSyncFormatEnv *env, OSyncFormatMerger *merger); 
     255 
    248256/*@}*/ 
    249257 
    250258#endif /* _OPENSYNC_FORMAT_ENV_H_ */ 
  • opensync/format/opensync_format_merger_internals.h

     
     1/* 
     2 * libopensync - A synchronization framework 
     3 * Copyright (C) 2009       Daniel Gollub <gollub@b1-systems.de> 
     4 * 
     5 * This library is free software; you can redistribute it and/or 
     6 * modify it under the terms of the GNU Lesser General Public 
     7 * License as published by the Free Software Foundation; either 
     8 * version 2.1 of the License, or (at your option) any later version. 
     9 * 
     10 * This library is distributed in the hope that it will be useful, 
     11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
     12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     13 * Lesser General Public License for more details. 
     14 * 
     15 * You should have received a copy of the GNU Lesser General Public 
     16 * License along with this library; if not, write to the Free Software 
     17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA 
     18 * 
     19 */ 
     20 
     21#ifndef _OPENSYNC_FORMAT_MERGER_INTERNALS_H_ 
     22#define _OPENSYNC_FORMAT_MERGER_INTERNALS_H_ 
     23 
     24#endif /*_OPENSYNC_FORMAT_MERGER_INTERNALS_H_*/ 
     25 
  • opensync/capabilities/opensync_capabilities_private.h

     
    6363        OSyncCapabilitiesObjType *last_objtype; 
    6464        /** The wrapped xml document */ 
    6565        xmlDocPtr doc; 
     66        /** The capabilities format name */ 
     67        char *capsformat; 
    6668}; 
    6769 
    6870/** 
  • opensync/capabilities/opensync_capabilities.c

     
    7575 
    7676/* end of private part */ 
    7777 
    78 OSyncCapabilities *osync_capabilities_new(OSyncError **error) 
     78OSyncCapabilities *osync_capabilities_new(const char *capsformat, OSyncError **error) 
    7979{ 
     80        osync_assert(capsformat); 
     81 
    8082        OSyncCapabilities *capabilities = NULL; 
    8183        osync_trace(TRACE_ENTRY, "%s(%p)", __func__, error); 
    8284         
     
    8789        } 
    8890         
    8991        capabilities->ref_count = 1; 
     92        capabilities->capsformat = osync_strdup(capsformat); 
    9093        capabilities->first_objtype = NULL; 
    9194        capabilities->last_objtype = NULL; 
    9295        capabilities->doc = xmlNewDoc(BAD_CAST "1.0"); 
     
    176179                                objtype = tmp; 
    177180                        } 
    178181                osync_xml_free_doc(capabilities->doc); 
     182 
     183                osync_free(capabilities->capsformat); 
     184                 
    179185                osync_free(capabilities); 
    180186        } 
    181187} 
     
    353359        return res; 
    354360} 
    355361 
     362const char *osync_capabilities_get_capsformat(OSyncCapabilities *capabilities) 
     363{ 
     364        osync_return_val_if_fail(capabilities, NULL); 
     365        return capabilities->capsformat; 
     366} 
     367 
  • opensync/capabilities/opensync_capabilities_internals.h

     
    8181 */ 
    8282osync_bool osync_capabilities_member_set_capabilities(OSyncMember *member, OSyncCapabilities* capabilities, OSyncError** error); 
    8383 
     84/** 
     85 * @brief Get the capabilities format (name). 
     86 * 
     87 * @param capabilities Te pointer to a capabilities object 
     88 * @return The capabilities format (name) 
     89 */ 
     90OSYNC_TEST_EXPORT const char *osync_capabilities_get_capsformat(OSyncCapabilities *capabilities); 
     91 
    8492/*@}*/ 
    8593 
    8694#endif /*OPENSYNC_CAPABILITIES_INTERNAL_H_*/ 
  • opensync/capabilities/opensync_capabilities.h

     
    3636 
    3737/** 
    3838 * @brief Creates a new capabilities object 
     39 * @param capsformat The capabilities format name 
    3940 * @param error The error which will hold the info in case of an error 
    4041 * @return The pointer to the newly allocated capabilities object or NULL in case of error 
    4142 */ 
    42 OSYNC_EXPORT OSyncCapabilities *osync_capabilities_new(OSyncError **error); 
     43OSYNC_EXPORT OSyncCapabilities *osync_capabilities_new(const char *capsformat, OSyncError **error); 
    4344 
    4445/** 
    4546 * @brief Creates a new capabilities object from an xml document.  
  • tests/capabilities-tests/check_capabilities.c

     
    88        char *testbed = setup_testbed("capabilities"); 
    99 
    1010        OSyncError *error = NULL; 
    11         OSyncCapabilities *capabilities = osync_capabilities_new(&error); 
     11        OSyncCapabilities *capabilities = osync_capabilities_new("dummy-caps", &error); 
    1212        fail_unless(capabilities != NULL, NULL); 
    1313        fail_unless(error == NULL, NULL); 
    1414         
     
    2626        char *testbed = setup_testbed("capabilities"); 
    2727 
    2828        OSyncError *error = NULL; 
    29         OSyncCapabilities *capabilities = osync_capabilities_new(&error); 
     29        OSyncCapabilities *capabilities = osync_capabilities_new("dummy-caps", &error); 
    3030        fail_unless(capabilities != NULL, NULL); 
    3131        fail_unless(error == NULL, NULL); 
    3232         
  • opensync.sym

     
    153153osync_format_env_new 
    154154osync_format_env_ref 
    155155osync_format_env_register_converter 
     156osync_format_env_register_merger 
    156157osync_format_env_register_objformat 
    157158osync_format_env_unref 
     159osync_format_merger_finalize 
     160osync_format_merger_get_capsformat 
     161osync_format_merger_get_objformat 
     162osync_format_merger_initialize 
     163osync_format_merger_new 
     164osync_format_merger_ref 
     165osync_format_merger_set_finalize_func 
     166osync_format_merger_set_initialize_func 
     167osync_format_merger_unref 
    158168osync_free 
    159169osync_get_version 
    160170osync_group_add_member