]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
gmodule-2.0: Build from GIR
authorRico Tzschichholz <ricotz@ubuntu.com>
Sat, 8 Jun 2019 08:54:07 +0000 (10:54 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Sat, 8 Jun 2019 08:55:30 +0000 (10:55 +0200)
vapi/Makefile.am
vapi/gmodule-2.0.vapi
vapi/metadata/GModule-2.0-custom.vala [new file with mode: 0644]
vapi/metadata/GModule-2.0.metadata [new file with mode: 0644]

index 5c831c043f2ce0a630b2ab232499de5362a806c6..ef413a157b34663c752598de2ffd944e02cec490 100644 (file)
@@ -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
 
index 54e7a00d95538f62e1c5f848418735da8dda1bb2..f1798c6775b094412a312395e07e9b2d5bf172b8 100644 (file)
@@ -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 (file)
index 0000000..d4fd26d
--- /dev/null
@@ -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 (file)
index 0000000..04643af
--- /dev/null
@@ -0,0 +1,3 @@
+GModule name="GLib"
+
+Module.close destroys_instance