[libgda] Removing GdaMutex from intrespection. GI improvements and Deprecations. * gda_data_model_ldap_new ha



commit c7acde0916935c62cb9696d0d1aaad599f6f6128
Author: Daniel Espinosa <despinosa src gnome org>
Date:   Wed Feb 15 13:05:38 2012 -0600

    Removing GdaMutex from intrespection. GI improvements and Deprecations.
    * gda_data_model_ldap_new has been deprecated, use gda_data_model_ldap_new_with_config
    instead

 libgda/Gda-5.0.gir                     |  152 ++++++++++++++------------------
 libgda/Makefile.am                     |    4 +-
 libgda/gda-data-model-ldap.c           |    6 +-
 libgda/gda-meta-store.h                |   11 ++-
 tests/vala/CheckDataModelIterator.vala |    2 +-
 5 files changed, 80 insertions(+), 95 deletions(-)
---
diff --git a/libgda/Gda-5.0.gir b/libgda/Gda-5.0.gir
index 72d911a..21f401c 100644
--- a/libgda/Gda-5.0.gir
+++ b/libgda/Gda-5.0.gir
@@ -15,9 +15,6 @@ and/or use gtk-doc annotations.  -->
              shared-library="libgda-5.0.so.4"
              c:identifier-prefixes="Gda"
              c:symbol-prefixes="gda">
-    <alias name="Mutex" c:type="GdaMutex" introspectable="0">
-      <type c:type="GRecMutex"/>
-    </alias>
     <alias name="SqlBuilderId" c:type="GdaSqlBuilderId">
       <type name="guint" c:type="guint"/>
     </alias>
@@ -7461,6 +7458,64 @@ row it was on was the last one).</doc>
            glib:get-type="gda_data_model_ldap_get_type"
            glib:type-struct="DataModelLdapClass">
       <implements name="DataModel"/>
+      <constructor name="new_with_config"
+                   c:identifier="gda_data_model_ldap_new_with_config"
+                   version="5.2">
+        <doc xml:whitespace="preserve">Creates a new #GdaDataModel object to extract some LDAP contents. The returned data model will
+contain one row for each LDAP entry returned by the search, and will
+always return the DN (Distinguished Name) of the LDAP entry as first column. Other atttibutes
+may be mapped to other columns, see the @attributes argument.
+
+Note that the actual LDAP search command is not executed until necessary (when using the returned
+data model).
+
+The @base_dn is the point in the LDAP's DIT (Directory Information Tree) from where the search will
+occur, for example "dc=gda,dc=org". A %NULL value indicates that the starting point for the
+search will be the one specified when opening the LDAP connection.
+
+The @filter argument is a valid LDAP filter string, for example "(uidNumber=1001)". If %NULL, then
+a default search filter of "(objectClass=*)" will be used.
+
+ attributes specifies which LDAP attributes the search must return. It is a comma separated list
+of attribute names, for example "uidNumber, mail, uid, jpegPhoto" (spaces between attribute names
+are ignored). If %NULL, then no attribute will be fetched. See gda_ldap_connection_declare_table()
+for more information about this argument.
+
+ scope is the scope of search specified when the LDAP search is actually executed.
+
+In case of multi valued attributes, an error will be returned when trying to read the attribute:
+gda_data_model_iter_get_value_at() will return %NULL when using an iterator.
+
+This is a convenience function intended to be used by bindings.</doc>
+        <return-value transfer-ownership="full">
+          <doc xml:whitespace="preserve">a new #GdaDataModelLdap object</doc>
+          <type name="DataModelLdap" c:type="GdaDataModelLdap*"/>
+        </return-value>
+        <parameters>
+          <parameter name="cnc" transfer-ownership="none">
+            <doc xml:whitespace="preserve">an LDAP opened connection (must be a balid #GdaLdapConnection)</doc>
+            <type name="Connection" c:type="GdaConnection*"/>
+          </parameter>
+          <parameter name="base_dn" transfer-ownership="none" allow-none="1">
+            <doc xml:whitespace="preserve">the base DN to search on, or %NULL</doc>
+            <type name="utf8" c:type="gchar*"/>
+          </parameter>
+          <parameter name="filter" transfer-ownership="none" allow-none="1">
+            <doc xml:whitespace="preserve">an LDAP filter, for example "(objectClass=*)"</doc>
+            <type name="utf8" c:type="gchar*"/>
+          </parameter>
+          <parameter name="attributes"
+                     transfer-ownership="none"
+                     allow-none="1">
+            <doc xml:whitespace="preserve">the list (CSV format) of attributes to fetch, each in the format &amp;lt;attname&amp;gt;[::&amp;lt;GType&amp;gt;]</doc>
+            <type name="utf8" c:type="gchar*"/>
+          </parameter>
+          <parameter name="scope" transfer-ownership="none">
+            <doc xml:whitespace="preserve">the search scope</doc>
+            <type name="LdapSearchScope" c:type="GdaLdapSearchScope"/>
+          </parameter>
+        </parameters>
+      </constructor>
       <function name="compute_columns"
                 c:identifier="gda_data_model_ldap_compute_columns"
                 version="4.2.8">
@@ -7487,7 +7542,9 @@ gda_data_model_ldap_new().</doc>
       </function>
       <function name="new"
                 c:identifier="gda_data_model_ldap_new"
-                version="4.2.8">
+                version="4.2.8"
+                deprecated="use #gda_data_model_ldap_new_with_config"
+                deprecated-version="5.2">
         <doc xml:whitespace="preserve">Creates a new #GdaDataModel object to extract some LDAP contents. The returned data model will
 contain one row for each LDAP entry returned by the search, and will
 always return the DN (Distinguished Name) of the LDAP entry as first column. Other atttibutes
@@ -10406,7 +10463,7 @@ Don't try to use #gda_meta_context_free on a struct that was created manually.</
       <field name="columns" introspectable="0" writable="1">
         <type name="GLib.HashTable" c:type="GHashTable*">
           <type name="utf8"/>
-          <type name="GLib.GValue"/>
+          <type name="GLib.Value"/>
         </type>
       </field>
       <constructor name="new"
@@ -11294,10 +11351,10 @@ signal, or %NULL if signal propagation should continue</doc>
       <field name="table_name" writable="1">
         <type name="utf8" c:type="gchar*"/>
       </field>
-      <field name="keys" writable="1">
+      <field name="keys" introspectable="0" writable="1">
         <type name="GLib.HashTable" c:type="GHashTable*">
-          <type name="gpointer" c:type="gpointer"/>
-          <type name="gpointer" c:type="gpointer"/>
+          <type name="utf8"/>
+          <type name="GLib.Value"/>
         </type>
       </field>
     </record>
@@ -23787,85 +23844,6 @@ can also be used in hash tables as a #GEqualFunc.</doc>
         </parameter>
       </parameters>
     </function>
-    <function name="mutex_free"
-              c:identifier="gda_mutex_free"
-              introspectable="0">
-      <doc xml:whitespace="preserve">Destroys @mutex.</doc>
-      <return-value transfer-ownership="none">
-        <type name="none" c:type="void"/>
-      </return-value>
-      <parameters>
-        <parameter name="mutex" transfer-ownership="full">
-          <doc xml:whitespace="preserve">a #GdaMutex</doc>
-          <type name="Mutex" c:type="GdaMutex*"/>
-        </parameter>
-      </parameters>
-    </function>
-    <function name="mutex_lock"
-              c:identifier="gda_mutex_lock"
-              introspectable="0">
-      <doc xml:whitespace="preserve">Locks @mutex. If @mutex is already locked by another thread, the current thread will block until @mutex is unlocked by the other thread.
-
-This function can be used even if g_thread_init() has not yet been called, and, in that case, will do nothing.
-
-Note: unlike g_mutex_lock(), the #GdaMutex is recursive, which means a thread can lock it several times (and has
-to unlock it as many times to actually unlock it).</doc>
-      <return-value transfer-ownership="none">
-        <type name="none" c:type="void"/>
-      </return-value>
-      <parameters>
-        <parameter name="mutex" transfer-ownership="none">
-          <doc xml:whitespace="preserve">a #GdaMutex</doc>
-          <type name="Mutex" c:type="GdaMutex*"/>
-        </parameter>
-      </parameters>
-    </function>
-    <function name="mutex_new" c:identifier="gda_mutex_new" introspectable="0">
-      <doc xml:whitespace="preserve">Creates a new #GdaMutex.
-
-Note: Unlike g_mutex_new(), this function will return %NULL if g_thread_init() has not been called yet.</doc>
-      <return-value transfer-ownership="full">
-        <doc xml:whitespace="preserve">a new #GdaMutex</doc>
-        <type name="Mutex" c:type="GdaMutex*"/>
-      </return-value>
-    </function>
-    <function name="mutex_trylock"
-              c:identifier="gda_mutex_trylock"
-              introspectable="0">
-      <doc xml:whitespace="preserve">Tries to lock @mutex. If @mutex is already locked by another thread, it immediately returns FALSE.
-Otherwise it locks @mutex and returns TRUE
-
-This function can be used even if g_thread_init() has not yet been called, and, in that case, will immediately return TRUE.
-
-Note: Unlike g_mutex_trylock(), the #GdaMutex is recursive, which means a thread can lock it several times (and has
-to unlock it as many times to actually unlock it)</doc>
-      <return-value transfer-ownership="none">
-        <doc xml:whitespace="preserve">TRUE, if @mutex could be locked.</doc>
-        <type name="gboolean" c:type="gboolean"/>
-      </return-value>
-      <parameters>
-        <parameter name="mutex" transfer-ownership="none">
-          <doc xml:whitespace="preserve">a #GdaMutex</doc>
-          <type name="Mutex" c:type="GdaMutex*"/>
-        </parameter>
-      </parameters>
-    </function>
-    <function name="mutex_unlock"
-              c:identifier="gda_mutex_unlock"
-              introspectable="0">
-      <doc xml:whitespace="preserve">Unlocks @mutex. If another thread is blocked in a gda_mutex_lock() call for @mutex, it wil
-be woken and can lock @mutex itself.
-This function can be used even if g_thread_init() has not yet been called, and, in that case, will do nothing.</doc>
-      <return-value transfer-ownership="none">
-        <type name="none" c:type="void"/>
-      </return-value>
-      <parameters>
-        <parameter name="mutex" transfer-ownership="none">
-          <doc xml:whitespace="preserve">a #GdaMutex</doc>
-          <type name="Mutex" c:type="GdaMutex*"/>
-        </parameter>
-      </parameters>
-    </function>
     <function name="parse_iso8601_date" c:identifier="gda_parse_iso8601_date">
       <doc xml:whitespace="preserve">Extracts date parts from @value, and sets @gdate's contents
 
diff --git a/libgda/Makefile.am b/libgda/Makefile.am
index 21c7218..cbe6b24 100644
--- a/libgda/Makefile.am
+++ b/libgda/Makefile.am
@@ -82,7 +82,6 @@ gda_headers = \
 	gda-log.h \
 	gda-meta-store.h \
 	gda-meta-struct.h \
-	gda-mutex.h \
 	gda-quark-list.h \
 	gda-repetitive-statement.h \
 	gda-row.h \
@@ -143,7 +142,6 @@ gda_sources= \
 	gda-meta-store.c \
 	gda-meta-struct.c \
 	gda-meta-struct-io.c \
-	gda-mutex.c \
 	gda-quark-list.c \
 	gda-repetitive-statement.c \
 	gda-row.c \
@@ -185,6 +183,8 @@ libgda_sources =  \
 	gda-marshal.c \
 	gda-meta-store-extra.h \
 	gda-meta-struct-private.h \
+	gda-mutex.c \
+	gda-mutex.h \
 	gda-statement-priv.h \
 	global.h \
 	md5.h \
diff --git a/libgda/gda-data-model-ldap.c b/libgda/gda-data-model-ldap.c
index 5afc8ac..cc22a60 100644
--- a/libgda/gda-data-model-ldap.c
+++ b/libgda/gda-data-model-ldap.c
@@ -165,7 +165,7 @@ gda_data_model_ldap_get_type (void)
 }
 
 /**
- * gda_data_model_ldap_new: (skip):
+ * gda_data_model_ldap_new:
  * @cnc: an LDAP opened connection (must be a balid #GdaLdapConnection)
  * @base_dn: (allow-none): the base DN to search on, or %NULL
  * @filter: (allow-none): an LDAP filter, for example "(objectClass=*)"
@@ -198,7 +198,9 @@ gda_data_model_ldap_get_type (void)
  * gda_data_model_iter_get_value_at() will return %NULL when using an iterator.
  *
  * Returns: (transfer full): a new #GdaDataModel
- *
+ * 
+ * Deprecated: 5.2: use #gda_data_model_ldap_new_with_config
+ * 
  * Since: 4.2.8
  */
 GdaDataModel *
diff --git a/libgda/gda-meta-store.h b/libgda/gda-meta-store.h
index 84ca4df..ab474ab 100644
--- a/libgda/gda-meta-store.h
+++ b/libgda/gda-meta-store.h
@@ -61,6 +61,12 @@ typedef enum {
 	GDA_META_STORE_MODIFY
 } GdaMetaStoreChangeType;
 
+/**
+ * GdaMetaStoreChange:
+ * @c_type:
+ * @table_name:
+ * @keys: (element-type utf8 GLib.Value):
+ */
 typedef struct {
 	/* change general information */
 	GdaMetaStoreChangeType  c_type;
@@ -79,7 +85,7 @@ typedef struct {
  * @size: the size of the @column_names and @column_values arrays
  * @column_names: (array length=size): an array of column names (columns of the @table_name table)
  * @column_values: (array length=size): an array of values, one for each column named in @column_names
- * @columns: (element-type utf8 GLib.GValue): A #GHashTable storing columns' name as key and #GValue as column's
+ * @columns: (element-type utf8 GLib.Value): A #GHashTable storing columns' name as key and #GValue as column's
  * value.
  *
  * The <structname>GdaMetaContext</structname> represents a meta data modification
@@ -100,8 +106,7 @@ typedef struct {
 	gint                    size;
 	gchar                 **column_names;
 	GValue                **column_values;
-	/* Added since 5.2 */
-	GHashTable             *columns;
+	GHashTable             *columns;/* Added since 5.2 */
 } GdaMetaContext;
 
 /* struct for the object's data */
diff --git a/tests/vala/CheckDataModelIterator.vala b/tests/vala/CheckDataModelIterator.vala
index 44f575e..73245d4 100644
--- a/tests/vala/CheckDataModelIterator.vala
+++ b/tests/vala/CheckDataModelIterator.vala
@@ -271,7 +271,7 @@ namespace Check {
 			int fails = 0;
 			var model = this.connection.execute_select_command ("SELECT * FROM user");
 			((DataSelect) model).compute_modification_statements ();
-			var pxy = (Gda.DataModel) Gda.DataProxy.new (model);
+			var pxy = new Gda.DataProxy.with_data_model (model);
 			var t = new Table ();
 			t.connection = this.connection;
 			t.name = "user";



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