summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Dahlin <johan@gnome.org>2010-06-06 13:01:26 -0300
committerJohan Dahlin <johan@gnome.org>2010-06-06 13:01:26 -0300
commitbb10200e76c99ff3695cd5dc85bba875642b99d2 (patch)
tree40d4e8e01687d1e0abbfe9a4698aef215c6472a6
parent161ebdd7a903a868f15adbe1c551a913d2e0e8a2 (diff)
downloadgobject-introspection-bb10200e76c99ff3695cd5dc85bba875642b99d2.tar.gz
[girepository] Move GIErrorDomainInfo out of ginfo.ch
-rw-r--r--girepository/Makefile.am4
-rw-r--r--girepository/gierrordomaininfo.c87
-rw-r--r--girepository/gierrordomaininfo.h44
-rw-r--r--girepository/ginfo.c62
-rw-r--r--girepository/girepository.h10
5 files changed, 135 insertions, 72 deletions
diff --git a/girepository/Makefile.am b/girepository/Makefile.am
index 260d05da..db5e6d4d 100644
--- a/girepository/Makefile.am
+++ b/girepository/Makefile.am
@@ -3,6 +3,7 @@ girepo_HEADERS = \
giarginfo.h \
gibaseinfo.h \
gicallableinfo.h \
+ gierrordomaininfo.h \
gifunctioninfo.h \
girepository.h \
girffi.h \
@@ -18,8 +19,9 @@ libgirepository_1_0_la_SOURCES = \
gfield.c \
giarginfo.c \
gibaseinfo.c \
- gifunctioninfo.c \
gicallableinfo.c \
+ gierrordomaininfo.c \
+ gifunctioninfo.c \
ginfo.c \
ginvoke.c \
girepository.c \
diff --git a/girepository/gierrordomaininfo.c b/girepository/gierrordomaininfo.c
new file mode 100644
index 00000000..aa06719f
--- /dev/null
+++ b/girepository/gierrordomaininfo.c
@@ -0,0 +1,87 @@
+/* GObject introspection: ErrorDomain implementation
+ *
+ * Copyright (C) 2005 Matthias Clasen
+ * Copyright (C) 2008,2009 Red Hat, Inc.
+ *
+ * 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 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., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include <glib.h>
+
+#include <girepository.h>
+#include "girepository-private.h"
+#include "gitypelib-internal.h"
+
+/**
+ * SECTION:gierrordomaininfo
+ * @Short_description: Struct representing an error domain
+ * @Title: GIErrorDomainInfo
+ *
+ * A GIErrorDomainInfo struct represents a domain of a #GError.
+ * An error domain is associated with a #GQuark and contains a pointer
+ * to an enum with all the error codes.
+ */
+
+/**
+ * g_error_domain_info_get_quark:
+ * @info: a #GIErrorDomainInfo
+ *
+ * Obtain a string representing the quark for this error domain.
+ * %NULL will be returned if the type tag is wrong or if a quark is
+ * missing in the typelib.
+ *
+ * Returns: the quark represented as a string or %NULL
+ */
+const gchar *
+g_error_domain_info_get_quark (GIErrorDomainInfo *info)
+{
+ GIRealInfo *rinfo = (GIRealInfo *)info;
+ ErrorDomainBlob *blob;
+
+ g_return_val_if_fail (info != NULL, NULL);
+ g_return_val_if_fail (GI_IS_ERROR_DOMAIN_INFO (info), NULL);
+
+ blob = (ErrorDomainBlob *)&rinfo->typelib->data[rinfo->offset];
+
+ return g_typelib_get_string (rinfo->typelib, blob->get_quark);
+}
+
+/**
+ * g_error_domain_info_get_codes:
+ * @info: a #GIErrorDomainInfo
+ *
+ * Obtain the enum containing all the error codes for this error domain.
+ * The return value will have a #GIInfoType of %GI_INFO_TYPE_ERROR_DOMAIN
+ *
+ * Returns: (transfer full): the error domain or %NULL if type tag is wrong,
+ * free the struct with g_base_info_unref() when done.
+ */
+GIInterfaceInfo *
+g_error_domain_info_get_codes (GIErrorDomainInfo *info)
+{
+ GIRealInfo *rinfo = (GIRealInfo *)info;
+ ErrorDomainBlob *blob;
+
+ g_return_val_if_fail (info != NULL, NULL);
+ g_return_val_if_fail (GI_IS_ERROR_DOMAIN_INFO (info), NULL);
+
+ blob = (ErrorDomainBlob *)&rinfo->typelib->data[rinfo->offset];
+
+ return (GIInterfaceInfo *) _g_info_from_entry (rinfo->repository,
+ rinfo->typelib, blob->error_codes);
+}
+
+
diff --git a/girepository/gierrordomaininfo.h b/girepository/gierrordomaininfo.h
new file mode 100644
index 00000000..9c2968bc
--- /dev/null
+++ b/girepository/gierrordomaininfo.h
@@ -0,0 +1,44 @@
+/* GObject introspection: Error Domain
+ *
+ * Copyright (C) 2005 Matthias Clasen
+ * Copyright (C) 2008,2009 Red Hat, Inc.
+ *
+ * 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 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., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __GIERRORDOMAININFO_H__
+#define __GIERRORDOMAININFO_H__
+
+#if !defined (__GIREPOSITORY_H_INSIDE__) && !defined (GI_COMPILATION)
+#error "Only <girepository.h> can be included directly."
+#endif
+
+#include <gitypes.h>
+
+G_BEGIN_DECLS
+
+#define GI_IS_ERROR_DOMAIN_INFO(info) \
+ (g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_ERROR_DOMAIN)
+
+const gchar * g_error_domain_info_get_quark (GIErrorDomainInfo *info);
+GIInterfaceInfo * g_error_domain_info_get_codes (GIErrorDomainInfo *info);
+
+
+G_END_DECLS
+
+
+#endif /* __GIERRORDOMAININFO_H__ */
+
diff --git a/girepository/ginfo.c b/girepository/ginfo.c
index 47cbd008..3859aab9 100644
--- a/girepository/ginfo.c
+++ b/girepository/ginfo.c
@@ -29,68 +29,6 @@
#include "girepository-private.h"
-/* GIErrorDomainInfo functions */
-
-/**
- * SECTION:gierrordomaininfo
- * @Short_description: Struct representing an error domain
- * @Title: GIErrorDomainInfo
- *
- * A GIErrorDomainInfo struct represents a domain of a #GError.
- * An error domain is associated with a #GQuark and contains a pointer
- * to an enum with all the error codes.
- */
-
-/**
- * g_error_domain_info_get_quark:
- * @info: a #GIErrorDomainInfo
- *
- * Obtain a string representing the quark for this error domain.
- * %NULL will be returned if the type tag is wrong or if a quark is
- * missing in the typelib.
- *
- * Returns: the quark represented as a string or %NULL
- */
-const gchar *
-g_error_domain_info_get_quark (GIErrorDomainInfo *info)
-{
- GIRealInfo *rinfo = (GIRealInfo *)info;
- ErrorDomainBlob *blob;
-
- g_return_val_if_fail (info != NULL, NULL);
- g_return_val_if_fail (GI_IS_ERROR_DOMAIN_INFO (info), NULL);
-
- blob = (ErrorDomainBlob *)&rinfo->typelib->data[rinfo->offset];
-
- return g_typelib_get_string (rinfo->typelib, blob->get_quark);
-}
-
-/**
- * g_error_domain_info_get_codes:
- * @info: a #GIErrorDomainInfo
- *
- * Obtain the enum containing all the error codes for this error domain.
- * The return value will have a #GIInfoType of %GI_INFO_TYPE_ERROR_DOMAIN
- *
- * Returns: (transfer full): the error domain or %NULL if type tag is wrong,
- * free the struct with g_base_info_unref() when done.
- */
-GIInterfaceInfo *
-g_error_domain_info_get_codes (GIErrorDomainInfo *info)
-{
- GIRealInfo *rinfo = (GIRealInfo *)info;
- ErrorDomainBlob *blob;
-
- g_return_val_if_fail (info != NULL, NULL);
- g_return_val_if_fail (GI_IS_ERROR_DOMAIN_INFO (info), NULL);
-
- blob = (ErrorDomainBlob *)&rinfo->typelib->data[rinfo->offset];
-
- return (GIInterfaceInfo *) _g_info_from_entry (rinfo->repository,
- rinfo->typelib, blob->error_codes);
-}
-
-
/* GIEnumInfo and GIValueInfo functions */
/**
diff --git a/girepository/girepository.h b/girepository/girepository.h
index 30a2fdea..89a66b99 100644
--- a/girepository/girepository.h
+++ b/girepository/girepository.h
@@ -29,6 +29,7 @@
#include <giarginfo.h>
#include <gibaseinfo.h>
#include <gicallableinfo.h>
+#include <gierrordomaininfo.h>
#include <gifunctioninfo.h>
#include <gitypeinfo.h>
#include <gitypelib.h>
@@ -148,15 +149,6 @@ void gi_cclosure_marshal_generic (GClosure *closure,
gpointer invocation_hint,
gpointer marshal_data);
-/* GIErrorDomainInfo */
-
-#define GI_IS_ERROR_DOMAIN_INFO(info) \
- (g_base_info_get_type((GIBaseInfo*)info) == GI_INFO_TYPE_ERROR_DOMAIN)
-
-const gchar * g_error_domain_info_get_quark (GIErrorDomainInfo *info);
-GIInterfaceInfo * g_error_domain_info_get_codes (GIErrorDomainInfo *info);
-
-
/* GIValueInfo */
#define GI_IS_VALUE_INFO(info) \