[vala/staging] gmodule-2.0: Build from GIR



commit a9b927ae9171584d6c4d4c0c39b91de20e36400a
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Sat Jun 8 10:54:07 2019 +0200

    gmodule-2.0: Build from GIR

 vapi/Makefile.am                      |  4 +++
 vapi/gmodule-2.0.vapi                 | 59 +++++++++++++++--------------------
 vapi/metadata/GModule-2.0-custom.vala | 20 ++++++++++++
 vapi/metadata/GModule-2.0.metadata    |  3 ++
 4 files changed, 52 insertions(+), 34 deletions(-)
---
diff --git a/vapi/Makefile.am b/vapi/Makefile.am
index 5c831c043..ef413a157 100644
--- a/vapi/Makefile.am
+++ b/vapi/Makefile.am
@@ -347,6 +347,7 @@ GIR_BINDINGS = \
        gdl-3.0 \
        geocode-glib-1.0 \
        gio-2.0 \
+       gmodule-2.0 \
        gnome-desktop-3.0 \
        gobject-introspection-1.0 \
        goocanvas-2.0 \
@@ -470,6 +471,9 @@ gio-2.0:
 gio-unix-2.0:
        $(GENVAPI) --library $(srcdir)/gio-unix-2.0 $(PACKAGESDIR)/gio-unix-2.0/gio-unix-2.0-custom.vala 
$(PACKAGESDIR)/gio-unix-2.0/gio-unix-2.0.gi
 
+gmodule-2.0:
+       $(GENVAPI) --library $(srcdir)/gmodule-2.0 --metadatadir $(METADATADIR) 
$(METADATADIR)/GModule-2.0-custom.vala $(GIRDIR)/GModule-2.0.gir
+
 gnome-desktop-2.0:
        $(GENVAPI) --library $(srcdir)/gnome-desktop-2.0 $(PACKAGESDIR)/gnome-desktop-2.0/gnome-desktop-2.0.gi
 
diff --git a/vapi/gmodule-2.0.vapi b/vapi/gmodule-2.0.vapi
index 54e7a00d9..f1798c677 100644
--- a/vapi/gmodule-2.0.vapi
+++ b/vapi/gmodule-2.0.vapi
@@ -1,47 +1,38 @@
-/* gmodule-2.0.vala
- *
- * Copyright (C) 2006-2008  Jürg Billeter
- *
- * 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.1 of the License, or (at your option) any later version.
+/* gmodule-2.0.vapi generated by vapigen, do not modify. */
 
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
- *
- * Author:
- *     Jürg Billeter <j bitron ch>
- */
-
-[CCode (cprefix = "G", lower_case_cprefix = "g_", cheader_filename = "gmodule.h", gir_namespace = "GModule", 
gir_version = "2.0")]
+[CCode (cprefix = "G", gir_namespace = "GModule", gir_version = "2.0", lower_case_cprefix = "g_")]
 namespace GLib {
-       /* Dynamic Loading of Modules */
-
+       [CCode (cheader_filename = "gmodule.h", free_function = "g_module_close", has_type_id = false)]
        [Compact]
-       [CCode (free_function = "g_module_close", cheader_filename = "gmodule.h")]
        public class Module {
                public const string SUFFIX;
-               public static bool supported ();
                public static string build_path (string? directory, string module_name);
-               public static Module? open (string? file_name, ModuleFlags flags);
-               public bool symbol (string symbol_name, out void* symbol);
-               public unowned string name ();
-               public void make_resident ();
+               [DestroysInstance]
+               public bool close ();
                public static unowned string error ();
+               public void make_resident ();
+               public unowned string name ();
+               public static GLib.Module? open (string? file_name, GLib.ModuleFlags flags);
+               public static bool supported ();
+               public bool symbol (string symbol_name, out void* symbol);
        }
-
-       [CCode (cprefix = "G_MODULE_")]
+       [CCode (cheader_filename = "gmodule.h", cprefix = "G_MODULE_BIND_", has_type_id = false)]
        public enum ModuleFlags {
+               [CCode (cname = "G_MODULE_BIND_LAZY")]
+               [Version (deprecated = true, deprecated_since = "vala-0.46", replacement = "LAZY")]
                BIND_LAZY,
+               [CCode (cname = "G_MODULE_BIND_LOCAL")]
+               [Version (deprecated = true, deprecated_since = "vala-0.46", replacement = "LOCAL")]
                BIND_LOCAL,
-               BIND_MASK
+               [CCode (cname = "G_MODULE_BIND_MASK")]
+               [Version (deprecated = true, deprecated_since = "vala-0.46", replacement = "MASK")]
+               BIND_MASK,
+               LAZY,
+               LOCAL,
+               MASK
        }
+       [CCode (cheader_filename = "gmodule.h", has_target = false)]
+       public delegate unowned string ModuleCheckInit (GLib.Module module);
+       [CCode (cheader_filename = "gmodule.h", has_target = false)]
+       public delegate void ModuleUnload (GLib.Module module);
 }
-
diff --git a/vapi/metadata/GModule-2.0-custom.vala b/vapi/metadata/GModule-2.0-custom.vala
new file mode 100644
index 000000000..d4fd26d4a
--- /dev/null
+++ b/vapi/metadata/GModule-2.0-custom.vala
@@ -0,0 +1,20 @@
+namespace GLib {
+       [Compact]
+       [CCode (free_function = "g_module_close")]
+       public class Module {
+               public const string SUFFIX;
+               public static Module? open (string? file_name, ModuleFlags flags);
+       }
+
+       public enum ModuleFlags {
+               [CCode (cname = "G_MODULE_BIND_LAZY")]
+               [Version (deprecated = true, replacement = "LAZY", deprecated_since = "vala-0.46")]
+               BIND_LAZY,
+               [CCode (cname = "G_MODULE_BIND_LOCAL")]
+               [Version (deprecated = true, replacement = "LOCAL", deprecated_since = "vala-0.46")]
+               BIND_LOCAL,
+               [CCode (cname = "G_MODULE_BIND_MASK")]
+               [Version (deprecated = true, replacement = "MASK", deprecated_since = "vala-0.46")]
+               BIND_MASK,
+       }
+}
diff --git a/vapi/metadata/GModule-2.0.metadata b/vapi/metadata/GModule-2.0.metadata
new file mode 100644
index 000000000..04643af8d
--- /dev/null
+++ b/vapi/metadata/GModule-2.0.metadata
@@ -0,0 +1,3 @@
+GModule name="GLib"
+
+Module.close destroys_instance


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