Changeset 3427
- Timestamp:
- 07/10/08 08:52:23 (2 months ago)
- Files:
-
- trunk/opensync/CMakeLists.txt (modified) (2 diffs)
- trunk/opensync/opensync-xmlformat.h (modified) (1 diff)
- trunk/opensync/opensync.h (modified) (1 diff)
- trunk/opensync/xmlformat/opensync-xmlformat_internals.h (modified) (1 diff)
- trunk/opensync/xmlformat/opensync_xmlformat.c (modified) (2 diffs)
- trunk/opensync/xmlformat/opensync_xmlformat.h (modified) (1 diff)
- trunk/opensync/xmlformat/opensync_xmlformat_internals.h (modified) (2 diffs)
- trunk/opensync/xmlformat/opensync_xmlformat_schema.c (added)
- trunk/opensync/xmlformat/opensync_xmlformat_schema.h (added)
- trunk/opensync/xmlformat/opensync_xmlformat_schema_internals.h (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/opensync/CMakeLists.txt
r3426 r3427 58 58 xmlformat/opensync_xmlfieldlist.c 59 59 xmlformat/opensync_xmlformat.c 60 xmlformat/opensync_xmlformat_schema.c 60 61 ) 61 62 … … 127 128 ) 128 129 ADD_EXECUTABLE( osplugin ${osplugin_SRCS} ) 130 131 IF(COMMAND cmake_policy) 132 cmake_policy(SET CMP0005 OLD) 133 ENDIF(COMMAND cmake_policy) 134 129 135 ADD_DEFINITIONS( -DOSPLUGIN="\\\"${OPENSYNC_LIBEXEC_DIR}/osplugin\\\"" ) 130 136 trunk/opensync/opensync-xmlformat.h
r3366 r3427 25 25 26 26 #include "xmlformat/opensync_xmlformat.h" 27 #include "xmlformat/opensync_xmlformat_schema.h" 27 28 #include "xmlformat/opensync_xmlfield.h" 28 29 #include "xmlformat/opensync_xmlfieldlist.h" trunk/opensync/opensync.h
r3311 r3427 178 178 typedef struct OSyncCapability OSyncCapability; 179 179 typedef struct OSyncXMLFormat OSyncXMLFormat; 180 typedef struct OSyncXMLFormatSchema OSyncXMLFormatSchema; 180 181 typedef struct OSyncXMLField OSyncXMLField; 181 182 typedef struct OSyncXMLFieldList OSyncXMLFieldList; trunk/opensync/xmlformat/opensync-xmlformat_internals.h
r3368 r3427 27 27 28 28 #include "opensync_xmlformat_internals.h" 29 #include "opensync_xmlformat_schema_internals.h" 29 30 #include "opensync_xmlfield_internals.h" 30 31 #include "opensync_xmlfieldlist_internals.h" trunk/opensync/xmlformat/opensync_xmlformat.c
r3365 r3427 90 90 osync_trace(TRACE_EXIT, "%s: %i", __func__, p); 91 91 return p; 92 }93 94 /**95 * @brief Validate the xmlformat against its schema in inidivual path96 * @param xmlformat The pointer to a xmlformat object97 * @param path The individual schema path. If NULL the default OPENSYNC_SCHEMASDIR is used.98 * @return TRUE if xmlformat valid else FALSE99 */100 osync_bool _osync_xmlformat_validate(OSyncXMLFormat *xmlformat, const char *path)101 {102 osync_assert(xmlformat);103 104 char *schemafilepath = g_strdup_printf("%s%c%s%s%s",105 path ? path : OPENSYNC_SCHEMASDIR,106 G_DIR_SEPARATOR,107 "xmlformat-",108 osync_xmlformat_get_objtype(xmlformat),109 ".xsd");110 osync_bool res = osync_xml_validate_document(xmlformat->doc, schemafilepath);111 g_free(schemafilepath);112 113 return res;114 92 } 115 93 … … 395 373 * @brief Validate the xmlformat against its schema 396 374 * @param xmlformat The pointer to a xmlformat object 375 * @param error The error which will hold the info in case of an error 397 376 * @return TRUE if xmlformat valid else FALSE 398 377 */ 399 osync_bool osync_xmlformat_validate(OSyncXMLFormat *xmlformat) 400 { 401 osync_assert(xmlformat); 402 403 return _osync_xmlformat_validate(xmlformat, NULL); 378 osync_bool osync_xmlformat_validate(OSyncXMLFormat *xmlformat, OSyncError **error) 379 { 380 osync_assert(xmlformat); 381 382 OSyncXMLFormatSchema * schema = osync_xmlformat_schema_get_instance(xmlformat, error); 383 return osync_xmlformat_schema_validate(schema, xmlformat, error); 404 384 } 405 385 trunk/opensync/xmlformat/opensync_xmlformat.h
r3365 r3427 49 49 50 50 OSYNC_EXPORT osync_bool osync_xmlformat_assemble(OSyncXMLFormat *xmlformat, char **buffer, unsigned int *size); 51 OSYNC_EXPORT osync_bool osync_xmlformat_validate(OSyncXMLFormat *xmlformat );51 OSYNC_EXPORT osync_bool osync_xmlformat_validate(OSyncXMLFormat *xmlformat, OSyncError **error); 52 52 53 53 OSYNC_EXPORT void osync_xmlformat_sort(OSyncXMLFormat *xmlformat); trunk/opensync/xmlformat/opensync_xmlformat_internals.h
r3365 r3427 24 24 #define OPENSYNC_XMLFORMAT_INTERNALS_H_ 25 25 26 #include <opensync/opensync_xml.h>27 26 28 27 /** … … 47 46 48 47 int _osync_xmlformat_get_points(OSyncXMLPoints points[], int* cur_pos, int basic_points, const char* fieldname); 49 osync_bool _osync_xmlformat_validate(OSyncXMLFormat *xmlformat, const char *path); 48 50 49 51 50 #endif /*OPENSYNC_XMLFORMAT_INTERNAL_H_*/
