libgda r3349 - in trunk: . doc/C/tmpl libgda



Author: vivien
Date: Thu Mar 12 19:10:30 2009
New Revision: 3349
URL: http://svn.gnome.org/viewvc/libgda?rev=3349&view=rev

Log:
2009-03-12  Vivien Malerba <malerba gnome-db org>

        * libgda/gda-holder.c:
        * libgda/gda-data-proxy.c:
        * libgda/gda-error.[ch]:
        * libgda/gda-types.[ch]:
        * libgda/gda-meta-store.c:
        * libgda/gda-set.c:
        * libgda/gda-init.c:
        * libgda/Makefile.am:
        * libgda/gda-custom-marshal.[ch]:
          - renamed gda-error.[ch] to gda-types.[ch] as more custom types are defined
          - don't install the new gda-types.h file
          - don't export the _get_type() symbols
          - fixes for bug #574736
        * libgda/gda-set.c:
        * doc/C: fixes for bug #574741
        * libgda/gda-set.[ch]: removed unused part in GdaSetSource and added padding
        for future expansion to GdaSetNode, GdaSetGroup and GdaSetSource


Added:
   trunk/libgda/gda-types.c   (contents, props changed)
      - copied, changed from r3347, /trunk/libgda/gda-error.c
   trunk/libgda/gda-types.h   (contents, props changed)
      - copied, changed from r3347, /trunk/libgda/gda-error.h
Removed:
   trunk/libgda/gda-error.c
   trunk/libgda/gda-error.h
Modified:
   trunk/ChangeLog
   trunk/doc/C/tmpl/gda-set.sgml
   trunk/libgda/Makefile.am
   trunk/libgda/gda-custom-marshal.c
   trunk/libgda/gda-custom-marshal.h
   trunk/libgda/gda-data-proxy.c
   trunk/libgda/gda-holder.c
   trunk/libgda/gda-init.c
   trunk/libgda/gda-meta-store.c
   trunk/libgda/gda-set.c
   trunk/libgda/gda-set.h
   trunk/libgda/libgda.symbols

Modified: trunk/doc/C/tmpl/gda-set.sgml
==============================================================================
--- trunk/doc/C/tmpl/gda-set.sgml	(original)
+++ trunk/doc/C/tmpl/gda-set.sgml	Thu Mar 12 19:10:30 2009
@@ -6,9 +6,10 @@
 
 <!-- ##### SECTION Long_Description ##### -->
 <para>
-  The #GdaSet object is a container for several values (as #GdaHolder objects), which also offers
-  different classifications of the group of #GdaHolder values (see gda_set_get_node(), gda_set_get_source() or
-  gda_set_get_group()).
+  The #GdaSet object is a container for several values (as #GdaHolder objects). The list of #GdaHolder objects is
+  publicly accessible (and should not be modified), using the "holders" attribute. Each #GdaSet object also
+  maintains some publicly accessible information about the #GdaHolder objects, through the #GdaSetNode, #GdaSetSource and
+  #GdaSetGroup structures (see gda_set_get_node(), gda_set_get_source() and gda_set_get_group()).
 </para>
 <para>
   It is possible to control the values a #GdaHolder can have in the #GdaSet by connecting to the 
@@ -212,12 +213,16 @@
 
 <!-- ##### STRUCT GdaSetNode ##### -->
 <para>
-
+  For each #GdaHolder object in the #GdaSet object, there is a
+  #GdaSetNode structure which sums up all the information for
+  each GdaHolder. Contains public fields, which must not be modified.
 </para>
 
- holder: 
- source_model: 
- source_column: 
+ holder: a #GdaHolder in the #GdaSet
+ source_model: if gda_holder_set_source_model() has been used with @holder, the #GdaDataModel used, or %NULL
+ source_column: if gda_holder_set_source_model() has been used with @holder, the column used, or 0
+ _gda_reserved1: 
+ _gda_reserved2: 
 
 <!-- ##### FUNCTION gda_set_get_node ##### -->
 <para>
@@ -231,15 +236,16 @@
 
 <!-- ##### STRUCT GdaSetSource ##### -->
 <para>
-
+  There is a #GdaSetSource structure for each #GdaDataModel which
+  restricts at least one #GdaHolder in the #GdaSet object.
 </para>
 
- data_model: 
- nodes: 
- shown_n_cols: 
- shown_cols_index: 
- ref_n_cols: 
- ref_cols_index: 
+ data_model: the #GdaDataModel
+ nodes: the list of #GdaSetNode where the @source_model attribute equals @data_model
+ _gda_reserved1: 
+ _gda_reserved2: 
+ _gda_reserved3: 
+ _gda_reserved4: 
 
 <!-- ##### FUNCTION gda_set_get_source_for_model ##### -->
 <para>
@@ -263,11 +269,15 @@
 
 <!-- ##### STRUCT GdaSetGroup ##### -->
 <para>
-
+  There is one #GdaSetGroup structure
+  for each _independant_ #GdaHolder (those which have the same restricting data model
+  all appear in the same #GdaSetGroup structure).
 </para>
 
- nodes: 
- nodes_source: 
+ nodes: a list of #GdaSetNode structures, at least one entry
+ nodes_source: a #GdaSetSource pointer where the @nodes attribute lists the same #GdaHolder objects as @nodes
+ _gda_reserved1: 
+ _gda_reserved2: 
 
 <!-- ##### FUNCTION gda_set_get_group ##### -->
 <para>

Modified: trunk/libgda/Makefile.am
==============================================================================
--- trunk/libgda/Makefile.am	(original)
+++ trunk/libgda/Makefile.am	Thu Mar 12 19:10:30 2009
@@ -53,7 +53,6 @@
 	gda-debug-macros.h \
 	gda-decl.h \
 	gda-easy.h \
-	gda-error.h \
 	gda-enums.h \
 	gda-holder.h \
 	gda-lockable.h \
@@ -108,7 +107,8 @@
 	gda-data-select.c \
 	gda-data-select-extra.h \
 	gda-easy.c \
-	gda-error.c \
+	gda-types.c \
+	gda-types.h \
 	gda-holder.c \
 	gda-init.c \
 	gda-lockable.c \

Modified: trunk/libgda/gda-custom-marshal.c
==============================================================================
--- trunk/libgda/gda-custom-marshal.c	(original)
+++ trunk/libgda/gda-custom-marshal.c	Thu Mar 12 19:10:30 2009
@@ -264,5 +264,71 @@
 			     g_value_get_int (param_values + 1),
 			     g_value_get_int (param_values + 2),
 			     data2);
+	g_value_take_boxed (return_value, v_return);
+}
+
+void
+_gda_marshal_VOID__SLIST (GClosure     *closure,
+			  GValue       *return_value G_GNUC_UNUSED,
+			  guint         n_param_values,
+			  const GValue *param_values,
+			  gpointer      invocation_hint G_GNUC_UNUSED,
+			  gpointer      marshal_data)
+{
+	typedef void (*GMarshalFunc_VOID__SLIST) (gpointer     data1,
+						  gpointer     arg_1,
+						  gpointer     data2);
+	register GMarshalFunc_VOID__SLIST callback;
+	register GCClosure *cc = (GCClosure*) closure;
+	register gpointer data1, data2; 
+	
+	g_return_if_fail (n_param_values == 2);
+	
+	if (G_CCLOSURE_SWAP_DATA (closure)) {
+		data1 = closure->data;
+		data2 = g_value_peek_pointer (param_values + 0);
+	}
+	else {
+		data1 = g_value_peek_pointer (param_values + 0);
+		data2 = closure->data;
+	}
+	callback = (GMarshalFunc_VOID__SLIST) (marshal_data ? marshal_data : cc->callback);
+	
+	callback (data1,
+		  g_value_get_pointer (param_values + 1),
+		  data2);
+}
+
+void
+_gda_marshal_ERROR__METACONTEXT (GClosure     *closure,
+				 GValue       *return_value G_GNUC_UNUSED,
+				 guint         n_param_values,
+				 const GValue *param_values,
+				 gpointer      invocation_hint G_GNUC_UNUSED,
+				 gpointer      marshal_data)
+{
+	typedef GError *(*GMarshalFunc_ERROR__METACONTEXT) (gpointer     data1,
+							    gpointer     arg_1,
+							    gpointer     data2);
+	register GMarshalFunc_ERROR__METACONTEXT callback;
+	register GCClosure *cc = (GCClosure*) closure;
+	register gpointer data1, data2; 
+	GError *v_return;
+	
+	g_return_if_fail (n_param_values == 2);
+	
+	if (G_CCLOSURE_SWAP_DATA (closure)) {
+		data1 = closure->data;
+		data2 = g_value_peek_pointer (param_values + 0);
+	}
+	else {
+		data1 = g_value_peek_pointer (param_values + 0);
+		data2 = closure->data;
+	}
+	callback = (GMarshalFunc_ERROR__METACONTEXT) (marshal_data ? marshal_data : cc->callback);
+	
+	v_return = callback (data1,
+			     g_value_get_pointer (param_values + 1),
+			     data2);
 	g_value_take_boxed (return_value, v_return);	
 }

Modified: trunk/libgda/gda-custom-marshal.h
==============================================================================
--- trunk/libgda/gda-custom-marshal.h	(original)
+++ trunk/libgda/gda-custom-marshal.h	Thu Mar 12 19:10:30 2009
@@ -92,6 +92,24 @@
 			    gpointer      invocation_hint G_GNUC_UNUSED,
 			    gpointer      marshal_data);
 
+/* VOID:SLIST */
+void
+_gda_marshal_VOID__SLIST (GClosure     *closure,
+			  GValue       *return_value G_GNUC_UNUSED,
+			  guint         n_param_values,
+			  const GValue *param_values,
+			  gpointer      invocation_hint G_GNUC_UNUSED,
+			  gpointer      marshal_data);
+
+/* ERROR:GdaMetaContext */
+void
+_gda_marshal_ERROR__METACONTEXT (GClosure     *closure,
+				 GValue       *return_value G_GNUC_UNUSED,
+				 guint         n_param_values,
+				 const GValue *param_values,
+				 gpointer      invocation_hint G_GNUC_UNUSED,
+				 gpointer      marshal_data);
+
 G_END_DECLS
 
 #endif

Modified: trunk/libgda/gda-data-proxy.c
==============================================================================
--- trunk/libgda/gda-data-proxy.c	(original)
+++ trunk/libgda/gda-data-proxy.c	Thu Mar 12 19:10:30 2009
@@ -39,7 +39,7 @@
 #include <sql-parser/gda-sql-statement.h>
 #include <sql-parser/gda-statement-struct-util.h>
 #include <libgda/gda-custom-marshal.h>
-#include <libgda/gda-error.h>
+#include <libgda/gda-types.h>
 #include <gda-mutex.h>
 
 /* 

Modified: trunk/libgda/gda-holder.c
==============================================================================
--- trunk/libgda/gda-holder.c	(original)
+++ trunk/libgda/gda-holder.c	Thu Mar 12 19:10:30 2009
@@ -30,7 +30,7 @@
 #include <libgda.h>
 #include <libgda/gda-attributes-manager.h>
 #include <libgda/gda-custom-marshal.h>
-#include <libgda/gda-error.h>
+#include <libgda/gda-types.h>
 
 /* 
  * Main static functions 
@@ -1421,8 +1421,9 @@
  * @col: the reference column in @model
  * @error: location to store error, or %NULL
  *
- * Sets a limit on the possible values for the @holder holder: the value must be among the values
- * contained in the @col column of the @model data model.
+ * Sets an hint that @holder's values should be restricted among the values
+ * contained in the @col column of the @model data model. Note that this is just a hint,
+ * meaning this policy is not enforced by @holder's implementation.
  *
  * Returns: TRUE if no error occurred
  */
@@ -1469,12 +1470,16 @@
 /**
  * gda_holder_get_source_model
  * @holder: a #GdaHolder
- * @col: a place to store the column in the model sourceing the holder, or %NULL
+ * @col: a place to store the column in the model sourcing the holder, or %NULL
  *
- * Tells if @holder has its values sourceed by a #GdaDataModel, and optionnaly
- * allows to fetch the resteictions.
+ * If gda_holder_set_source_model() has been used to provide a hint that @holder's value
+ * should be among the values contained in a column of a data model, then this method
+ * returns which data model, and if @col is not %NULL, then it is set to the restricting column
+ * as well.
  *
- * Returns: a pointer to the #GdaDataModel source for @holder
+ * Otherwise, this method returns %NULL, and if @col is not %NULL, then it is set to 0.
+ *
+ * Returns: a pointer to a #GdaDataModel, or %NULL
  */
 GdaDataModel *
 gda_holder_get_source_model (GdaHolder *holder, gint *col)

Modified: trunk/libgda/gda-init.c
==============================================================================
--- trunk/libgda/gda-init.c	(original)
+++ trunk/libgda/gda-init.c	Thu Mar 12 19:10:30 2009
@@ -27,7 +27,7 @@
 
 #include <libgda/binreloc/gda-binreloc.h>
 #include <sql-parser/gda-sql-parser.h>
-#include <libgda/gda-error.h>
+#include <libgda/gda-types.h>
 
 /* global variables */
 xmlDtdPtr       gda_array_dtd = NULL;

Modified: trunk/libgda/gda-meta-store.c
==============================================================================
--- trunk/libgda/gda-meta-store.c	(original)
+++ trunk/libgda/gda-meta-store.c	Thu Mar 12 19:10:30 2009
@@ -32,12 +32,14 @@
 #include <libgda/gda-data-model-array.h>
 #include <libgda/binreloc/gda-binreloc.h>
 #include "gda-marshal.h"
+#include "gda-custom-marshal.h"
 #include <stdarg.h>
 #include <libxml/parser.h>
 #include <libxml/tree.h>
 #include <libgda/gda-util.h>
 #include <libgda/gda-meta-struct.h>
 #include <libgda/gda-connection.h>
+#include "gda-types.h"
 
 /*
  * Main static functions
@@ -315,8 +317,8 @@
 {
         GError *error;
 
-        error = g_value_get_pointer (handler_return);
-        g_value_set_pointer (return_accu, error);
+        error = g_value_get_boxed (handler_return);
+        g_value_set_boxed (return_accu, error);
 
         return error ? FALSE : TRUE; /* stop signal if 'thisvalue' is FALSE */
 }
@@ -340,8 +342,9 @@
 	 * @store: the #GdaMetaStore instance that emitted the signal
 	 * @suggest: the suggested update, as a #GdaMetaContext structure
 	 *
-	 * This signal is emitted when the contents of a table should be updated (data updated or inserted; 
-	 * deleting data is done automatically).
+	 * This signal is emitted when the contents of a table should be updated (data to update or insert only; 
+	 * deleting data is done automatically). This signal is used for internal purposes by the #GdaConnection
+	 * object.
 	 *
 	 * Returns: a new #GError error structure if there was an error when processing the
 	 * signal, or %NULL if signal propagation should continue
@@ -352,12 +355,12 @@
 		G_SIGNAL_RUN_LAST,
 		G_STRUCT_OFFSET (GdaMetaStoreClass, suggest_update),
 		suggest_update_accumulator, NULL,
-		_gda_marshal_POINTER__POINTER, G_TYPE_POINTER,
-		1, G_TYPE_POINTER);
+		_gda_marshal_ERROR__METACONTEXT, GDA_TYPE_ERROR,
+		1, GDA_TYPE_META_CONTEXT);
 	/**
 	 * GdaMetaStore::meta-changed
 	 * @store: the #GdaMetaStore instance that emitted the signal
-	 * @changes: a list of changes made
+	 * @changes: a list of changes made, as a #GSList of pointers to #GdaMetaStoreChange (which must not be modified)
 	 *
 	 * This signal is emitted when the @store's contents have changed (the changes are in the @changes list)
 	 */
@@ -367,8 +370,8 @@
 		G_SIGNAL_RUN_FIRST,
 		G_STRUCT_OFFSET (GdaMetaStoreClass, meta_changed),
 		NULL, NULL,
-		_gda_marshal_VOID__POINTER, G_TYPE_NONE,
-		1, G_TYPE_POINTER);
+		_gda_marshal_VOID__SLIST, G_TYPE_NONE,
+		1, GDA_TYPE_SLIST);
 	/**
 	 * GdaMetaStore::meta-reset
 	 * @store: the #GdaMetaStore instance that emitted the signal

Modified: trunk/libgda/gda-set.c
==============================================================================
--- trunk/libgda/gda-set.c	(original)
+++ trunk/libgda/gda-set.c	Thu Mar 12 19:10:30 2009
@@ -36,7 +36,7 @@
 #include "gda-server-provider.h"
 #include "gda-util.h"
 #include <libgda/gda-custom-marshal.h>
-#include <libgda/gda-error.h>
+#include <libgda/gda-types.h>
 
 extern xmlDtdPtr gda_paramlist_dtd;
 extern gchar *gda_lang_locale;
@@ -1041,9 +1041,6 @@
 	parent_class->finalize (object);
 }
 
-static void compute_shown_columns_index (GdaSetSource *source);
-static void compute_ref_columns_index (GdaSetSource *source);
-
 /*
  * Resets and computes set->nodes, and if some nodes already exist, they are previously discarded
  */
@@ -1122,16 +1119,6 @@
 		list = g_slist_next (list);
 	}
 	
-	/*
-	 * Filling information in all the GdaSetSource structures
-	 */
-	list = set->sources_list;
-	while (list) {
-		compute_shown_columns_index (GDA_SET_SOURCE (list->data));
-		compute_ref_columns_index (GDA_SET_SOURCE (list->data));
-		list = g_slist_next (list);
-	}
-
 	g_hash_table_destroy (groups);
 
 #ifdef GDA_DEBUG_signal
@@ -1143,103 +1130,6 @@
 #endif
 }
 
-static void
-compute_shown_columns_index (GdaSetSource *source)
-{
-        gint ncols, nholders;
-        gint *mask = NULL, masksize = 0;
-
-        nholders = g_slist_length (source->nodes);
-        g_return_if_fail (nholders > 0);
-        ncols = gda_data_model_get_n_columns (GDA_DATA_MODEL (source->data_model));
-        g_return_if_fail (ncols > 0);
-
-        if (ncols > nholders) {
-                /* we only want columns which are not holders */
-                gint i, current = 0;
-
-                masksize = ncols - nholders;
-                mask = g_new0 (gint, masksize);
-                for (i = 0; i < ncols ; i++) {
-                        GSList *list = source->nodes;
-                        gboolean found = FALSE;
-                        while (list && !found) {
-                                if (GDA_SET_NODE (list->data)->source_column == i)
-                                        found = TRUE;
-                                else
-                                        list = g_slist_next (list);
-                        }
-                        if (!found) {
-                                mask[current] = i;
-                                current ++;
-                        }
-                }
-                masksize = current;
-        }
-        else {
-                /* we want all the columns */
-                gint i;
-
-                masksize = ncols;
-                mask = g_new0 (gint, masksize);
-                for (i=0; i<ncols; i++) {
-                        mask[i] = i;
-                }
-        }
-
-        source->shown_n_cols = masksize;
-        source->shown_cols_index = mask;
-}
-
-static void
-compute_ref_columns_index (GdaSetSource *source)
-{
-        gint ncols, nholders;
-        gint *mask = NULL, masksize = 0;
-
-        nholders = g_slist_length (source->nodes);
-        g_return_if_fail (nholders > 0);
-        ncols = gda_data_model_get_n_columns (GDA_DATA_MODEL (source->data_model));
-        g_return_if_fail (ncols > 0);
-
-        if (ncols > nholders) {
-                /* we only want columns which are holders */
-                gint i, current = 0;
-
-                masksize = ncols - nholders;
-                mask = g_new0 (gint, masksize);
-                for (i=0; i<ncols ; i++) {
-                        GSList *list = source->nodes;
-                        gboolean found = FALSE;
-                        while (list && !found) {
-                                if (GDA_SET_NODE (list->data)->source_column == i)
-                                        found = TRUE;
-                                else
-                                        list = g_slist_next (list);
-                        }
-                        if (found) {
-                                mask[current] = i;
-                                current ++;
-                        }
-                }
-                masksize = current;
-        }
-        else {
-                /* we want all the columns */
-                gint i;
-
-                masksize = ncols;
-                mask = g_new0 (gint, masksize);
-                for (i=0; i<ncols; i++) {
-                        mask[i] = i;
-                }
-        }
-
-        source->ref_n_cols = masksize;
-        source->ref_cols_index = mask;
-}
-
-
 /**
  * gda_set_add_holder
  * @set: a #GdaSet object
@@ -1351,8 +1241,6 @@
 
 	if (source->nodes)
 		g_slist_free (source->nodes);
-	g_free (source->shown_cols_index);
-	g_free (source->ref_cols_index);
 
 	set->sources_list = g_slist_remove (set->sources_list, source);
 	g_free (source);
@@ -1513,7 +1401,7 @@
  * @model: a #GdaDataModel object
  *
  * Finds the #GdaSetSource structure used in @set for which @model is a
- * the data model, don't modify the returned structure
+ * the data model (the returned structure should not be modified).
  *
  * Returns: a #GdaSetSource pointer or %NULL.
  */

Modified: trunk/libgda/gda-set.h
==============================================================================
--- trunk/libgda/gda-set.h	(original)
+++ trunk/libgda/gda-set.h	Thu Mar 12 19:10:30 2009
@@ -44,49 +44,34 @@
 	GDA_SET_INVALID_ERROR
 } GdaSetError;
 
-/**
- * GdaSetNode:
- *
- * For each #GdaHolder object in the #GdaSet object, there is a
- * #GdaSetNode structure which sums up all the information for
- * each GdaHolder.
- */
 struct _GdaSetNode {
 	GdaHolder    *holder;        /* Can't be NULL */
-	GdaDataModel *source_model;  /* may be NULL if @holder does not have any source */
-	gint          source_column; /* unused is @source_model is NULL */
+	GdaDataModel *source_model;  /* may be NULL */
+	gint          source_column; /* unused if @source_model is NULL */
+
+	/* Padding for future expansion */
+	gpointer      _gda_reserved1;
+	gpointer      _gda_reserved2;
 };
 
-/**
- * GdaSetGroup:
- *
- * The #GdaSetGroup is another view of the #GdaHolder objects
- * contained in the #GdaSet: there is one such structure
- * for each _independant_ parameter (parameters which have the same source data model
- * all appear in the same #GdaSetGroup structure).
- */
 struct _GdaSetGroup {
 	GSList       *nodes;       /* list of GdaSetNode, at least one entry */
 	GdaSetSource *nodes_source; /* if NULL, then @nodes contains exactly one entry */
+
+	/* Padding for future expansion */
+	gpointer      _gda_reserved1;
+	gpointer      _gda_reserved2;
 };
 
-/**
- * GdaSetSource:
- *
- * There is a #GdaSetSource structure for each #GdaDataModel which
- * is a source for least one #GdaHolder in the #GdaSet object.
- */
 struct _GdaSetSource {
 	GdaDataModel   *data_model;   /* Can't be NULL */
 	GSList         *nodes;        /* list of #GdaSetNode for which source_model == @data_model */
 
-	/* displayed columns in 'data_model' */
-        gint            shown_n_cols;
-        gint           *shown_cols_index;
-
-        /* columns used as a reference (corresponding to PK values) in 'data_model' */
-        gint            ref_n_cols;
-        gint           *ref_cols_index;
+	/* Padding for future expansion */
+	gpointer        _gda_reserved1;
+	gpointer        _gda_reserved2;
+	gpointer        _gda_reserved3;
+	gpointer        _gda_reserved4;
 };
 
 #define GDA_SET_NODE(x) ((GdaSetNode *)(x))

Copied: trunk/libgda/gda-types.c (from r3347, /trunk/libgda/gda-error.c)
==============================================================================
--- /trunk/libgda/gda-error.c	(original)
+++ trunk/libgda/gda-types.c	Thu Mar 12 19:10:30 2009
@@ -1,5 +1,5 @@
 /*
- * gda-error.c
+ * gda-types.c
  * Copyright (C) 2007 Sebastien Granjoux  <seb sfo free fr>
  *               2008 Vivien Malerba <malerba gnome-db org>
  *
@@ -18,10 +18,10 @@
  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include "gda-error.h"
+#include "gda-types.h"
 
 GType
-gda_error_get_type (void)
+_gda_error_get_type (void)
 {
 	static GType type = 0;
 
@@ -37,3 +37,35 @@
 
 	return type;
 }
+
+GType
+_gda_slist_get_type (void)
+{
+	static GType type = 0;
+
+	if (G_UNLIKELY (type == 0)) {
+		static GStaticMutex registering = G_STATIC_MUTEX_INIT;
+		g_static_mutex_lock (&registering);
+                if (type == 0)
+			type = g_pointer_type_register_static ("GdaSList");
+		g_static_mutex_unlock (&registering);
+	}
+
+	return type;
+}
+
+GType
+_gda_meta_context_get_type (void)
+{
+	static GType type = 0;
+
+	if (G_UNLIKELY (type == 0)) {
+		static GStaticMutex registering = G_STATIC_MUTEX_INIT;
+		g_static_mutex_lock (&registering);
+                if (type == 0)
+			type = g_pointer_type_register_static ("GdaMetaContext");
+		g_static_mutex_unlock (&registering);
+	}
+
+	return type;
+}

Copied: trunk/libgda/gda-types.h (from r3347, /trunk/libgda/gda-error.h)
==============================================================================
--- /trunk/libgda/gda-error.h	(original)
+++ trunk/libgda/gda-types.h	Thu Mar 12 19:10:30 2009
@@ -1,5 +1,5 @@
 /*
- * gda-error.h
+ * gda-types.h
  * Copyright (C) 2007 Sebastien Granjoux  <seb sfo free fr>
  *               2008 Vivien Malerba <malerba gnome-db org>
  *
@@ -17,18 +17,25 @@
  * License along with this library; if not, write to the Free
  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-#ifndef __GDA_ERROR_H__
-#define __GDA_ERROR_H__
+#ifndef __GDA_TYPES_H__
+#define __GDA_TYPES_H__
 
 #include <glib-object.h>
 
 G_BEGIN_DECLS
 
 /* Boxed type for GError will not be done in GLib see bug #300610 */
+#define GDA_TYPE_ERROR (_gda_error_get_type())
+GType   _gda_error_get_type (void) G_GNUC_CONST;
 
-#define GDA_TYPE_ERROR		(gda_error_get_type())
+/* Pointer type for GSList (not a boxed type!) */
+#define GDA_TYPE_SLIST (_gda_slist_get_type())
+GType   _gda_slist_get_type (void) G_GNUC_CONST;
+
+/* Pointer type for GdaMetaContext (not a boxed type!) */
+#define GDA_TYPE_META_CONTEXT (_gda_meta_context_get_type())
+GType   _gda_meta_context_get_type (void) G_GNUC_CONST;
 
-GType   gda_error_get_type (void) G_GNUC_CONST;
 
 G_END_DECLS
 

Modified: trunk/libgda/libgda.symbols
==============================================================================
--- trunk/libgda/libgda.symbols	(original)
+++ trunk/libgda/libgda.symbols	Thu Mar 12 19:10:30 2009
@@ -315,7 +315,6 @@
 	gda_easy_create_table_flag_get_type
 	gda_easy_error_get_type
 	gda_easy_error_quark
-	gda_error_get_type
 	gda_execute_non_select_command
 	gda_execute_select_command
 	gda_gbr_get_file_path



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