From: <svn...@op...> - 2009-07-03 09:31:07
|
Author: bellmich Date: Fri Jul 3 11:31:01 2009 New Revision: 1146 URL: http://libsyncml.opensync.org/changeset/1146 Log: migrated sml_notification from SmlError to GError Modified: trunk/libsyncml/sml_notification.c trunk/libsyncml/sml_notification.h trunk/libsyncml/sml_notification_internals.h trunk/libsyncml/sml_parse.h trunk/libsyncml/sml_transport.h Modified: trunk/libsyncml/sml_notification.c ============================================================================== --- trunk/libsyncml/sml_notification.c Fri Jul 3 10:26:52 2009 (r1145) +++ trunk/libsyncml/sml_notification.c Fri Jul 3 11:31:01 2009 (r1146) @@ -31,11 +31,18 @@ #include "sml_elements_internals.h" #include "data_sync_api/sml_location_internals.h" -SmlNotification *smlNotificationNew(SmlNotificationVersion version, SmlNotificationUIMode mode, SmlNotificationInitiator init, unsigned int sessionID, const char *identifier, const char *target, SmlMimeType type, SmlError **error) +SmlNotification* +smlNotificationNew (SmlNotificationVersion version, + SmlNotificationUIMode mode, + SmlNotificationInitiator init, + guint sessionID, + const gchar *identifier, + const gchar *target, + SmlMimeType type, + GError **error) { smlTrace(TRACE_ENTRY, "%s(%i, %i, %i, %i, %s, %s, %i, %p)", __func__, version, mode, init, sessionID, VA_STRING(identifier), VA_STRING(target), type, error); CHECK_ERROR_REF - GError *gerror = NULL; SmlNotification *san = smlTryMalloc0(sizeof(SmlNotification), error); if (!san) @@ -51,25 +58,25 @@ san->sessionType = SML_SESSION_TYPE_SERVER; san->manager = NULL; - san->target = sml_location_new_with_options(target, NULL, &gerror); + san->target = sml_location_new_with_options(target, NULL, error); if (!san->target) goto error; smlTrace(TRACE_EXIT, "%s: %p", __func__, san); return san; - error: if (san) { if (san->identifier) g_free(san->identifier); smlSafeFree((gpointer *)&san); } - GERROR_TO_SML_ERROR(gerror,error) - smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); + smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, (*error)->message); return NULL; } -void smlNotificationSetCred(SmlNotification *san, SmlCred *cred) +void +smlNotificationSetCred (SmlNotification *san, + SmlCred *cred) { smlTrace(TRACE_ENTRY, "%s", __func__); smlAssert(san); @@ -87,7 +94,9 @@ smlTrace(TRACE_EXIT, "%s", __func__); } -void smlNotificationSetManager(SmlNotification *san, SmlManager *manager) +void +smlNotificationSetManager (SmlNotification *san, + SmlManager *manager) { smlTrace(TRACE_ENTRY, "%s", __func__); smlAssert(san); @@ -96,7 +105,8 @@ smlTrace(TRACE_EXIT, "%s", __func__); } -void smlNotificationFree(SmlNotification *san) +void +smlNotificationFree (SmlNotification *san) { smlTrace(TRACE_ENTRY, "%s(%p)", __func__, san); smlAssert(san); @@ -124,7 +134,12 @@ smlTrace(TRACE_EXIT, "%s", __func__); } -SmlBool smlNotificationNewAlert(SmlNotification *san, SmlAlertType type, const char *contenttype, const char *serverURI, SmlError **error) +gboolean +smlNotificationNewAlert (SmlNotification *san, + SmlAlertType type, + const gchar *contenttype, + const gchar *serverURI, + GError **error) { smlTrace(TRACE_ENTRY, "%s(%p)", __func__, error); CHECK_ERROR_REF @@ -142,13 +157,13 @@ smlTrace(TRACE_EXIT, "%s: %p", __func__, alert); return TRUE; - error: - smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); + smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, (*error)->message); return FALSE; } -void smlNotificationFreeAlert(SmlSanAlert *alert) +void +smlNotificationFreeAlert (SmlSanAlert *alert) { smlTrace(TRACE_ENTRY, "%s(%p)", __func__, alert); smlAssert(alert); @@ -160,25 +175,30 @@ smlTrace(TRACE_EXIT, "%s", __func__); } -SmlNotification *smlNotificationParse(const char *data, unsigned int size, SmlError **error) +SmlNotification* +smlNotificationParse (const gchar *data, + gsize size, + GError **error) { smlTrace(TRACE_ENTRY, "%s(%p, %i, %p)", __func__, data, size, error); CHECK_ERROR_REF smlAssert(data); smlAssert(size); + + SmlNotification *san = NULL; if (size < 25) { - smlErrorSet(error, SML_ERROR_GENERIC, "Size too small"); + g_set_error(error, SML_ERROR, SML_ERROR_GENERIC, "Size too small"); goto error; } unsigned int idLength = (uint8_t)data[23]; if (size < (25 + idLength)) { - smlErrorSet(error, SML_ERROR_GENERIC, "Size too small2"); + g_set_error(error, SML_ERROR, SML_ERROR_GENERIC, "Size too small2"); goto error; } - SmlNotification *san = smlTryMalloc0(sizeof(SmlNotification), error); + san = smlTryMalloc0(sizeof(SmlNotification), error); if (!san) goto error; san->type = SML_MIMETYPE_SAN; @@ -191,8 +211,8 @@ san->version = SML_SAN_VERSION_12; break; default: - smlErrorSet(error, SML_ERROR_GENERIC, "Unknown version"); - goto error_free_san; + g_set_error(error, SML_ERROR, SML_ERROR_GENERIC, "Unknown version"); + goto error; } /* ui mode */ @@ -210,7 +230,7 @@ /* the trailing NULL byte is usually not present in the SAN */ san->identifier = smlTryMalloc0(idLength + 1, error); if (!san->identifier) - goto error_free_san; + goto error; memcpy(san->identifier, data + 24, idLength); } @@ -222,22 +242,22 @@ unsigned int i = 0; for (i = 0; i < numSync; i++) { if (size < alertLength + 5) { - smlErrorSet(error, SML_ERROR_GENERIC, "Size too small3"); - goto error_free_san; + g_set_error(error, SML_ERROR, SML_ERROR_GENERIC, "Size too small3"); + goto error; } idLength = (uint8_t)data[4]; if (size < (alertLength + 5 + idLength)) { - smlErrorSet(error, SML_ERROR_GENERIC, "Size too small4"); - goto error_free_san; + g_set_error(error, SML_ERROR, SML_ERROR_GENERIC, "Size too small4"); + goto error; } alertLength = alertLength + 5 + idLength; /* Alert type + future */ SmlAlertType alert_type = (((uint8_t)data[0]) >> 4) + 200; if (alert_type < 206 || alert_type > 210) { - smlErrorSet(error, SML_ERROR_GENERIC, "Wrong alert type"); - goto error_free_san; + g_set_error(error, SML_ERROR, SML_ERROR_GENERIC, "Wrong alert type"); + goto error; } unsigned int contenttype = ((uint8_t)data[1]) << 16; @@ -280,8 +300,8 @@ break; default: /* http://www.openmobilealliance.org/Tech/omna/omna-wsp-content-type.aspx */ - smlErrorSet(error, SML_ERROR_GENERIC, "The OMNA WSP Content Type Number 0x%xd is not supported.", contenttype); - goto error_free_san; + g_set_error(error, SML_ERROR, SML_ERROR_GENERIC, "The OMNA WSP Content Type Number 0x%xd is not supported.", contenttype); + goto error; } /* The server uri */ @@ -290,7 +310,7 @@ /* the trailing NULL byte is usually not present in the SAN */ alert_uri = smlTryMalloc0(idLength + 1, error); if (!alert_uri) - goto error_free_san; + goto error; memcpy(alert_uri, data + 5, idLength); } @@ -298,7 +318,7 @@ /* Create new alert */ if (!smlNotificationNewAlert(san, alert_type, alert_ct, alert_uri, error)) - goto error_free_san; + goto error; /* Cleanup */ if (idLength) @@ -306,27 +326,32 @@ } if (size > alertLength) { - smlErrorSet(error, SML_ERROR_GENERIC, "Extra chunk at the end of the buffer"); - goto error_free_san; + g_set_error(error, SML_ERROR, SML_ERROR_GENERIC, "Extra chunk at the end of the buffer"); + goto error; } smlTrace(TRACE_EXIT, "%s: %p", __func__, san); return san; - -error_free_san: - while (san->alerts) { - smlNotificationFreeAlert(san->alerts->data); - san->alerts = g_list_delete_link(san->alerts, san->alerts); - } - if (san->identifier) - smlSafeCFree(&(san->identifier)); - smlSafeFree((gpointer *)&san); error: - smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); + if (san) { + while (san->alerts) { + smlNotificationFreeAlert(san->alerts->data); + san->alerts = g_list_delete_link(san->alerts, san->alerts); + } + if (san->identifier) + smlSafeCFree(&(san->identifier)); + smlSafeFree((gpointer *)&san); + } + smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, (*error)->message); return NULL; } -SmlBool smlNotificationAssemble11(SmlNotification *san, char **data, unsigned int *size, SmlProtocolVersion version, SmlError **error) +gboolean +smlNotificationAssemble11 (SmlNotification *san, + gchar **data, + gsize *size, + SmlProtocolVersion version, + GError **error) { smlTrace(TRACE_ENTRY, "%s(%p, %p, %p, %i, %p)", __func__, san, data, size, version, error); CHECK_ERROR_REF @@ -418,9 +443,7 @@ smlTrace(TRACE_EXIT, "%s", __func__); return TRUE; - error: - GERROR_TO_SML_ERROR(gerror,error) if (cmd) smlCommandUnref(cmd); if (session) @@ -429,11 +452,15 @@ smlAssemblerFree(assm); *data = NULL; *size = 0; - smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); + smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, (*error)->message); return FALSE; } -static SmlBool _smlNotificationAssemble12(SmlNotification *san, char **data, unsigned int *size, SmlError **error) +static gboolean +_smlNotificationAssemble12 (SmlNotification *san, + gchar **data, + gsize *size, + GError **error) { smlTrace(TRACE_ENTRY, "%s(%p, %p, %p, %p)", __func__, san, data, size, error); CHECK_ERROR_REF @@ -574,16 +601,19 @@ smlTrace(TRACE_EXIT, "%s", __func__); return TRUE; - error: if (*data) smlSafeCFree(data); *size = 0; - smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); + smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, (*error)->message); return FALSE; } -SmlBool smlNotificationAssemble(SmlNotification *san, char **data, unsigned int *size, SmlError **error) +gboolean +smlNotificationAssemble (SmlNotification *san, + gchar **data, + gsize *size, + GError **error) { CHECK_ERROR_REF switch (san->version) { @@ -594,33 +624,37 @@ case SML_SAN_VERSION_11: return smlNotificationAssemble11(san, data, size, SML_VERSION_11, error); case SML_SAN_VERSION_UNKNOWN: - smlErrorSet(error, SML_ERROR_GENERIC, "Unknown SAN version."); + g_set_error(error, SML_ERROR, SML_ERROR_GENERIC, "Unknown SAN version."); break; } return FALSE; } -SmlBool smlNotificationSend(SmlNotification *san, SmlTransport *tsp, SmlError **error) +gboolean +smlNotificationSend (SmlNotification *san, + SmlTransport *tsp, + GError **error) { smlTrace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, san, tsp, error); CHECK_ERROR_REF smlAssert(san); smlAssert(tsp); + SmlTransportData *tspdata = NULL; char *data = NULL; unsigned int size = 0; + if (!smlNotificationAssemble(san, &data, &size, error)) goto error; - SmlTransportData *tspdata = NULL; if (san->version == SML_SAN_VERSION_12) tspdata = smlTransportDataNew(data, size, SML_MIMETYPE_SAN, TRUE, error); else tspdata = smlTransportDataNew(data, size, san->type, TRUE, error); if (!tspdata) - goto error_free_data; + goto error; /* Do not free data because smlTransportDateNew does copy by reference. */ data = NULL; @@ -631,76 +665,87 @@ tspdata->type_get = san->type; if (!smlTransportSend(tsp, NULL, tspdata, error)) - goto error_free_tspdata; + goto error; smlTransportDataDeref(tspdata); smlTrace(TRACE_EXIT, "%s", __func__); return TRUE; -error_free_tspdata: - smlTransportDataDeref(tspdata); -error_free_data: - smlSafeCFree(&data); error: - smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); + if (tspdata) + smlTransportDataDeref(tspdata); + if (data) + smlSafeCFree(&data); + smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, (*error)->message); return FALSE; } -SmlNotificationVersion smlNotificationGetVersion(SmlNotification *san) +SmlNotificationVersion +smlNotificationGetVersion (SmlNotification *san) { smlAssert(san); return san->version; } -SmlNotificationUIMode smlNotificationGetMode(SmlNotification *san) +SmlNotificationUIMode +smlNotificationGetMode (SmlNotification *san) { smlAssert(san); return san->mode; } -SmlNotificationInitiator smlNotificationGetInitiator(SmlNotification *san) +SmlNotificationInitiator +smlNotificationGetInitiator (SmlNotification *san) { smlAssert(san); return san->init; } -unsigned int smlNotificationGetSessionID(SmlNotification *san) +guint +smlNotificationGetSessionID (SmlNotification *san) { smlAssert(san); return san->sessionID; } -const char *smlNotificationGetIdentifier(SmlNotification *san) +const gchar* +smlNotificationGetIdentifier (SmlNotification *san) { smlAssert(san); return san->identifier; } -unsigned int smlNotificationNumAlerts(SmlNotification *san) +gsize +smlNotificationNumAlerts (SmlNotification *san) { smlAssert(san); return g_list_length(san->alerts); } -SmlSanAlert *smlNotificationNthAlert(SmlNotification *san, unsigned int nth) +SmlSanAlert* +smlNotificationNthAlert (SmlNotification *san, + gsize nth) { smlAssert(san); return g_list_nth_data(san->alerts, nth); } -SmlAlertType smlSanAlertGetType(SmlSanAlert *alert) +SmlAlertType +smlSanAlertGetType (SmlSanAlert *alert) { smlAssert(alert); return alert->type; } -const char *smlSanAlertGetContentType(SmlSanAlert *alert) +const gchar* +smlSanAlertGetContentType (SmlSanAlert *alert) { smlAssert(alert); return alert->contenttype; } -const char *smlSanAlertGetServerURI(SmlSanAlert *alert) +const gchar* +smlSanAlertGetServerURI (SmlSanAlert *alert) { smlAssert(alert); return alert->serverURI; Modified: trunk/libsyncml/sml_notification.h ============================================================================== --- trunk/libsyncml/sml_notification.h Fri Jul 3 10:26:52 2009 (r1145) +++ trunk/libsyncml/sml_notification.h Fri Jul 3 11:31:01 2009 (r1146) @@ -1,7 +1,7 @@ /* * libsyncml - A syncml protocol implementation * Copyright (C) 2005 Armin Bauer <arm...@op...> - * Copyright (C) 2007 Michael Bell <mic...@op...> + * Copyright (C) 2007-2009 Michael Bell <mic...@op...> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -49,28 +49,28 @@ SML_SAN_INITIATOR_SERVER = 1 } SmlNotificationInitiator; -SmlNotification *smlNotificationNew(SmlNotificationVersion version, SmlNotificationUIMode mode, SmlNotificationInitiator init, unsigned int sessionID, const char *identifier, const char *target, SmlMimeType type, SmlError **error); -void smlNotificationSetCred(SmlNotification *san, SmlCred *cred); -void smlNotificationSetManager(SmlNotification *san, SmlManager *manager); -void smlNotificationFree(SmlNotification *san); -SmlNotification *smlNotificationParse(const char *data, unsigned int size, SmlError **error); -SmlBool smlNotificationAssemble(SmlNotification *san, char **data, unsigned int *size, SmlError **error); -SmlBool smlNotificationSend(SmlNotification *san, SmlTransport *tsp, SmlError **error); - -SmlBool smlNotificationNewAlert(SmlNotification *san, SmlAlertType type, const char *contenttype, const char *serverURI, SmlError **error); -void smlNotificationFreeAlert(SmlSanAlert *alert); - -SmlNotificationVersion smlNotificationGetVersion(SmlNotification *san); -SmlNotificationUIMode smlNotificationGetMode(SmlNotification *san); -SmlNotificationInitiator smlNotificationGetInitiator(SmlNotification *san); -unsigned int smlNotificationGetSessionID(SmlNotification *san); -const char *smlNotificationGetIdentifier(SmlNotification *san); -unsigned int smlNotificationNumAlerts(SmlNotification *san); -SmlSanAlert *smlNotificationNthAlert(SmlNotification *san, unsigned int nth); - -SmlAlertType smlSanAlertGetType(SmlSanAlert *alert); -const char *smlSanAlertGetContentType(SmlSanAlert *alert); -const char *smlSanAlertGetServerURI(SmlSanAlert *alert); +SmlNotification* smlNotificationNew (SmlNotificationVersion version, SmlNotificationUIMode mode, SmlNotificationInitiator init, guint sessionID, const gchar *identifier, const gchar *target, SmlMimeType type, GError **error); +void smlNotificationSetCred (SmlNotification *san, SmlCred *cred); +void smlNotificationSetManager (SmlNotification *san, SmlManager *manager); +void smlNotificationFree (SmlNotification *san); +SmlNotification* smlNotificationParse (const gchar *data, gsize size, GError **error); +gboolean smlNotificationAssemble (SmlNotification *san, gchar **data, gsize *size, GError **error); +gboolean smlNotificationSend (SmlNotification *san, SmlTransport *tsp, GError **error); + +gboolean smlNotificationNewAlert (SmlNotification *san, SmlAlertType type, const gchar *contenttype, const gchar *serverURI, GError **error); +void smlNotificationFreeAlert (SmlSanAlert *alert); + +SmlNotificationVersion smlNotificationGetVersion (SmlNotification *san); +SmlNotificationUIMode smlNotificationGetMode (SmlNotification *san); +SmlNotificationInitiator smlNotificationGetInitiator (SmlNotification *san); +guint smlNotificationGetSessionID (SmlNotification *san); +const gchar * smlNotificationGetIdentifier (SmlNotification *san); +gsize smlNotificationNumAlerts (SmlNotification *san); +SmlSanAlert * smlNotificationNthAlert (SmlNotification *san, gsize nth); + +SmlAlertType smlSanAlertGetType (SmlSanAlert *alert); +const gchar* smlSanAlertGetContentType (SmlSanAlert *alert); +const gchar* smlSanAlertGetServerURI (SmlSanAlert *alert); #endif //_SML_NOTIFICATION_H_ Modified: trunk/libsyncml/sml_notification_internals.h ============================================================================== --- trunk/libsyncml/sml_notification_internals.h Fri Jul 3 10:26:52 2009 (r1145) +++ trunk/libsyncml/sml_notification_internals.h Fri Jul 3 11:31:01 2009 (r1146) @@ -1,7 +1,7 @@ /* * libsyncml - A syncml protocol implementation * Copyright (C) 2005 Armin Bauer <arm...@op...> - * Copyright (C) 2007-2008 Michael Bell <mic...@op...> + * Copyright (C) 2007-2009 Michael Bell <mic...@op...> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -34,8 +34,8 @@ SmlNotificationVersion version; SmlNotificationUIMode mode; SmlNotificationInitiator init; - unsigned int sessionID; - char *identifier; + guint sessionID; + gchar *identifier; SmlLocation *target; GList *alerts; SmlMimeType type; @@ -43,22 +43,22 @@ SmlSessionType sessionType; SmlManager *manager; - unsigned int localMaxMsgSize; - unsigned int localMaxObjSize; + gsize localMaxMsgSize; + gsize localMaxObjSize; }; struct SmlSanAlert { SmlAlertType type; - char *contenttype; - char *serverURI; + gchar *contenttype; + gchar *serverURI; }; SmlBool smlNotificationAssemble11( SmlNotification *san, - char **data, - unsigned int *size, + gchar **data, + gsize *size, SmlProtocolVersion version, - SmlError **error); + GError **error); #endif //_SML_NOTIFICATION_INTERNALS_H_ Modified: trunk/libsyncml/sml_parse.h ============================================================================== --- trunk/libsyncml/sml_parse.h Fri Jul 3 10:26:52 2009 (r1145) +++ trunk/libsyncml/sml_parse.h Fri Jul 3 11:31:01 2009 (r1146) @@ -32,11 +32,11 @@ } SmlParserResult; typedef void (* SmlParserFreeFunction) (void *userdata); -typedef SmlBool (* SmlParserStartFunction) (void *userdata, const char *data, unsigned int size, SmlError **error); -typedef SmlBool (* SmlParserEndFunction) (void *userdata, SmlBool *final, SmlBool *end, SmlError **error); -typedef SmlBool (* SmlParserHeaderFunction) (void *userdata, SmlHeader **header, SmlCred **cred, SmlError **error); -typedef SmlBool (* SmlParserStatusFunction) (void *userdata, SmlStatus **status, SmlError **error); -typedef SmlParserResult (* SmlParserCommandFunction) (void *userdata, SmlCommand **cmd, SmlError **error); +typedef SmlBool (* SmlParserStartFunction) (void *userdata, const char *data, unsigned int size, GError **error); +typedef SmlBool (* SmlParserEndFunction) (void *userdata, SmlBool *final, SmlBool *end, GError **error); +typedef SmlBool (* SmlParserHeaderFunction) (void *userdata, SmlHeader **header, SmlCred **cred, GError **error); +typedef SmlBool (* SmlParserStatusFunction) (void *userdata, SmlStatus **status, GError **error); +typedef SmlParserResult (* SmlParserCommandFunction) (void *userdata, SmlCommand **cmd, GError **error); typedef struct SmlParserFunctions { SmlParserFreeFunction free; @@ -48,19 +48,19 @@ } SmlParserFunctions; typedef void (* SmlAssemblerFreeFunction) (void *userdata); -typedef SmlBool (* SmlAssemblerStartFunction) (void *userdata, SmlSession *session, SmlError **error); -typedef SmlBool (* SmlAssemblerEndFunction) (void *userdata, SmlError **error); -typedef SmlBool (* SmlAssemblerRunFunction) (void *userdata, char **data, unsigned int *size, SmlBool *end, SmlBool final, unsigned int maxsize, SmlError **error); +typedef SmlBool (* SmlAssemblerStartFunction) (void *userdata, SmlSession *session, GError **error); +typedef SmlBool (* SmlAssemblerEndFunction) (void *userdata, GError **error); +typedef SmlBool (* SmlAssemblerRunFunction) (void *userdata, char **data, unsigned int *size, SmlBool *end, SmlBool final, unsigned int maxsize, GError **error); typedef unsigned int (* SmlAssemblerFlushFunction) (void *userdata); -typedef SmlBool (* SmlAssemblerStatusFunction) (void *userdata, SmlStatus *status, SmlError **error); -typedef SmlBool (* SmlAssemblerRemStatusFunction) (void *userdata, SmlError **error); -typedef SmlBool (* SmlAssemblerReserveStatusFunction) (void *userdata, unsigned int cmdRef, unsigned int msgRef, unsigned int cmdID, SmlError **error); +typedef SmlBool (* SmlAssemblerStatusFunction) (void *userdata, SmlStatus *status, GError **error); +typedef SmlBool (* SmlAssemblerRemStatusFunction) (void *userdata, GError **error); +typedef SmlBool (* SmlAssemblerReserveStatusFunction) (void *userdata, unsigned int cmdRef, unsigned int msgRef, unsigned int cmdID, GError **error); typedef SmlBool (* SmlAssemblerStatusMissingFunction) (void *userdata); -typedef SmlBool (* SmlAssemblerStartCommandFunction) (void *userdata, unsigned int parentID, SmlCommand *cmd, SmlError **error); -typedef SmlBool (* SmlAssemblerEndCommandFunction) (void *userdata, unsigned int parentID, SmlError **error); -typedef SmlBool (* SmlAssemblerRemCommandFunction) (void *userdata, unsigned int parentID, SmlError **error); -typedef SmlBool (* SmlAssemblerHeaderFunction) (void *userdata, SmlSession *session, SmlError **error); -typedef unsigned int (* SmlAssemblerCheckFunction) (void *userdata, SmlBool headeronly, SmlError **error); +typedef SmlBool (* SmlAssemblerStartCommandFunction) (void *userdata, unsigned int parentID, SmlCommand *cmd, GError **error); +typedef SmlBool (* SmlAssemblerEndCommandFunction) (void *userdata, unsigned int parentID, GError **error); +typedef SmlBool (* SmlAssemblerRemCommandFunction) (void *userdata, unsigned int parentID, GError **error); +typedef SmlBool (* SmlAssemblerHeaderFunction) (void *userdata, SmlSession *session, GError **error); +typedef unsigned int (* SmlAssemblerCheckFunction) (void *userdata, SmlBool headeronly, GError **error); typedef SmlBool (* SmlAssemblerNextCmdRefFunction) (void *userdata, unsigned int *cmdRef, unsigned int *msgRef); typedef void (* SmlAssemblerRestoreCommandsFunction) (void *userdata); @@ -97,25 +97,25 @@ SmlBool smlParserGetStatus(SmlParser *parser, SmlStatus **status, SmlError **error); SmlBool smlParserEnd(SmlParser *parser, SmlBool *final, SmlBool *end, SmlError **error); -SmlAssembler *smlAssemblerNew(SmlMimeType type, unsigned int limit, SmlError **error); +SmlAssembler *smlAssemblerNew(SmlMimeType type, unsigned int limit, GError **error); void smlAssemblerFree(SmlAssembler *assm); -SmlBool smlAssemblerStart(SmlAssembler *assm, SmlSession *session, SmlError **error); +SmlBool smlAssemblerStart(SmlAssembler *assm, SmlSession *session, GError **error); unsigned int smlAssemblerFlush(SmlAssembler *assm); void smlAssemblerRestoreCommands(SmlAssembler *assm); -SmlBool smlAssemblerRun(SmlAssembler *assm, char **data, unsigned int *size, SmlBool *end, SmlBool final, SmlError **error); -SmlAssemblerResult smlAssemblerAddStatus(SmlAssembler *assm, SmlStatus *status, SmlError **error); -SmlAssemblerResult smlAssemblerAddStatusFull(SmlAssembler *assm, SmlStatus *status, SmlBool force, SmlError **error); -SmlAssemblerResult smlAssemblerReserveStatus(SmlAssembler *assm, unsigned int cmdRef, unsigned int msgRef, unsigned int cmdID, SmlError **error); -SmlBool smlAssemblerAddHeader(SmlAssembler *assm, SmlSession *session, SmlError **error); -SmlAssemblerResult smlAssemblerStartCommand(SmlAssembler *assm, SmlCommand *parent, SmlCommand *cmd, SmlError **error); -SmlBool smlAssemblerEndCommand(SmlAssembler *assm, SmlCommand *parent, SmlError **error); -unsigned int smlAssemblerCheckSize(SmlAssembler *assm, SmlBool headeronly, SmlError **error); +SmlBool smlAssemblerRun(SmlAssembler *assm, char **data, unsigned int *size, SmlBool *end, SmlBool final, GError **error); +SmlAssemblerResult smlAssemblerAddStatus(SmlAssembler *assm, SmlStatus *status, GError **error); +SmlAssemblerResult smlAssemblerAddStatusFull(SmlAssembler *assm, SmlStatus *status, SmlBool force, GError **error); +SmlAssemblerResult smlAssemblerReserveStatus(SmlAssembler *assm, unsigned int cmdRef, unsigned int msgRef, unsigned int cmdID, GError **error); +SmlBool smlAssemblerAddHeader(SmlAssembler *assm, SmlSession *session, GError **error); +SmlAssemblerResult smlAssemblerStartCommand(SmlAssembler *assm, SmlCommand *parent, SmlCommand *cmd, GError **error); +SmlBool smlAssemblerEndCommand(SmlAssembler *assm, SmlCommand *parent, GError **error); +unsigned int smlAssemblerCheckSize(SmlAssembler *assm, SmlBool headeronly, GError **error); void smlAssemblerSetOption(SmlAssembler *assm, const char *optionname, const char *value); const char *smlAssemblerGetOption(SmlAssembler *assm, const char *optionname); unsigned int smlAssemblerSetRemoteMaxMsgSize(SmlAssembler *assm, unsigned int limit); unsigned int smlAssemblerGetRemoteMaxMsgSize(SmlAssembler *assm); -SmlBool smlAssemblerGetSpace(SmlAssembler *assm, int *space, SmlCommand *parent, SmlCommand *cmd, SmlError **error); +SmlBool smlAssemblerGetSpace(SmlAssembler *assm, int *space, SmlCommand *parent, SmlCommand *cmd, GError **error); unsigned int smlAssemblerGetRemoteMaxObjSize(SmlAssembler *assm); unsigned int smlAssemblerSetRemoteMaxObjSize(SmlAssembler *assm, unsigned int limit); Modified: trunk/libsyncml/sml_transport.h ============================================================================== --- trunk/libsyncml/sml_transport.h Fri Jul 3 10:26:52 2009 (r1145) +++ trunk/libsyncml/sml_transport.h Fri Jul 3 11:31:01 2009 (r1146) @@ -52,7 +52,7 @@ SmlBool smlTransportConnect(SmlTransport *tsp, SmlError **error); SmlBool smlTransportDisconnect(SmlTransport *tsp, SmlLink *link, GError **error); SmlBool smlTransportSend(SmlTransport *tsp, SmlLink *link, SmlTransportData *data, GError **error); -SmlTransportData *smlTransportDataNew(char *data, unsigned long size, SmlMimeType mimetype, SmlBool ownsData, SmlError **error); +SmlTransportData *smlTransportDataNew(char *data, unsigned long size, SmlMimeType mimetype, SmlBool ownsData, GError **error); SmlTransportData *smlTransportDataRef(SmlTransportData *data); void smlTransportDataDeref(SmlTransportData *data); SmlLink *smlLinkNew(SmlTransport *tsp, void *link_data, SmlError **error); |