From: <svn...@op...> - 2009-06-22 14:48:52
|
Author: bellmich Date: Mon Jun 22 14:43:15 2009 New Revision: 1109 URL: http://libsyncml.opensync.org/changeset/1109 Log: - SML_ERROR is internal - sml_return_val_error_if_fail is an extension of g_return_val_if_fail because the glib does not support error setting Modified: trunk/libsyncml/sml_error.h trunk/libsyncml/sml_error_internals.h Modified: trunk/libsyncml/sml_error.h ============================================================================== --- trunk/libsyncml/sml_error.h Mon Jun 22 14:41:54 2009 (r1108) +++ trunk/libsyncml/sml_error.h Mon Jun 22 14:43:15 2009 (r1109) @@ -113,8 +113,6 @@ } SmlErrorType; -#define SML_ERROR g_quark_from_static_string("Sml") - SmlError **smlErrorRef(SmlError **error); void smlErrorDeref(SmlError **error); SmlBool smlErrorIsSet(SmlError **error); Modified: trunk/libsyncml/sml_error_internals.h ============================================================================== --- trunk/libsyncml/sml_error_internals.h Mon Jun 22 14:41:54 2009 (r1108) +++ trunk/libsyncml/sml_error_internals.h Mon Jun 22 14:43:15 2009 (r1109) @@ -43,6 +43,14 @@ smlAssertMsg(error, SML_ASSERT_MSG_ERROR_MUST_NOT_BE_NULL); \ smlAssertMsg(*error == NULL, SML_ASSERT_MSG_ERROR_MUST_BE_EMPTY); +#define SML_ERROR g_quark_from_static_string("Sml") + +#define sml_return_val_error_if_fail(d_expr,d_value,d_error,d_error_code, d_error_msg) \ + g_set_error(d_error, SML_ERROR, d_error_code, d_error_msg); \ + g_return_val_if_fail(d_expr, d_value); \ + if (d_error) g_error_free(*d_error); \ + *d_error = NULL; + /* Error messages for assertions */ #define SML_ASSERT_MSG_ERROR_MUST_NOT_BE_NULL "The error handling of the function must be used." #define SML_ASSERT_MSG_ERROR_MUST_BE_EMPTY "The error parameter is already filled (ignored error)." |