From: Sjoerd Simons Date: Sun, 28 Oct 2007 18:41:43 +0000 (+0000) Subject: Rename GA's error to GA_ERROR for more consistency with other glib bindings X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=58ee9d8c85293eefa1e901c660fb30bf2b9122c8;p=catta Rename GA's error to GA_ERROR for more consistency with other glib bindings git-svn-id: file:///home/lennart/svn/public/avahi/trunk@1566 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- diff --git a/avahi-gobject/Makefile.am b/avahi-gobject/Makefile.am index c9f442c..1b50fdd 100644 --- a/avahi-gobject/Makefile.am +++ b/avahi-gobject/Makefile.am @@ -30,7 +30,7 @@ avahigobjectinclude_HEADERS = \ ga-client.h \ ga-entry-group.h \ ga-enums.h \ - ga-errors.h \ + ga-error.h \ ga-record-browser.h \ ga-service-browser.h \ ga-service-resolver.h @@ -53,7 +53,7 @@ CORE_SOURCES = \ ga-client.c ga-client.h \ ga-entry-group.c ga-entry-group.h \ ga-enums.h \ - ga-errors.c ga-errors.h \ + ga-error.c ga-error.h \ ga-record-browser.c ga-record-browser.h \ ga-service-browser.c ga-service-browser.h \ ga-service-resolver.c ga-service-resolver.h diff --git a/avahi-gobject/ga-client.c b/avahi-gobject/ga-client.c index d34933f..1625bac 100644 --- a/avahi-gobject/ga-client.c +++ b/avahi-gobject/ga-client.c @@ -27,7 +27,7 @@ #include "ga-client.h" #include "ga-client-enumtypes.h" -#include "ga-errors.h" +#include "ga-error.h" /* FIXME what to do about glib-malloc ? */ #include @@ -245,7 +245,7 @@ gboolean ga_client_start(GaClient * client, GError ** error) { _avahi_client_cb, client, &aerror); if (aclient == NULL) { if (error != NULL) { - *error = g_error_new(GA_ERRORS, aerror, + *error = g_error_new(GA_ERROR, aerror, "Failed to create avahi client: %s", avahi_strerror(aerror)); } diff --git a/avahi-gobject/ga-entry-group.c b/avahi-gobject/ga-entry-group.c index 9b79e83..1a17fd4 100644 --- a/avahi-gobject/ga-entry-group.c +++ b/avahi-gobject/ga-entry-group.c @@ -27,7 +27,7 @@ #include #include -#include "ga-errors.h" +#include "ga-error.h" #include "ga-entry-group.h" #include "ga-entry-group-enumtypes.h" @@ -386,7 +386,7 @@ GaEntryGroupService *ga_entry_group_add_service_full_strlist(GaEntryGroup * domain, host, port, txt); if (ret) { if (error != NULL) { - *error = g_error_new(GA_ERRORS, ret, + *error = g_error_new(GA_ERROR, ret, "Adding service to group failed: %s", avahi_strerror(ret)); } @@ -492,7 +492,7 @@ gboolean ga_entry_group_add_record_full(GaEntryGroup * group, size); if (ret) { if (error != NULL) { - *error = g_error_new(GA_ERRORS, ret, + *error = g_error_new(GA_ERROR, ret, "Setting raw record failed: %s", avahi_strerror(ret)); } @@ -519,7 +519,7 @@ gboolean ga_entry_group_service_thaw(GaEntryGroupService * service, GError ** er service->name, service->type, service->domain, txt); if (ret) { if (error != NULL) { - *error = g_error_new(GA_ERRORS, ret, + *error = g_error_new(GA_ERROR, ret, "Updating txt record failed: %s", avahi_strerror(ret)); } @@ -581,7 +581,7 @@ gboolean ga_entry_group_attach(GaEntryGroup * group, if (priv->group == NULL) { if (error != NULL) { int aerrno = avahi_client_errno(client->avahi_client); - *error = g_error_new(GA_ERRORS, aerrno, + *error = g_error_new(GA_ERROR, aerrno, "Attaching group failed: %s", avahi_strerror(aerrno)); } @@ -596,7 +596,7 @@ gboolean ga_entry_group_commit(GaEntryGroup * group, GError ** error) { ret = avahi_entry_group_commit(priv->group); if (ret) { if (error != NULL) { - *error = g_error_new(GA_ERRORS, ret, + *error = g_error_new(GA_ERROR, ret, "Committing group failed: %s", avahi_strerror(ret)); } @@ -611,7 +611,7 @@ gboolean ga_entry_group_reset(GaEntryGroup * group, GError ** error) { ret = avahi_entry_group_reset(priv->group); if (ret) { if (error != NULL) { - *error = g_error_new(GA_ERRORS, ret, + *error = g_error_new(GA_ERROR, ret, "Resetting group failed: %s", avahi_strerror(ret)); } diff --git a/avahi-gobject/ga-error.c b/avahi-gobject/ga-error.c new file mode 100644 index 0000000..f6ea9ae --- /dev/null +++ b/avahi-gobject/ga-error.c @@ -0,0 +1,32 @@ +/* + * ga-error.c - Source for error types used + * Copyright (C) 2006 Collabora Ltd. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include "ga-error.h" + +GQuark ga_error_quark(void) { + static GQuark quark = 0; + if (!quark) + quark = g_quark_from_static_string("ga_error"); + return quark; +} diff --git a/avahi-gobject/ga-error.h b/avahi-gobject/ga-error.h new file mode 100644 index 0000000..cb15050 --- /dev/null +++ b/avahi-gobject/ga-error.h @@ -0,0 +1,34 @@ +/* + * ga-error.h - Header for Avahi error types + * Copyright (C) 2005 Collabora Ltd. + * Copyright (C) 2005 Nokia Corporation + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef __GA_ERROR_H__ +#define __GA_ERROR_H__ + +#include + +G_BEGIN_DECLS +#include + +GQuark ga_error_quark(void); + +#define GA_ERROR ga_error_quark() + +G_END_DECLS +#endif /* #ifndef __GA_ERROR_H__ */ diff --git a/avahi-gobject/ga-errors.c b/avahi-gobject/ga-errors.c deleted file mode 100644 index 5abe36a..0000000 --- a/avahi-gobject/ga-errors.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * ga-errors.c - Source for error types used - * Copyright (C) 2006 Collabora Ltd. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include "ga-errors.h" - -GQuark ga_errors_quark(void) { - static GQuark quark = 0; - if (!quark) - quark = g_quark_from_static_string("ga_errors"); - return quark; -} diff --git a/avahi-gobject/ga-errors.h b/avahi-gobject/ga-errors.h deleted file mode 100644 index 9ed10e0..0000000 --- a/avahi-gobject/ga-errors.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * ga-errors.h - Header for Avahi error types - * Copyright (C) 2005 Collabora Ltd. - * Copyright (C) 2005 Nokia Corporation - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef __GA_ERRORS_H__ -#define __GA_ERRORS_H__ - -#include - -G_BEGIN_DECLS -#include - -GQuark ga_errors_quark(void); - -#define GA_ERRORS ga_errors_quark() - -G_END_DECLS -#endif /* #ifndef __GA_ERRORS_H__ */ diff --git a/avahi-gobject/ga-record-browser.c b/avahi-gobject/ga-record-browser.c index f6747cd..2fe536c 100644 --- a/avahi-gobject/ga-record-browser.c +++ b/avahi-gobject/ga-record-browser.c @@ -27,7 +27,7 @@ #include "ga-record-browser.h" #include "signals-marshal.h" -#include "ga-errors.h" +#include "ga-error.h" #include "ga-enums-enumtypes.h" G_DEFINE_TYPE(GaRecordBrowser, ga_record_browser, G_TYPE_OBJECT) @@ -344,7 +344,7 @@ static void _avahi_record_browser_cb(AVAHI_GCC_UNUSED AvahiRecordBrowser * r, Av case AVAHI_BROWSER_FAILURE:{ GError *error; int aerrno = avahi_client_errno(priv->client->avahi_client); - error = g_error_new(GA_ERRORS, aerrno, + error = g_error_new(GA_ERROR, aerrno, "Browsing failed: %s", avahi_strerror(aerrno)); g_signal_emit(self, signals[FAILURE], 0, error); @@ -371,7 +371,7 @@ gboolean ga_record_browser_attach(GaRecordBrowser * browser, if (priv->browser == NULL) { if (error != NULL) { int aerrno = avahi_client_errno(client->avahi_client); - *error = g_error_new(GA_ERRORS, aerrno, + *error = g_error_new(GA_ERROR, aerrno, "Attaching record browser failed: %s", avahi_strerror(aerrno)); } diff --git a/avahi-gobject/ga-service-browser.c b/avahi-gobject/ga-service-browser.c index f694ca5..2f4295c 100644 --- a/avahi-gobject/ga-service-browser.c +++ b/avahi-gobject/ga-service-browser.c @@ -30,7 +30,7 @@ #include "ga-service-browser.h" #include "signals-marshal.h" -#include "ga-errors.h" +#include "ga-error.h" #include "ga-enums-enumtypes.h" G_DEFINE_TYPE(GaServiceBrowser, ga_service_browser, G_TYPE_OBJECT) @@ -320,7 +320,7 @@ static void _avahi_service_browser_cb(AvahiServiceBrowser * b, AvahiIfIndex inte case AVAHI_BROWSER_FAILURE:{ GError *error; int aerrno = avahi_client_errno(priv->client->avahi_client); - error = g_error_new(GA_ERRORS, aerrno, + error = g_error_new(GA_ERROR, aerrno, "Browsing failed: %s", avahi_strerror(aerrno)); g_signal_emit(self, signals[FAILURE], 0, error); @@ -362,7 +362,7 @@ gboolean ga_service_browser_attach(GaServiceBrowser * browser, if (priv->browser == NULL) { if (error != NULL) { int aerrno = avahi_client_errno(client->avahi_client); - *error = g_error_new(GA_ERRORS, aerrno, + *error = g_error_new(GA_ERROR, aerrno, "Attaching group failed: %s", avahi_strerror(aerrno)); } diff --git a/avahi-gobject/ga-service-resolver.c b/avahi-gobject/ga-service-resolver.c index 380e0a5..6ba90cd 100644 --- a/avahi-gobject/ga-service-resolver.c +++ b/avahi-gobject/ga-service-resolver.c @@ -27,7 +27,7 @@ #include "ga-service-resolver.h" #include "signals-marshal.h" -#include "ga-errors.h" +#include "ga-error.h" #include "ga-enums.h" #include "ga-enums-enumtypes.h" @@ -332,7 +332,7 @@ static void _avahi_service_resolver_cb(AVAHI_GCC_UNUSED AvahiServiceResolver * r case AVAHI_RESOLVER_FAILURE:{ GError *error; int aerrno = avahi_client_errno(priv->client->avahi_client); - error = g_error_new(GA_ERRORS, aerrno, + error = g_error_new(GA_ERROR, aerrno, "Resolving failed: %s", avahi_strerror(aerrno)); g_signal_emit(self, signals[FAILURE], 0, error); @@ -378,7 +378,7 @@ gboolean ga_service_resolver_attach(GaServiceResolver * resolver, if (priv->resolver == NULL) { if (error != NULL) { int aerrno = avahi_client_errno(client->avahi_client); - *error = g_error_new(GA_ERRORS, aerrno, + *error = g_error_new(GA_ERROR, aerrno, "Attaching group failed: %s", avahi_strerror(aerrno)); }