[libgda: 1/2] Docfix



commit 3840b66bd206aee2ce51c061fc5c3285a2960f4f
Author: Pavlo Solntsev <p sun fun gmail com>
Date:   Thu Jul 26 17:43:31 2018 +0000

    Docfix

 configure.ac               |  21 --------
 doc/C/Makefile.am          |  27 +++++++++-
 doc/C/ddl-creator.xml      |  14 +++++
 doc/C/libgda-6.0-docs.sgml |  22 +++++++-
 doc/C/libgda-sections.txt  | 131 ++++++++++++++++++++++++++++++++++++++++++---
 doc/C/libgda.types.in      |   7 +--
 libgda/gda-ddl-base.c      |  17 ++++++
 libgda/gda-ddl-buildable.c |  12 +++++
 libgda/gda-ddl-column.c    |  28 +++++++++-
 libgda/gda-ddl-column.h    |   8 ++-
 libgda/gda-ddl-creator.c   |  28 +++++++---
 libgda/gda-ddl-creator.h   |  23 ++++++--
 libgda/gda-ddl-fkey.c      |  16 +++++-
 libgda/gda-ddl-fkey.h      |  22 ++++----
 libgda/gda-ddl-table.c     |  13 +++++
 libgda/gda-ddl-table.h     |   5 ++
 libgda/gda-ddl-view.c      |  12 +++++
 libgda/libgda.h.in         |   1 +
 po/POTFILES.skip           |   1 +
 19 files changed, 350 insertions(+), 58 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 852d27c48..7e0c8323e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1061,27 +1061,6 @@ stamp.h
 AC_OUTPUT
 
 
-dnl Dirty work to be able to build documentation
-chmod -R u+w ${srcdir}/doc/C
-cp doc/C/version.xml ${srcdir}/doc/C/version.xml.tmp
-mv ${srcdir}/doc/C/version.xml.tmp ${srcdir}/doc/C/version.xml
-cp doc/C/builddate.xml ${srcdir}/doc/C/builddate.xml.tmp
-mv ${srcdir}/doc/C/builddate.xml.tmp ${srcdir}/doc/C/builddate.xml
-
-cp ${srcdir}/doc/C/libgda-sections.txt doc/C/libgda-6.0-sections.txt
-echo "" >> doc/C/libgda-6.0-sections.txt
-cat ${srcdir}/doc/C/libgda-ui-sections.txt >> doc/C/libgda-6.0-sections.txt
-cp doc/C/libgda-6.0-sections.txt ${srcdir}/doc/C/libgda-6.0-sections.txt.tmp
-mv ${srcdir}/doc/C/libgda-6.0-sections.txt.tmp ${srcdir}/doc/C/libgda-6.0-sections.txt
-
-cp doc/C/libgda.types doc/C/libgda-6.0.types
-if test x$have_ui != xno
-then
-       echo "" >> doc/C/libgda-6.0.types
-       cat ${srcdir}/doc/C/libgda-ui.types >> doc/C/libgda-6.0.types
-fi
-
-
 dnl Print configuration summary
 echo ""
 echo " Configuration summary for version $GDA_VERSION"
diff --git a/doc/C/Makefile.am b/doc/C/Makefile.am
index bf5204a46..66841598b 100644
--- a/doc/C/Makefile.am
+++ b/doc/C/Makefile.am
@@ -90,7 +90,7 @@ EXTRA_DIST += examples/full_example.c installation.xml limitations.xml migration
        visual_index.xml prov-notes.xml \
        libgda-sections.txt libgda-ui-sections.txt libgda.types libgda.types.in libgda-ui.types \
        examples/blobtest.c \
-       data-model-writing.xml
+       data-model-writing.xml ddl-creator.xml
 
 # Files not to distribute
 # for --rebuild-types in $(SCAN_OPTIONS), e.g. $(DOC_MODULE).types
@@ -98,7 +98,7 @@ EXTRA_DIST += examples/full_example.c installation.xml limitations.xml migration
 DISTCLEANFILES = $(DOC_MODULE)-doc.pdf libgda-6.0.types libgda-6.0-sections.txt
 
 DOC_STAMPS += pdf-build.stamp
-CLEANFILES += $(DOC_STAMPS)
+CLEANFILES += $(DOC_STAMPS) libgda-6.0-sections.txt
 
 # Create the PDF
 PDF: pdf-build.stamp
@@ -107,3 +107,26 @@ pdf-build.stamp:
                dblatex $(srcdir)/$(DOC_MAIN_SGML_FILE) -o $(DOC_MODULE)-doc.pdf ; \
        fi
        touch pdf-build.stamp
+
+if ENABLE_GTK_DOC
+TESTS_ENVIRONMENT = \
+  DOC_MODULE=$(DOC_MODULE) DOC_MAIN_SGML_FILE=$(DOC_MAIN_SGML_FILE) \
+  SRCDIR=$(abs_srcdir) BUILDDIR=$(abs_builddir)
+TESTS = $(GTKDOC_CHECK)
+endif
+
+libgda-6.0-sections.txt: libgda-sections.txt libgda-ui-sections.txt
+       cp ${srcdir}/libgda-sections.txt ${srcdir}/libgda-6.0-sections.txt
+       echo "" >> ${srcdir}/libgda-6.0-sections.txt
+       cat ${srcdir}/libgda-ui-sections.txt >> ${srcdir}/libgda-6.0-sections.txt
+       cp ${srcdir}/libgda-6.0-sections.txt ${srcdir}/libgda-6.0-sections.txt.tmp
+       mv ${srcdir}/libgda-6.0-sections.txt.tmp ${srcdir}/libgda-6.0-sections.txt
+
+libgda-6.0.types: libgda.types libgda-ui.types
+       cp ${srcdir}/libgda.types ${srcdir}/libgda-6.0.types
+       if test HAVE_UI
+       then
+               echo "" >> ${srcdir}/libgda-6.0.types
+               cat ${srcdir}/doc/C/libgda-ui.types >> ${srcdir}/libgda-6.0.types
+       fi
+
diff --git a/doc/C/ddl-creator.xml b/doc/C/ddl-creator.xml
new file mode 100644
index 000000000..8a6d5eafa
--- /dev/null
+++ b/doc/C/ddl-creator.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
+          "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd";[
+<!ENTITY LIBGDA          "<application>Libgda</application>">
+]>
+<sect2 id="DDLCreator">
+  <title>Database generation from file and dumping to file</title>
+  <para>
+    Database can be generated/updated from an xml file and also dunped to an xml file. Is can be 
+    done using <link linkend="GdaDdlCreator">GdaDdlCreator</link>, which provides essential 
+    functionality for database manipulation. The existing database can be expanded. Foreign keys
+    can't be added. This is a current limitation that should be resolved soon. 
+  </para>
+</sect2>
diff --git a/doc/C/libgda-6.0-docs.sgml b/doc/C/libgda-6.0-docs.sgml
index 5fb8fb501..2ca9ba3db 100644
--- a/doc/C/libgda-6.0-docs.sgml
+++ b/doc/C/libgda-6.0-docs.sgml
@@ -88,6 +88,15 @@
        <contrib>libgda, Vala, GObject Introspection
         </contrib>
       </author>
+      <author>
+        <firstname>Pavlo</firstname>
+        <surname>Solntsev</surname>
+        <affiliation>
+          <address><email>p sun fun gmail com</email></address>
+        </affiliation>
+       <contrib>libgda
+        </contrib>
+      </author>
       <author>
         <firstname>Vivien</firstname>
         <surname>Malerba</surname>
@@ -100,7 +109,7 @@
     </authorgroup>
     <date>&builddate;</date>
     <copyright>
-      <year>1999 - 2015</year>
+      <year>1999 - 2018</year>
       <holder>&copy;</holder>
     </copyright>
     <abstract>
@@ -1134,6 +1143,17 @@ g_object_unref (store);
       <xi:include href="xml/gda-server-operation-sequences.xml"/>
     </chapter>
 
+    <chapter>
+      <title>Database manipulations</title>
+      <xi:include href="ddl-creator.xml"/>
+      <xi:include href="xml/gda-ddl-creator.xml"/>
+      <xi:include href="xml/gda-ddl-table.xml"/>
+      <xi:include href="xml/gda-ddl-view.xml"/>
+      <xi:include href="xml/gda-ddl-fkey.xml"/>
+      <xi:include href="xml/gda-ddl-base.xml"/>
+      <xi:include href="xml/gda-ddl-buildable.xml"/>
+    </chapter>
+
     <chapter>
       <title>User interface API reference</title>
       <xi:include href="visual_index.xml"/>
diff --git a/doc/C/libgda-sections.txt b/doc/C/libgda-sections.txt
index 4899bbafa..22c53bf6b 100644
--- a/doc/C/libgda-sections.txt
+++ b/doc/C/libgda-sections.txt
@@ -1,13 +1,12 @@
 <SECTION>
 <FILE>gda-ddl-fkey</FILE>
 <TITLE>GdaDdlFkey</TITLE>
+GdaDdlFkey
 GDA_TYPE_DDL_FKEY
-GdaDdlFkeyClass
 GdaDdlFkeyReferenceAction
-GdaDdlFkeyError
-GDA_DDL_FKEY_ERROR
-gda_ddl_fkey_error_quark
 gda_ddl_fkey_new
+gda_ddl_fkey_new_from_meta
+gda_ddl_fkey_free
 gda_ddl_fkey_get_field_name
 gda_ddl_fkey_get_ref_field
 gda_ddl_fkey_set_field
@@ -19,10 +18,126 @@ gda_ddl_fkey_set_ondelete
 gda_ddl_fkey_get_onupdate
 gda_ddl_fkey_get_onupdate_id
 gda_ddl_fkey_set_onupdate
-gda_ddl_fkey_parse_node
-gda_ddl_fkey_write_xml
-gda_ddl_fkey_free
-GdaDdlFkey
+gda_ddl_fkey_prepare_create
+</SECTION>
+<SECTION>
+<FILE>gda-ddl-column</FILE>
+<TITLE>GdaDdlColumn</TITLE>
+GdaDdlColumn
+GdaDdlColumnError
+GDA_TYPE_DDL_COLUMN
+gda_ddl_column_new
+gda_ddl_column_new_from_meta
+gda_ddl_column_free
+gda_ddl_column_get_autoinc
+gda_ddl_column_set_autoinc
+gda_ddl_column_get_check
+gda_ddl_column_set_check
+gda_ddl_column_get_comment
+gda_ddl_column_set_comment
+gda_ddl_column_get_gtype
+gda_ddl_column_get_ctype
+gda_ddl_column_set_type
+gda_ddl_column_get_default
+gda_ddl_column_set_default
+gda_ddl_column_get_name
+gda_ddl_column_set_name
+gda_ddl_column_get_nnul
+gda_ddl_column_set_nnul
+gda_ddl_column_get_pkey
+gda_ddl_column_set_pkey
+gda_ddl_column_get_scale
+gda_ddl_column_set_scale
+gda_ddl_column_get_size
+gda_ddl_column_set_size
+gda_ddl_column_get_unique
+gda_ddl_column_set_unique
+gda_ddl_column_prepare_add
+gda_ddl_column_prepare_create
+</SECTION>
+<SECTION>
+<FILE>gda-ddl-base</FILE>
+<TITLE>GdaDdlBase</TITLE>
+GdaDdlBase
+GDA_TYPE_DDL_BASE
+gda_ddl_base_compare
+gda_ddl_base_free
+gda_ddl_base_get_catalog
+gda_ddl_base_get_full_name
+gda_ddl_base_get_name
+gda_ddl_base_get_schema
+gda_ddl_base_new
+gda_ddl_base_set_catalog
+gda_ddl_base_set_name
+gda_ddl_base_set_names
+gda_ddl_base_set_schema
+</SECTION>
+<SECTION>
+<FILE>gda-ddl-buildable</FILE>
+<TITLE>GdaDdlBuildable</TITLE>
+GdaDdlBuildable
+GDA_TYPE_DDL_BUILDABLE
+gda_ddl_buildable_parse_node
+gda_ddl_buildable_write_node
+</SECTION>
+<SECTION>
+<FILE>gda-ddl-creator</FILE>
+<TITLE>GdaDdlCreator</TITLE>
+GdaDdlCreator
+GdaDdlCreatorError
+GDA_TYPE_DDL_CREATOR
+gda_ddl_creator_get_type
+gda_ddl_creator_new
+gda_ddl_creator_free
+gda_ddl_creator_get_tables
+gda_ddl_creator_get_views
+gda_ddl_creator_append_table
+gda_ddl_creator_append_view
+gda_ddl_creator_parse_cnc
+gda_ddl_creator_parse_file
+gda_ddl_creator_parse_file_from_path
+gda_ddl_creator_perform_operation
+gda_ddl_creator_write_to_file
+gda_ddl_creator_write_to_path
+</SECTION>
+<SECTION>
+<FILE>gda-ddl-table</FILE>
+<TITLE>GdaDdlTable</TITLE>
+GdaDdlTable
+GdaDdlTableError
+GDA_TYPE_DDL_TABLE
+gda_ddl_table_new
+gda_ddl_table_new_from_meta
+gda_ddl_table_free
+gda_ddl_table_is_valid
+gda_ddl_table_append_column
+gda_ddl_table_get_columns
+gda_ddl_table_append_fkey
+gda_ddl_table_get_fkeys
+gda_ddl_table_create
+gda_ddl_table_is_temp
+gda_ddl_table_set_temp
+gda_ddl_table_prepare_create
+gda_ddl_table_update
+</SECTION>
+<SECTION>
+<FILE>gda-ddl-view</FILE>
+<TITLE>GdaDdlView</TITLE>
+GdaDdlView
+GDA_TYPE_DDL_VIEW
+gda_ddl_view_new
+gda_ddl_view_new_from_meta
+gda_ddl_view_free
+gda_ddl_view_get_defstring
+gda_ddl_view_set_defstring
+gda_ddl_view_get_ifnoexist
+gda_ddl_view_set_ifnoexist
+gda_ddl_view_get_istemp
+gda_ddl_view_set_istemp
+gda_ddl_view_get_replace
+gda_ddl_view_set_replace
+gda_ddl_view_prepare_create
+gda_ddl_view_create
 </SECTION>
 <SECTION>
 <FILE>gda-column</FILE>
diff --git a/doc/C/libgda.types.in b/doc/C/libgda.types.in
index 1d548afe1..6358eec69 100644
--- a/doc/C/libgda.types.in
+++ b/doc/C/libgda.types.in
@@ -7,9 +7,6 @@
 #include <gda-report-document.h>
 #include <RML/gda-report-rml-document.h>
 #include <DocBook/gda-report-docbook-document.h>
-#include <libgda/gda-ddl-fkey.h>
-#include <libgda/gda-ddl-base.h>
-#include <libgda/gda-ddl-view.h>
 gda_blob_op_get_type
 gda_column_get_type
 gda_config_get_type
@@ -72,3 +69,7 @@ gda_sql_builder_get_type
 gda_ddl_fkey_get_type
 gda_ddl_base_get_type
 gda_ddl_view_get_type
+gda_ddl_creator_get_type
+gda_ddl_table_get_type
+gda_ddl_column_get_type
+gda_ddl_buildable_get_type
diff --git a/libgda/gda-ddl-base.c b/libgda/gda-ddl-base.c
index a707762f9..843f08c2e 100644
--- a/libgda/gda-ddl-base.c
+++ b/libgda/gda-ddl-base.c
@@ -28,6 +28,17 @@ typedef struct
   gchar *m_fullname;
 } GdaDdlBasePrivate;
 
+/**
+ * SECTION:gda-ddl-base 
+ * @short_description: The basic class for all database objects
+ * @see_also: #GdaDdlTable, #GdaDdlView
+ * @stability: Stable
+ * @include: libgda/libgda.h
+ *
+ * This is a basic class for database objects, e.g. #GdaDdlTable and #GdaDdlView. It is not common to
+ * use it directly. 
+ */
+
 G_DEFINE_TYPE_WITH_PRIVATE (GdaDdlBase, gda_ddl_base, G_TYPE_OBJECT)
 
 /**
@@ -251,6 +262,8 @@ gda_ddl_base_free (GdaDdlBase *self)
  * gda_ddl_base_set_catalog:
  * @self: a #GdaDdlBase instance
  * @catalog: Catalog name as a string
+ * 
+ * Set catalog name
  *
  * Since: 6.0
  */
@@ -271,6 +284,8 @@ gda_ddl_base_set_catalog (GdaDdlBase  *self,
  * @self: a #GdaDdlBase instance
  * @schema: Schema name as a string
  *
+ * Set object schema.
+ *
  * Since: 6.0
  */
 void
@@ -289,6 +304,8 @@ gda_ddl_base_set_schema (GdaDdlBase  *self,
  * gda_ddl_base_set_name:
  * @self: a #GdaDdlBase instance
  * @name: Object name as a string
+ * 
+ * Set object name
  *
  * Since: 6.0
  */
diff --git a/libgda/gda-ddl-buildable.c b/libgda/gda-ddl-buildable.c
index 4e7873b66..0adb5c322 100644
--- a/libgda/gda-ddl-buildable.c
+++ b/libgda/gda-ddl-buildable.c
@@ -25,6 +25,18 @@ G_DEFINE_QUARK (gda-ddl-buildable-error, gda_ddl_buildable_error)
 
 G_DEFINE_INTERFACE (GdaDdlBuildable, gda_ddl_buildable, G_TYPE_OBJECT)
 
+/**
+ * SECTION:gda-ddl-buildable
+ * @title: GdaDdlBuildable
+ * @short: Represents interface for parsing and writing xml nodes
+ * @see_also: #GdaDdlTable, #GdaDdlView
+ * @stability: Stable
+ * @include: libgda/gda-ddl-buildable.h
+ *
+ * #GdaDdlBuildable represents an interface for writing and reading xml nodes. #GdaDdlTable and
+ * #GdaDdlView implement this interface.  
+ */
+
 static void
 gda_ddl_buildable_default_init (GdaDdlBuildableInterface *iface)
 {
diff --git a/libgda/gda-ddl-column.c b/libgda/gda-ddl-column.c
index b5863c3be..b8c1bc70b 100644
--- a/libgda/gda-ddl-column.c
+++ b/libgda/gda-ddl-column.c
@@ -1,6 +1,6 @@
 /* gda-ddl-column.c
  *
- * Copyright (C) 2018 Pavlo Solntsev <pavlo solntsev gmail com>
+ * Copyright (C) 2018 Pavlo Solntsev <p sun fun gmail com>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -45,6 +45,18 @@ typedef struct
   gboolean m_pkey; /* property */
 }GdaDdlColumnPrivate;
 
+/**
+ * SECTION:gda-ddl-column
+ * @short_description: Object to represent table column 
+ * @see_also: #GdaDdlTable, #GdaDdlView, #GdaDdlBuildable
+ * @stability: Stable
+ * @include: libgda/libgda.h
+ *
+ * This object represents a column of a table or a view. The column can be constracted manually
+ * using API or generated from xml file together with other databse objects. See #GdaDdlCreator.
+ * #GdaDdlColumn implements #GdaDdlBuildable interface for parsing xml file.
+ */
+
 /* All nodes in xml should be accessed using enum below */
 enum {
   GDA_DDL_COLUMN_NODE,
@@ -556,6 +568,8 @@ _gda_ddl_column_set_type (GdaDdlColumn *self,
  * gda_ddl_column_get_name:
  * @self: a #GdaDdlColumn instance
  *
+ * Returns name of the column 
+ *
  * Returns: Column name as a string or %NULL.
  *
  * Since: 6.0
@@ -608,6 +622,8 @@ gda_ddl_column_get_gtype (GdaDdlColumn *self)
 /**
  * gda_ddl_column_get_ctype:
  * @self: a #GdaDdlColumn object
+ * 
+ * Returns column type as a string derivied from #GType 
  *
  * Returns: column type as a string or %NULL
  *
@@ -680,6 +696,8 @@ gda_ddl_column_set_scale (GdaDdlColumn *self,
  * gda_ddl_column_get_pkey:
  * @self: a #GdaDdlColumn object
  *
+ * Returns a primary key flag
+ *
  * Returns: %TRUE if the column is primary key, %FALSE otherwise
  *
  * Since: 6.0
@@ -712,6 +730,10 @@ gda_ddl_column_set_pkey (GdaDdlColumn *self,
  * gda_ddl_column_get_nnul:
  * @self: a @GdaDdlColumn object
  *
+ * Specify if the column's value can be NULL. 
+ *
+ * Returns: %TRUE if value can be %NULL, %FALSE otherwise. 
+ *
  * Since: 6.0
  */
 gboolean
@@ -886,6 +908,8 @@ gda_ddl_column_set_size (GdaDdlColumn *self,
 /**
  * gda_ddl_column_get_default:
  * @self: a #GdaDdlColumn instance
+ * 
+ * Returns default value for the column. Can be %NULL if the default value hasn't been set.
  *
  * Returns: Default value for the column as a string.
  *
@@ -919,6 +943,8 @@ gda_ddl_column_set_default (GdaDdlColumn *self,
 /**
  * gda_ddl_column_get_check:
  * @self: a #GdaDdlColumn instance
+ * 
+ * Returns value of the check field.
  *
  * Returns: Column check string
  *
diff --git a/libgda/gda-ddl-column.h b/libgda/gda-ddl-column.h
index 7475867b5..ff22947d9 100644
--- a/libgda/gda-ddl-column.h
+++ b/libgda/gda-ddl-column.h
@@ -1,6 +1,6 @@
 /* gda-ddl-column.h
  *
- * Copyright (C) 2018 Pavlo Solntsev <pavlo solntsev gmail com>
+ * Copyright (C) 2018 Pavlo Solntsev <p sun fun gmail com>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -38,6 +38,12 @@ struct _GdaDdlColumnClass
   GObjectClass parent;
 };
 
+/**
+ * GdaDdlColumnError:
+ * @GDA_DDL_COLUMN_ERROR_TYPE: Set if wrong column type was given in the xml file.
+ *
+ * Values used to describe the source of the error. 
+ */
 typedef  enum {
   GDA_DDL_COLUMN_ERROR_TYPE
 }GdaDdlColumnError;
diff --git a/libgda/gda-ddl-creator.c b/libgda/gda-ddl-creator.c
index cb311de63..0d0f961eb 100644
--- a/libgda/gda-ddl-creator.c
+++ b/libgda/gda-ddl-creator.c
@@ -41,6 +41,22 @@ typedef struct
   gchar *mp_schemaname;
 } GdaDdlCreatorPrivate;
 
+/**
+ * SECTION:gda-ddl-creator
+ * @title: GdaDdlCreator
+ * @short_description: Object to constract database representation from an xml file or by reading the 
existing datatabase 
+ * @see_also: #GdaDdlTable, #GdaDdlView
+ * @stability: Stable
+ * @include: libgda/libgda.h
+ *
+ * This is a main object that represents overall database. In can be constracted from an xml 
+ * file using gda_ddl_creator_parse_file() or gda_ddl_creator_parse_file_from_path(). It can also
+ * be constracted from an open connection using gda_ddl_creator_parse_cnc(). The database can be
+ * updated using gda_ddl_creator_perform_operation() and dumped to a file using
+ * gda_ddl_creator_write_to_path() and gda_ddl_creator_write_to_file(). 
+ *  
+ */
+
 G_DEFINE_TYPE_WITH_PRIVATE (GdaDdlCreator, gda_ddl_creator, G_TYPE_OBJECT)
 
 enum {
@@ -181,7 +197,7 @@ _gda_ddl_creator_validate_doc (xmlDocPtr doc,
     {
       g_set_error (error,
                    GDA_DDL_CREATOR_ERROR,
-                   GDA_DDL_CREATOR_UNVALID_XML,
+                   GDA_DDL_CREATOR_INVALID_XML,
                    _("xml file is invalid"));
       goto on_error;
     }
@@ -222,7 +238,7 @@ _gda_ddl_creator_parse_doc (GdaDdlCreator *self,
     {
       g_set_error (error,
                    GDA_DDL_CREATOR_ERROR,
-                   GDA_DDL_CREATOR_UNVALID_SCHEMA,
+                   GDA_DDL_CREATOR_INVALID_SCHEMA,
                    _("Root node should be <schema>."));
       goto on_error;
     }
@@ -364,7 +380,7 @@ gda_ddl_creator_parse_file_from_path (GdaDdlCreator *self,
     {
       g_set_error (error,
                    GDA_DDL_CREATOR_ERROR,
-                   GDA_DDL_CREATOR_UNVALID_XML,
+                   GDA_DDL_CREATOR_INVALID_XML,
                    _("xml file '%s' is not valid\n"), xmlfile);
       goto on_error;
     }
@@ -637,7 +653,7 @@ gda_ddl_creator_append_table (GdaDdlCreator *self,
 /**
  * gda_ddl_creator_append_view:
  * @self: a #GdaDdlCreator instance
- * @view: table to append
+ * @view: view to append
  *
  * This method append @view to the total list of all views stored in @self.
  *
@@ -645,7 +661,7 @@ gda_ddl_creator_append_table (GdaDdlCreator *self,
  */
 void
 gda_ddl_creator_append_view (GdaDdlCreator *self,
-                             const GdaDdlTable *view)
+                             const GdaDdlView *view)
 {
   g_return_if_fail (self);
 
@@ -943,7 +959,7 @@ gda_ddl_creator_parse_file (GdaDdlCreator *self,
     {
       g_set_error (error,
                    GDA_DDL_CREATOR_ERROR,
-                   GDA_DDL_CREATOR_UNVALID_XML,
+                   GDA_DDL_CREATOR_INVALID_XML,
                    _("xml file is not valid\n"));
       goto on_error;
     }
diff --git a/libgda/gda-ddl-creator.h b/libgda/gda-ddl-creator.h
index 6ab7b7f3d..ca774b07c 100644
--- a/libgda/gda-ddl-creator.h
+++ b/libgda/gda-ddl-creator.h
@@ -25,6 +25,7 @@
 #include <gmodule.h>
 #include "gda-connection.h"
 #include "gda-ddl-table.h"
+#include "gda-ddl-view.h"
 #include "gda-server-operation.h"
 #include <gio/gio.h>
 
@@ -38,11 +39,27 @@ struct _GdaDdlCreatorClass {
     GObjectClass parent;
 };
 
+/**
+ * GdaDdlCreatorError:
+ * @GDA_DDL_CREATOR_CONTEXT_NULL: Context is %NULL. Should not be %NULL for normal operation.
+ * @GDA_DDL_CREATOR_DOC_NULL: #xmlDocPtr is %NULL. 
+ * @GDA_DDL_CREATOR_INVALID_XML: Sets if xml check fails. Xml file structure doesn't match with DTD
+ * file
+ * @GDA_DDL_CREATOR_INVALID_SCHEMA: Sets if the used schema is invalid. 
+ * @GDA_DDL_CREATOR_SERVER_OPERATION: Sets if server operation is %NULL. 
+ * @GDA_DDL_CREATOR_FILE_READ: Sets if xml file is not readable
+ * @GDA_DDL_CREATOR_PARSE_CONTEXT: Sets if an error with context during parsing an xml file
+ * @GDA_DDL_CREATOR_PARSE: Sets if parsing reports an error
+ * @GDA_DDL_CREATOR_PARSE_CHUNK: If set, error with parse chunk algorithm.
+ * @GDA_DDL_CREATOR_CONNECTION_CLOSED: Connection is not open.
+ *
+ * These error are primary for developers to troubleshoot the problem rather than for user. 
+ */
 typedef  enum {
     GDA_DDL_CREATOR_CONTEXT_NULL,
     GDA_DDL_CREATOR_DOC_NULL,
-    GDA_DDL_CREATOR_UNVALID_XML,
-    GDA_DDL_CREATOR_UNVALID_SCHEMA,
+    GDA_DDL_CREATOR_INVALID_XML,
+    GDA_DDL_CREATOR_INVALID_SCHEMA,
     GDA_DDL_CREATOR_SERVER_OPERATION,
     GDA_DDL_CREATOR_FILE_READ,
     GDA_DDL_CREATOR_PARSE_CONTEXT,
@@ -76,7 +93,7 @@ void             gda_ddl_creator_append_table (GdaDdlCreator *self,
                                                const GdaDdlTable *table);
 
 void             gda_ddl_creator_append_view (GdaDdlCreator *self,
-                                              const GdaDdlTable *view);
+                                              const GdaDdlView *view);
 
 gboolean         gda_ddl_creator_perform_operation (GdaDdlCreator *self,
                                                     GdaConnection *cnc,
diff --git a/libgda/gda-ddl-fkey.c b/libgda/gda-ddl-fkey.c
index 520a83c70..a258fe7f4 100644
--- a/libgda/gda-ddl-fkey.c
+++ b/libgda/gda-ddl-fkey.c
@@ -37,6 +37,18 @@ typedef struct
   GdaDdlFkeyReferenceAction m_ondelete;
 }GdaDdlFkeyPrivate;
 
+/**
+ * SECTION:gda-ddl-fkey
+ * @short_description: Object to hold information for foregn key.
+ * @stability: Stable
+ * @include: libgda/libgda.h
+ *
+ * For generating database from xml file or for mapping
+ * database to an xml file #GdaDdlFkey holds information about
+ * foregn keys with a convenient set of methods to manipulate them.
+ * #GdaDdlFkey implements #GdaDdlBuildable interface for parsing xml file.
+ */
+
 static void gda_ddl_fkey_buildable_interface_init (GdaDdlBuildableInterface *iface);
 
 G_DEFINE_TYPE_WITH_CODE (GdaDdlFkey, gda_ddl_fkey, G_TYPE_OBJECT,
@@ -444,8 +456,9 @@ gda_ddl_fkey_set_ondelete (GdaDdlFkey *self,
 
 /**
  * gda_ddl_fkey_get_onupdate:
+ * @self: a #GdaDdlFkey instance
  *
- * Return: ON_UPDATE action as a string. Never %NULL
+ * Returns: ON_UPDATE action as a string. Never %NULL
  *
  * Since: 6.0
  */
@@ -461,6 +474,7 @@ gda_ddl_fkey_get_onupdate (GdaDdlFkey *self)
 
 /**
  * gda_ddl_fkey_get_onupdate_id:
+ * @self: a #GdaDdlFkey instance
  *
  * Return: ON_UPDATE action as a #GdaDdlFkeyReferenceAction
  *
diff --git a/libgda/gda-ddl-fkey.h b/libgda/gda-ddl-fkey.h
index 8479e4324..5a305870f 100644
--- a/libgda/gda-ddl-fkey.h
+++ b/libgda/gda-ddl-fkey.h
@@ -1,6 +1,6 @@
 /* gda-ddl-fkey.h
  *
- * Copyright (C) 2018 Pavlo Solntsev <pavlo solntsev gmail com>
+ * Copyright (C) 2018 Pavlo Solntsev <p sun fun gmail com>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -39,6 +39,16 @@ struct _GdaDdlFkeyClass {
     GObjectClass parent_class;
 };
 
+/**
+ * GdaDdlFkeyReferenceAction:
+ * @GDA_DDL_FKEY_NO_ACTION: Action is not specified. 
+ * @GDA_DDL_FKEY_SET_NULL: Action value is set to %NULL
+ * @GDA_DDL_FKEY_RESTRICT: Value is set to "RESTRICT"
+ * @GDA_DDL_FKEY_SET_DEFAULT: Value is set to default behavior  
+ * @GDA_DDL_FKEY_CASCADE: Value is set to cascade
+ * 
+ * Specify numeric value for the actions, e.g. "ON DELETE" and "ON UPDATE"
+ */
 typedef enum {
     GDA_DDL_FKEY_NO_ACTION,
     GDA_DDL_FKEY_SET_NULL,
@@ -47,16 +57,6 @@ typedef enum {
     GDA_DDL_FKEY_CASCADE
 } GdaDdlFkeyReferenceAction;
 
-/**
- * SECTION:gda-ddl-fkey
- * @short_description: Object to hold information for foregn key.
- * @stability: Stable
- * @include: libgda.h
- *
- * For generating database from xml file or for mapping
- * database to an xml file #GdaDdlFkey holds information about
- * foregn keys with a convenient set of methods to manipulate them.
- */
 
 GdaDdlFkey*       gda_ddl_fkey_new             (void);
 
diff --git a/libgda/gda-ddl-table.c b/libgda/gda-ddl-table.c
index 0ba4f943f..d5f96a9bd 100644
--- a/libgda/gda-ddl-table.c
+++ b/libgda/gda-ddl-table.c
@@ -39,6 +39,19 @@ typedef struct
   GList *mp_fkeys; /* List of all fkeys, GdaDdlFkey */
 } GdaDdlTablePrivate;
 
+/**
+ * SECTION:gda-ddl-table
+ * @title: GdaDdlTable
+ * @short_description: Object to represent table database object
+ * @see_also: #GdaDdlView, #GdaDdlCreator
+ * @stability: Stable
+ * @include: libgda/libgda.h
+ *
+ * This object represents a table of a database. The table view can be constracted manually
+ * using API or generated from xml file together with other databse objects. See #GdaDdlCreator.
+ * #GdaDdlTable implements #GdaDdlBuildable interface for parsing xml file.
+ */
+
 static void gda_ddl_table_buildable_interface_init (GdaDdlBuildableInterface *iface);
 
 G_DEFINE_TYPE_WITH_CODE (GdaDdlTable, gda_ddl_table, GDA_TYPE_DDL_BASE,
diff --git a/libgda/gda-ddl-table.h b/libgda/gda-ddl-table.h
index c85636568..882ebbda3 100644
--- a/libgda/gda-ddl-table.h
+++ b/libgda/gda-ddl-table.h
@@ -39,6 +39,11 @@ struct _GdaDdlTableClass {
     GdaDdlBaseClass parent_class;
 };
 
+/**
+ * GdaDdlTableError:
+ * @GDA_DDL_TABLE_COLUMN_EMPTY: Table doesn't contain columns
+ *
+ */
 typedef enum {
     GDA_DDL_TABLE_COLUMN_EMPTY,
 }GdaDdlTableError;
diff --git a/libgda/gda-ddl-view.c b/libgda/gda-ddl-view.c
index c32829227..0124d4b05 100644
--- a/libgda/gda-ddl-view.c
+++ b/libgda/gda-ddl-view.c
@@ -33,6 +33,18 @@ typedef struct
   gboolean m_replace;
 } GdaDdlViewPrivate;
 
+/**
+ * SECTION:gda-ddl-view
+ * @short_description: Object to represent view database object
+ * @see_also: GdaDdlTable, GdaDdlCreator
+ * @stability: Stable
+ * @include: libgda/libgda.h
+ *
+ * This object represents a view of a database. The view can be constracted manually
+ * using API or generated from xml file together with other databse objects. See #GdaDdlCreator.
+ * #GdaDdlView implements #GdaDdlBuildable interface for parsing xml file.
+ */
+
 static void gda_ddl_view_buildable_interface_init (GdaDdlBuildableInterface *iface);
 
 G_DEFINE_TYPE_WITH_CODE (GdaDdlView, gda_ddl_view, GDA_TYPE_DDL_BASE,
diff --git a/libgda/libgda.h.in b/libgda/libgda.h.in
index 0b63dcf1c..40c1e37f2 100644
--- a/libgda/libgda.h.in
+++ b/libgda/libgda.h.in
@@ -87,6 +87,7 @@
 #include <libgda/gda-sql-builder.h>
 
 #include <libgda/gda-meta-store.h>
+#include <libgda/gda-ddl-creator.h>
 
 G_BEGIN_DECLS
 
diff --git a/po/POTFILES.skip b/po/POTFILES.skip
index d22ec73a5..b06c665a9 100755
--- a/po/POTFILES.skip
+++ b/po/POTFILES.skip
@@ -34,6 +34,7 @@ providers/skel-implementation/capi/libmain.c
 providers/skel-implementation/models/gda-models-provider.c
 providers/skel-implementation/models/libmain.c
 providers/skel-implementation/models/models_specs_dsn.xml.in
+providers/skel-implementation/models/models_specs_dsn.raw.xml
 providers/sqlcipher/sqlite3.c
 testing/html.c
 tests/raw-ddl-creator.c


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