SET( LIBWBXML_VERSION_MAJOR "0" )
SET( LIBWBXML_VERSION_MINOR "11" )
-SET( LIBWBXML_VERSION_PATCH "6" )
+SET( LIBWBXML_VERSION_PATCH "7" )
IF( LIBWBXML_VERSION_BETA )
IF( LIBWBXML_VERSION_BETA VERSION_GREATER 90 )
MATH( EXPR LIBWBXML_VERSION_MINOR "${LIBWBXML_VERSION_MINOR} - 1" )
# UPDATE: last release.
# UPDATE: Set REVISION to 0 if any interface have been added, removed or
# UPDATE: changed since the last update.
-SET( LIBWBXML_LIBVERSION_REVISION 6 )
+SET( LIBWBXML_LIBVERSION_REVISION 7 )
# The difference between the newest and the oldest interfaces.
# UPDATE: If any interface have been added since the last public
SET( LIBWBXML_LIBVERSION_VERSION "${LIBWBXML_LIBVERSION_SOVERSION}.${LIBWBXML_LIBVERSION_AGE}.${LIBWBXML_LIBVERSION_REVISION}" )
+# this hack protects the SO versioning of the library
+# it makes the exposing of internal header files possible and safe
+# usual library version: 2.6.1
+# special library version: 20601.0.0
+IF( WBXML_INSTALL_FULL_HEADERS )
+
+ # calculate big major version
+ MATH( EXPR LIBWBXML_LIBVERSION_SOVERSION "10000 * ${LIBWBXML_LIBVERSION_SOVERSION} + 100 * ${LIBWBXML_LIBVERSION_AGE} + ${LIBWBXML_LIBVERSION_REVISION}" )
+
+ # build a x.0.0 version
+ SET( LIBWBXML_LIBVERSION_VERSION "${LIBWBXML_LIBVERSION_SOVERSION}.0.0" )
+
+ENDIF( WBXML_INSTALL_FULL_HEADERS )
+
CMAKE_MINIMUM_REQUIRED(VERSION 2.4)
# TODO: Move to external file/macro
OPTION( WBXML_SUPPORT_WV "enable WV support" ON )
OPTION( WBXML_SUPPORT_AIRSYNC "enable AIRSYNC support" ON )
OPTION( WBXML_SUPPORT_CONML "enable Nokia ConML support" ON )
+OPTION( WBXML_INSTALL_FULL_HEADERS "install internal headers" OFF )
SET( PACKAGE "libwbxml" )
SET( PACKAGE_BUGREPORT " " )
SHOW_STATUS( BUILD_DOCUMENTATION "build dynamic documentation\t" )
SHOW_STATUS( WBXML_SUPPORT_ICONV "enable iconv support\t\t" )
SHOW_STATUS( ENABLE_INSTALL_DOC "install documentation\t" )
+SHOW_STATUS( WBXML_INSTALL_FULL_HEADERS "install internal headers\t" )
# fatal error detection
IF ( FATAL_ERROR_EXPAT )
+2020-04-15 Michael Bell <michael.bell@web.de>
+ * Released 0.11.7
+ * Added WBXML_INSTALL_FULL_HEADERS cmake flag to expose internal API
+ headers; changes version for compatibility (e.g. 2.6.1 -> 20601.0.0)
+ (pull request #67 from David Llewellyn-Jones)
+ * Link to libexpat correctly (private). Therefore the tools wbxml2xml
+ and xml2wbxml do no longer link directly to libexpat.
+ (pull request #65 from Peter Keresztes Schmidt)
+ * During build use headers which come with source code and not the
+ installed headers. (pull request #66 from David Llewellyn-Jones)
+ * Fixed several memory leaks and leak-sanitizer issues.
+ (pull requests #61, #62, #63 and #64 from Gaurav Gupta)
+
2017-08-15 Michael Bell <michael.bell@web.de>
* Released 0.11.6
* Fixed/changed the encoding of element Content in CodePage
WBXML_SUPPORT_OTA_SETTINGS : Support of Ericsson / Nokia OTA Settings v7.0
WBXML_SUPPORT_SYNCML : Support of SyncML 1.0 / SyncML 1.1 / SyncML 1.2
WBXML_SUPPORT_WV : Support of Wireless-Village CSP 1.1 / CSP 1.2
+ WBXML_SUPPORT_AIRSYNC : Support of AIRSYNC 2.5
+ WBXML_SUPPORT_CONML : Support of Nokia ConML
HAVE_EXPAT : Enable XML Parsing feature (needs Expat)
+ WBXML_INSTALL_FULL_HEADERS : Install unstable internal API headers
BUILD_SHARED_LIBS : Build wbxml as shared library
BUILD_STATIC_LIBS : Build wbxml as static library
"make"
"make test"
- - Commit and push the increased version changes (and build fixes)
+ - Check ChangeLog to be complete and add the new release name.
+
+ - Final steps with git:
+ git pull origin
+ git pull upstream master
+ git status
+ git commit -a
+ git tag libwbxml-$MAJOR.$MINOR.$PATCH
+ git push origin libwbxml-$MAJOR.$MINOR.$PATCH
- if someone else made changes and the push fails,
you have to "git pull" and run the tests again
- please run "git status" before you continue to be 100 percent sure
that there is no forgotten commit and no unrevisioned file.
- - Check ChangeLog to be complete and add the new release name.
-
- Once the commit succeeds, you have to create a new release on GitHub.
+ Please create a pull request from your fork.
Please use the web GUI of Github and write some useful release notes.
- create tarballs for an out-of-source-build with
The following people helped to develop and maintain this library:
-Amnon Aaronsohn (ActiveSync)
-Pau Aliagas <pau@smsarena.com>
-Michael Banck (Debian package maintainer, testing)
-Michael Bell <michael.bell@web.de>
-Gaurav Gupta <g.gupta@samsung.com>
-Gil Hartmann (Active Sync v16.0)
-Conrad Irwin (performance fixes)
-Aymerick Jehanne <aymerick@jehanne.org>
-Ossi Jormakka (Ixonos Plc., ActiveSync)
-Anton D. Kachalov (Nokia ConML support)
-Benedykt Kroplewski <benedykt@age.pl>
-Jeremy Lainé (helped with cmake on Win32)
-Mark Ostrer (Websense)
-Petr Písař (RedHat/Fedora package maintainer)
-Renu Tyagi (fixed some memory leaks)
-Boaz Yaniv (MS Visual Studio fixes)
+Amnon Aaronsohn (ActiveSync)
+Pau Aliagas <pau@smsarena.com>
+Michael Banck (Debian package maintainer, testing)
+Michael Bell <michael.bell@web.de>
+Gaurav Gupta <g.gupta@samsung.com>
+Gil Hartmann (Active Sync v16.0)
+Conrad Irwin (performance fixes)
+Aymerick Jehanne <aymerick@jehanne.org>
+Ossi Jormakka (Ixonos Plc., ActiveSync)
+Anton D. Kachalov (Nokia ConML support)
+Peter Keresztes Schmidt (fixed libexpat linking)
+Benedykt Kroplewski <benedykt@age.pl>
+Jeremy Lainé (helped with cmake on Win32)
+Mark Ostrer (Websense)
+Petr Písař (RedHat/Fedora package maintainer)
+Renu Tyagi (fixed some memory leaks)
+Boaz Yaniv (MS Visual Studio fixes)
+Slava Monich <slava@monich.com>
+David Llewellyn-Jones <david.llewellyn-jones@jolla.com>
If you think your name is missing here
then please feel free to create a ticket.
SET_TARGET_PROPERTIES( wbxml2 PROPERTIES SOVERSION ${LIBWBXML_LIBVERSION_SOVERSION} )
SET_TARGET_PROPERTIES( wbxml2 PROPERTIES VERSION ${LIBWBXML_LIBVERSION_VERSION} )
- TARGET_LINK_LIBRARIES( wbxml2 ${EXPAT_LIBRARIES} )
+ TARGET_LINK_LIBRARIES( wbxml2 PRIVATE ${EXPAT_LIBRARIES} )
INSTALL( TARGETS wbxml2
RUNTIME DESTINATION ${LIBWBXML_BIN_DIR}
SET_TARGET_PROPERTIES( wbxml2_static PROPERTIES SOVERSION ${LIBWBXML_LIBVERSION_SOVERSION} )
SET_TARGET_PROPERTIES( wbxml2_static PROPERTIES VERSION ${LIBWBXML_LIBVERSION_VERSION} )
- TARGET_LINK_LIBRARIES( wbxml2_static ${EXPAT_LIBRARIES} )
+ TARGET_LINK_LIBRARIES( wbxml2_static PRIVATE ${EXPAT_LIBRARIES} )
SET_TARGET_PROPERTIES( wbxml2_static PROPERTIES OUTPUT_NAME wbxml2 )
INSTALL( TARGETS wbxml2_static
DESTINATION ${LIBWBXML_INCLUDE_DIR}/wbxml
)
+IF(WBXML_INSTALL_FULL_HEADERS)
+ INSTALL( FILES
+ wbxml_base64.h
+ wbxml_buffers.h
+ wbxml_charset.h
+ wbxml_elt.h
+ wbxml_encoder.h
+ wbxml_handlers.h
+ wbxml_lists.h
+ wbxml_log.h
+ wbxml_mem.h
+ wbxml_parser.h
+ wbxml_tables.h
+ wbxml_tree.h
+ wbxml_tree_clb_wbxml.h
+ wbxml_tree_clb_xml.h
+ DESTINATION ${LIBWBXML_INCLUDE_DIR}/wbxml
+ )
+ENDIF()
*/
static WBXMLError wbxml_encode_wv_datetime_opaque(WBXMLEncoder *encoder, WB_UTINY *buffer)
{
- WBXMLError error;
WBXMLBuffer *tmp = NULL;
WB_ULONG i = 0, len = 0;
WB_UTINY ch = 0;
/* Create temp Buffer */
if ((tmp = wbxml_buffer_create_from_cstr(buffer)) == NULL) {
- error = WBXML_ERROR_NOT_ENOUGH_MEMORY;
+ ret = WBXML_ERROR_NOT_ENOUGH_MEMORY;
goto error;
}
}
if ((len != 15) && (len != 16)) {
WBXML_ERROR((WBXML_CONV, "The length of a WV datetime must be 15 or 16."));
- error = WBXML_ERROR_WV_DATETIME_FORMAT;
+ ret = WBXML_ERROR_WV_DATETIME_FORMAT;
goto error;
}
/* Check position of 'T' */
if (*(buffer+8) != 'T') {
WBXML_ERROR((WBXML_CONV, "The 9th character of a WV datetime must be 'T'."));
- error = WBXML_ERROR_WV_DATETIME_FORMAT;
+ ret = WBXML_ERROR_WV_DATETIME_FORMAT;
goto error;
}
/* Check position of time zone */
if (len == 16) {
if (!wbxml_buffer_get_char(tmp, 15, &ch)) {
- error = WBXML_ERROR_INTERNAL;
+ ret = WBXML_ERROR_INTERNAL;
goto error;
}
if (ch < 'A' || ch == 'J' || ch > 'Z') {
WBXML_ERROR((WBXML_CONV, "If the length of a WV datetime is 16 then the last character must be the time zone."));
- error = WBXML_ERROR_WV_DATETIME_FORMAT;
+ ret = WBXML_ERROR_WV_DATETIME_FORMAT;
goto error;
}
while (i < wbxml_buffer_len(tmp)) {
/* Get char */
if (!wbxml_buffer_get_char(tmp, i, &ch)) {
- error = WBXML_ERROR_INTERNAL;
+ ret = WBXML_ERROR_INTERNAL;
goto error;
}
if (!WBXML_ISDIGIT(ch)) {
- error = WBXML_ERROR_WV_DATETIME_FORMAT;
+ ret = WBXML_ERROR_WV_DATETIME_FORMAT;
goto error;
}
else
/* Set Year */
component = wbxml_buffer_duplicate(tmp);
if (!component) {
- error = WBXML_ERROR_NOT_ENOUGH_MEMORY;
+ ret = WBXML_ERROR_NOT_ENOUGH_MEMORY;
goto error;
}
wbxml_buffer_delete(component, 4, 10);
/* Set Month */
component = wbxml_buffer_duplicate(tmp);
if (!component) {
- error = WBXML_ERROR_NOT_ENOUGH_MEMORY;
+ ret = WBXML_ERROR_NOT_ENOUGH_MEMORY;
goto error;
}
wbxml_buffer_delete(component, 0, 4);
/* Set Day */
component = wbxml_buffer_duplicate(tmp);
if (!component) {
- error = WBXML_ERROR_NOT_ENOUGH_MEMORY;
+ ret = WBXML_ERROR_NOT_ENOUGH_MEMORY;
goto error;
}
wbxml_buffer_delete(component, 0, 6);
/* Set Hour */
component = wbxml_buffer_duplicate(tmp);
if (!component) {
- error = WBXML_ERROR_NOT_ENOUGH_MEMORY;
+ ret = WBXML_ERROR_NOT_ENOUGH_MEMORY;
goto error;
}
wbxml_buffer_delete(component, 0, 8);
/* Set Minute */
component = wbxml_buffer_duplicate(tmp);
if (!component) {
- error = WBXML_ERROR_NOT_ENOUGH_MEMORY;
+ ret = WBXML_ERROR_NOT_ENOUGH_MEMORY;
goto error;
}
wbxml_buffer_delete(component, 0, 10);
/* Set Second */
component = wbxml_buffer_duplicate(tmp);
if (!component) {
- error = WBXML_ERROR_NOT_ENOUGH_MEMORY;
+ ret = WBXML_ERROR_NOT_ENOUGH_MEMORY;
goto error;
}
wbxml_buffer_delete(component, 0, 12);
/* Encode it to Opaque */
ret = wbxml_encode_opaque_data(encoder, octets, 6);
-
- return ret;
+
error:
if (tmp)
wbxml_buffer_destroy(tmp);
- return error;
+ return ret;
}
extern "C" {
#endif /* __cplusplus */
-#include <wbxml_config.h>
+#include "wbxml_config.h"
/** @addtogroup wbxml_tree
* @{
ck_assert(wbxml_base64_decode(NULL, 0, &result) <= 0);
ck_assert(wbxml_base64_decode(NULL, 1, &result) <= 0);
ck_assert(wbxml_base64_decode((const WB_UTINY*) "", 0, &result) <= 0);
+ wbxml_free(result);
ck_assert(wbxml_base64_decode((const WB_UTINY*) "test", 0, &result) <= 0);
+ wbxml_free(result);
/* decode a string */
ck_assert( ! wbxml_buffer_remove_trailing_zeros(buf));
+ wbxml_buffer_destroy(buf2);
wbxml_buffer_destroy(buf);
}
END_TEST
ck_assert(wbxml_buffer_insert(buf, buf2, 3));
ck_assert(wbxml_buffer_len(buf) == 12);
ck_assert(wbxml_buffer_compare_cstr(buf, "123XYZtes7t9") == 0);
+ wbxml_buffer_destroy(buf2);
wbxml_buffer_destroy(buf);
}
ck_assert(wbxml_buffer_compare(buf, buf2) != 0);
ck_assert(wbxml_buffer_compare_cstr(buf, "test") != 0);
+ wbxml_buffer_destroy(buf2);
wbxml_buffer_destroy(buf);
}
END_TEST
# Debian does this by default
if [ "${CMAKE_SKIP_RPATH}" ]
then
- LD_LIBRARY_PATH="${CMAKE_CURRENT_BINARY_DIR}/../../src"
+ LD_LIBRARY_PATH="${CMAKE_CURRENT_BINARY_DIR}/../../src:$LD_LIBRARY_PATH"
export LD_LIBRARY_PATH
fi
case '?':
default:
help();
- return 0;
+ goto clean_up;
}
}
if (optind >= argc) {
fprintf(stderr, "Missing arguments\n");
help();
- return 0;
+ goto clean_up;
}
#ifdef WBXML_USE_LEAKTRACKER
case '?':
default:
help();
- return 0;
+ goto clean_up;
}
}
if (optind >= argc) {
fprintf(stderr, "Missing arguments\n");
help();
- return 0;
+ goto clean_up;
}
#ifdef WBXML_USE_LEAKTRACKER