[gobject-introspection] [girepository] Move GIErrorDomainInfo out of ginfo.ch



commit bb10200e76c99ff3695cd5dc85bba875642b99d2
Author: Johan Dahlin <johan gnome org>
Date:   Sun Jun 6 13:01:26 2010 -0300

    [girepository] Move GIErrorDomainInfo out of ginfo.ch

 girepository/Makefile.am         |    4 +-
 girepository/gierrordomaininfo.c |   87 ++++++++++++++++++++++++++++++++++++++
 girepository/gierrordomaininfo.h |   44 +++++++++++++++++++
 girepository/ginfo.c             |   62 ---------------------------
 girepository/girepository.h      |   10 +----
 5 files changed, 135 insertions(+), 72 deletions(-)
---
diff --git a/girepository/Makefile.am b/girepository/Makefile.am
index 260d05d..db5e6d4 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 0000000..aa06719
--- /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 0000000..9c2968b
--- /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 47cbd00..3859aab 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 30a2fde..89a66b9 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) \



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]