From 29d7ecdd7984db1fc4116d564d16b60ea3aef74f Mon Sep 17 00:00:00 2001 From: Bilal Elmoussaoui Date: Thu, 18 Jan 2024 15:24:39 +0100 Subject: [PATCH 01/13] Update gir/gir-files submodules --- gir | 2 +- gir-files | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gir b/gir index a2f936b77195..1c7a6b57a5fc 160000 --- a/gir +++ b/gir @@ -1 +1 @@ -Subproject commit a2f936b771958a65d5314effa6635b2a953a04f4 +Subproject commit 1c7a6b57a5fcc4d87cb82e0535dc49d14babb76b diff --git a/gir-files b/gir-files index 20031a537e40..21b29d0e0c1a 160000 --- a/gir-files +++ b/gir-files @@ -1 +1 @@ -Subproject commit 20031a537e4050aec6d290f4250d217e28415da5 +Subproject commit 21b29d0e0c1afee88313b1e23bb5b73d7755c068 From a1d4e1de891567ab5a326301b168d0398a2a1e9e Mon Sep 17 00:00:00 2001 From: Bilal Elmoussaoui Date: Thu, 18 Jan 2024 15:26:41 +0100 Subject: [PATCH 02/13] Regenerate with latest gir/gir-files --- gdk-pixbuf/src/auto/versions.txt | 4 +- gdk-pixbuf/sys/src/lib.rs | 2 +- gdk-pixbuf/sys/versions.txt | 4 +- gio/src/auto/application_command_line.rs | 33 ++ gio/src/auto/dbus_message.rs | 8 + gio/src/auto/enums.rs | 11 + gio/src/auto/flags.rs | 2 + gio/src/auto/resolver.rs | 5 + gio/src/auto/subprocess_launcher.rs | 4 +- gio/src/auto/versions.txt | 4 +- gio/sys/Cargo.toml | 4 + gio/sys/src/lib.rs | 260 ++++++--- gio/sys/tests/abi.rs | 9 + gio/sys/tests/constant.c | 2 + gio/sys/tests/layout.c | 1 + gio/sys/versions.txt | 4 +- glib/gobject-sys/Cargo.toml | 4 + glib/gobject-sys/src/lib.rs | 45 +- glib/gobject-sys/tests/abi.rs | 23 +- glib/gobject-sys/tests/constant.c | 7 + glib/gobject-sys/tests/layout.c | 2 + glib/gobject-sys/versions.txt | 4 +- glib/src/auto/date_time.rs | 29 + glib/src/auto/enums.rs | 248 +++++++++ glib/src/auto/functions.rs | 190 ++++++- glib/src/auto/markup_parse_context.rs | 14 +- glib/src/auto/regex.rs | 2 +- glib/src/auto/versions.txt | 4 +- glib/sys/Cargo.toml | 4 + glib/sys/src/lib.rs | 644 +++++++++++++++++++++-- glib/sys/tests/abi.rs | 103 +++- glib/sys/tests/constant.c | 20 + glib/sys/tests/layout.c | 13 +- glib/sys/versions.txt | 4 +- graphene/src/auto/point.rs | 7 - graphene/src/auto/versions.txt | 4 +- graphene/sys/src/lib.rs | 6 - graphene/sys/versions.txt | 4 +- pango/src/auto/versions.txt | 4 +- pango/sys/src/lib.rs | 8 +- pango/sys/versions.txt | 4 +- pangocairo/src/auto/versions.txt | 4 +- pangocairo/sys/versions.txt | 4 +- 43 files changed, 1572 insertions(+), 190 deletions(-) diff --git a/gdk-pixbuf/src/auto/versions.txt b/gdk-pixbuf/src/auto/versions.txt index 511eac1e7f3c..2b08b0af6393 100644 --- a/gdk-pixbuf/src/auto/versions.txt +++ b/gdk-pixbuf/src/auto/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ a2f936b77195) -from gir-files (https://github.com/gtk-rs/gir-files @ 20031a537e40) +Generated by gir (https://github.com/gtk-rs/gir @ 1c7a6b57a5fc) +from gir-files (https://github.com/gtk-rs/gir-files @ 21b29d0e0c1a) diff --git a/gdk-pixbuf/sys/src/lib.rs b/gdk-pixbuf/sys/src/lib.rs index af95db31103f..87eb0bfc5005 100644 --- a/gdk-pixbuf/sys/src/lib.rs +++ b/gdk-pixbuf/sys/src/lib.rs @@ -288,7 +288,7 @@ pub struct _GdkPixbufSimpleAnimClass { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GdkPixbufSimpleAnimClass = *mut _GdkPixbufSimpleAnimClass; +pub type GdkPixbufSimpleAnimClass = _GdkPixbufSimpleAnimClass; // Classes #[repr(C)] diff --git a/gdk-pixbuf/sys/versions.txt b/gdk-pixbuf/sys/versions.txt index 511eac1e7f3c..2b08b0af6393 100644 --- a/gdk-pixbuf/sys/versions.txt +++ b/gdk-pixbuf/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ a2f936b77195) -from gir-files (https://github.com/gtk-rs/gir-files @ 20031a537e40) +Generated by gir (https://github.com/gtk-rs/gir @ 1c7a6b57a5fc) +from gir-files (https://github.com/gtk-rs/gir-files @ 21b29d0e0c1a) diff --git a/gio/src/auto/application_command_line.rs b/gio/src/auto/application_command_line.rs index f4cf991fdc88..5fe5e53aa78b 100644 --- a/gio/src/auto/application_command_line.rs +++ b/gio/src/auto/application_command_line.rs @@ -41,6 +41,15 @@ pub trait ApplicationCommandLineExt: } } + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + #[doc(alias = "g_application_command_line_done")] + fn done(&self) { + unsafe { + ffi::g_application_command_line_done(self.as_ref().to_glib_none().0); + } + } + #[doc(alias = "g_application_command_line_get_arguments")] #[doc(alias = "get_arguments")] fn arguments(&self) -> Vec { @@ -138,11 +147,35 @@ pub trait ApplicationCommandLineExt: // unsafe { TODO: call ffi:g_application_command_line_print() } //} + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + #[doc(alias = "g_application_command_line_print_literal")] + fn print_literal(&self, message: &str) { + unsafe { + ffi::g_application_command_line_print_literal( + self.as_ref().to_glib_none().0, + message.to_glib_none().0, + ); + } + } + //#[doc(alias = "g_application_command_line_printerr")] //fn printerr(&self, format: &str, : /*Unknown conversion*//*Unimplemented*/Basic: VarArgs) { // unsafe { TODO: call ffi:g_application_command_line_printerr() } //} + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + #[doc(alias = "g_application_command_line_printerr_literal")] + fn printerr_literal(&self, message: &str) { + unsafe { + ffi::g_application_command_line_printerr_literal( + self.as_ref().to_glib_none().0, + message.to_glib_none().0, + ); + } + } + #[doc(alias = "g_application_command_line_set_exit_status")] fn set_exit_status(&self, exit_status: i32) { unsafe { diff --git a/gio/src/auto/dbus_message.rs b/gio/src/auto/dbus_message.rs index 68c207bcce07..85eec9c505e5 100644 --- a/gio/src/auto/dbus_message.rs +++ b/gio/src/auto/dbus_message.rs @@ -101,6 +101,14 @@ impl DBusMessage { unsafe { from_glib_none(ffi::g_dbus_message_get_arg0(self.to_glib_none().0)) } } + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + #[doc(alias = "g_dbus_message_get_arg0_path")] + #[doc(alias = "get_arg0_path")] + pub fn arg0_path(&self) -> Option { + unsafe { from_glib_none(ffi::g_dbus_message_get_arg0_path(self.to_glib_none().0)) } + } + #[doc(alias = "g_dbus_message_get_body")] #[doc(alias = "get_body")] pub fn body(&self) -> Option { diff --git a/gio/src/auto/enums.rs b/gio/src/auto/enums.rs index a94d71d6ef12..8c9a794d86b2 100644 --- a/gio/src/auto/enums.rs +++ b/gio/src/auto/enums.rs @@ -1606,6 +1606,8 @@ pub enum IOErrorEnum { #[cfg_attr(docsrs, doc(cfg(feature = "v2_72")))] #[doc(alias = "G_IO_ERROR_NO_SUCH_DEVICE")] NoSuchDevice, + #[doc(alias = "G_IO_ERROR_DESTINATION_UNSET")] + DestinationUnset, #[doc(hidden)] __Unknown(i32), } @@ -1665,6 +1667,7 @@ impl IntoGlib for IOErrorEnum { Self::MessageTooLarge => ffi::G_IO_ERROR_MESSAGE_TOO_LARGE, #[cfg(feature = "v2_72")] Self::NoSuchDevice => ffi::G_IO_ERROR_NO_SUCH_DEVICE, + Self::DestinationUnset => ffi::G_IO_ERROR_DESTINATION_UNSET, Self::__Unknown(value) => value, } } @@ -1723,6 +1726,7 @@ impl FromGlib for IOErrorEnum { ffi::G_IO_ERROR_MESSAGE_TOO_LARGE => Self::MessageTooLarge, #[cfg(feature = "v2_72")] ffi::G_IO_ERROR_NO_SUCH_DEVICE => Self::NoSuchDevice, + ffi::G_IO_ERROR_DESTINATION_UNSET => Self::DestinationUnset, value => Self::__Unknown(value), } } @@ -2557,6 +2561,13 @@ pub enum ResolverRecordType { __Unknown(i32), } +impl ResolverRecordType { + #[doc(alias = "g_resolver_record_type_to_rrtype")] + pub fn to_rrtype(self) -> i32 { + unsafe { ffi::g_resolver_record_type_to_rrtype(self.into_glib()) } + } +} + #[doc(hidden)] impl IntoGlib for ResolverRecordType { type GlibType = ffi::GResolverRecordType; diff --git a/gio/src/auto/flags.rs b/gio/src/auto/flags.rs index d965b678a945..fcfd43a465ad 100644 --- a/gio/src/auto/flags.rs +++ b/gio/src/auto/flags.rs @@ -1590,6 +1590,8 @@ bitflags! { const NO_FALLBACK_FOR_MOVE = ffi::G_FILE_COPY_NO_FALLBACK_FOR_MOVE as _; #[doc(alias = "G_FILE_COPY_TARGET_DEFAULT_PERMS")] const TARGET_DEFAULT_PERMS = ffi::G_FILE_COPY_TARGET_DEFAULT_PERMS as _; + #[doc(alias = "G_FILE_COPY_TARGET_DEFAULT_MODIFIED_TIME")] + const TARGET_DEFAULT_MODIFIED_TIME = ffi::G_FILE_COPY_TARGET_DEFAULT_MODIFIED_TIME as _; } } diff --git a/gio/src/auto/resolver.rs b/gio/src/auto/resolver.rs index 67840652d6e7..b8e4af0178e5 100644 --- a/gio/src/auto/resolver.rs +++ b/gio/src/auto/resolver.rs @@ -41,6 +41,11 @@ impl Resolver { pub fn default() -> Resolver { unsafe { from_glib_full(ffi::g_resolver_get_default()) } } + + //#[doc(alias = "g_resolver_records_from_res_query")] + //pub fn records_from_res_query(rrname: &str, rrtype: i32, answer: u8, len: isize, herr: i32) -> Result, glib::Error> { + // unsafe { TODO: call ffi:g_resolver_records_from_res_query() } + //} } mod sealed { diff --git a/gio/src/auto/subprocess_launcher.rs b/gio/src/auto/subprocess_launcher.rs index 8de84842753a..5e5441bd3a40 100644 --- a/gio/src/auto/subprocess_launcher.rs +++ b/gio/src/auto/subprocess_launcher.rs @@ -108,11 +108,11 @@ impl SubprocessLauncher { #[cfg(unix)] #[cfg_attr(docsrs, doc(cfg(unix)))] #[doc(alias = "g_subprocess_launcher_set_stdin_file_path")] - pub fn set_stdin_file_path(&self, path: &str) { + pub fn set_stdin_file_path(&self, path: Option>) { unsafe { ffi::g_subprocess_launcher_set_stdin_file_path( self.to_glib_none().0, - path.to_glib_none().0, + path.as_ref().map(|p| p.as_ref()).to_glib_none().0, ); } } diff --git a/gio/src/auto/versions.txt b/gio/src/auto/versions.txt index 511eac1e7f3c..2b08b0af6393 100644 --- a/gio/src/auto/versions.txt +++ b/gio/src/auto/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ a2f936b77195) -from gir-files (https://github.com/gtk-rs/gir-files @ 20031a537e40) +Generated by gir (https://github.com/gtk-rs/gir @ 1c7a6b57a5fc) +from gir-files (https://github.com/gtk-rs/gir-files @ 21b29d0e0c1a) diff --git a/gio/sys/Cargo.toml b/gio/sys/Cargo.toml index 3cb59560403b..2bdbb70ecc03 100644 --- a/gio/sys/Cargo.toml +++ b/gio/sys/Cargo.toml @@ -32,6 +32,7 @@ v2_72 = ["v2_70"] v2_74 = ["v2_72"] v2_76 = ["v2_74"] v2_78 = ["v2_76"] +v2_80 = ["v2_78"] [lib] name = "gio_sys" @@ -86,6 +87,9 @@ version = "2.76" [package.metadata.system-deps.gio_2_0.v2_78] version = "2.77" +[package.metadata.system-deps.gio_2_0.v2_80] +version = "2.80" + [package.metadata.docs.rs] rustc-args = ["--cfg", "docsrs"] rustdoc-args = ["--cfg", "docsrs", "--generate-link-to-definition"] diff --git a/gio/sys/src/lib.rs b/gio/sys/src/lib.rs index 8b88ffa31501..985cc3ae7a24 100644 --- a/gio/sys/src/lib.rs +++ b/gio/sys/src/lib.rs @@ -235,6 +235,7 @@ pub const G_IO_ERROR_CONNECTION_CLOSED: GIOErrorEnum = 44; pub const G_IO_ERROR_NOT_CONNECTED: GIOErrorEnum = 45; pub const G_IO_ERROR_MESSAGE_TOO_LARGE: GIOErrorEnum = 46; pub const G_IO_ERROR_NO_SUCH_DEVICE: GIOErrorEnum = 47; +pub const G_IO_ERROR_DESTINATION_UNSET: GIOErrorEnum = 48; pub type GIOModuleScopeFlags = c_int; pub const G_IO_MODULE_SCOPE_NONE: GIOModuleScopeFlags = 0; @@ -645,6 +646,7 @@ pub const G_FILE_COPY_NOFOLLOW_SYMLINKS: GFileCopyFlags = 4; pub const G_FILE_COPY_ALL_METADATA: GFileCopyFlags = 8; pub const G_FILE_COPY_NO_FALLBACK_FOR_MOVE: GFileCopyFlags = 16; pub const G_FILE_COPY_TARGET_DEFAULT_PERMS: GFileCopyFlags = 32; +pub const G_FILE_COPY_TARGET_DEFAULT_MODIFIED_TIME: GFileCopyFlags = 64; pub type GFileCreateFlags = c_uint; pub const G_FILE_CREATE_NONE: GFileCreateFlags = 0; @@ -1171,7 +1173,7 @@ pub struct _GAppLaunchContextPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GAppLaunchContextPrivate = *mut _GAppLaunchContextPrivate; +pub type GAppLaunchContextPrivate = _GAppLaunchContextPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -1238,7 +1240,8 @@ pub struct GApplicationCommandLineClass { pub print_literal: Option, pub printerr_literal: Option, pub get_stdin: Option *mut GInputStream>, - pub padding: [gpointer; 11], + pub done: Option, + pub padding: [gpointer; 10], } impl ::std::fmt::Debug for GApplicationCommandLineClass { @@ -1247,6 +1250,7 @@ impl ::std::fmt::Debug for GApplicationCommandLineClass { .field("print_literal", &self.print_literal) .field("printerr_literal", &self.printerr_literal) .field("get_stdin", &self.get_stdin) + .field("done", &self.done) .finish() } } @@ -1257,7 +1261,7 @@ pub struct _GApplicationCommandLinePrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GApplicationCommandLinePrivate = *mut _GApplicationCommandLinePrivate; +pub type GApplicationCommandLinePrivate = _GApplicationCommandLinePrivate; #[repr(C)] pub struct _GApplicationPrivate { @@ -1265,7 +1269,7 @@ pub struct _GApplicationPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GApplicationPrivate = *mut _GApplicationPrivate; +pub type GApplicationPrivate = _GApplicationPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -1377,7 +1381,7 @@ pub struct _GBufferedInputStreamPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GBufferedInputStreamPrivate = *mut _GBufferedInputStreamPrivate; +pub type GBufferedInputStreamPrivate = _GBufferedInputStreamPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -1403,7 +1407,7 @@ pub struct _GBufferedOutputStreamPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GBufferedOutputStreamPrivate = *mut _GBufferedOutputStreamPrivate; +pub type GBufferedOutputStreamPrivate = _GBufferedOutputStreamPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -1437,7 +1441,7 @@ pub struct _GCancellablePrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GCancellablePrivate = *mut _GCancellablePrivate; +pub type GCancellablePrivate = _GCancellablePrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -1513,7 +1517,7 @@ pub struct _GConverterInputStreamPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GConverterInputStreamPrivate = *mut _GConverterInputStreamPrivate; +pub type GConverterInputStreamPrivate = _GConverterInputStreamPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -1545,7 +1549,7 @@ pub struct _GConverterOutputStreamPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GConverterOutputStreamPrivate = *mut _GConverterOutputStreamPrivate; +pub type GConverterOutputStreamPrivate = _GConverterOutputStreamPrivate; #[repr(C)] pub struct _GCredentialsClass { @@ -1553,7 +1557,7 @@ pub struct _GCredentialsClass { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GCredentialsClass = *mut _GCredentialsClass; +pub type GCredentialsClass = _GCredentialsClass; #[derive(Copy, Clone)] #[repr(C)] @@ -1694,7 +1698,7 @@ pub struct _GDBusInterfaceSkeletonPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GDBusInterfaceSkeletonPrivate = *mut _GDBusInterfaceSkeletonPrivate; +pub type GDBusInterfaceSkeletonPrivate = _GDBusInterfaceSkeletonPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -1829,7 +1833,7 @@ pub struct _GDBusObjectManagerClientPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GDBusObjectManagerClientPrivate = *mut _GDBusObjectManagerClientPrivate; +pub type GDBusObjectManagerClientPrivate = _GDBusObjectManagerClientPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -1893,7 +1897,7 @@ pub struct _GDBusObjectManagerServerPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GDBusObjectManagerServerPrivate = *mut _GDBusObjectManagerServerPrivate; +pub type GDBusObjectManagerServerPrivate = _GDBusObjectManagerServerPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -1916,7 +1920,7 @@ pub struct _GDBusObjectProxyPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GDBusObjectProxyPrivate = *mut _GDBusObjectProxyPrivate; +pub type GDBusObjectProxyPrivate = _GDBusObjectProxyPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -1947,7 +1951,7 @@ pub struct _GDBusObjectSkeletonPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GDBusObjectSkeletonPrivate = *mut _GDBusObjectSkeletonPrivate; +pub type GDBusObjectSkeletonPrivate = _GDBusObjectSkeletonPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -1998,7 +2002,7 @@ pub struct _GDBusProxyPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GDBusProxyPrivate = *mut _GDBusProxyPrivate; +pub type GDBusProxyPrivate = _GDBusProxyPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -2069,7 +2073,7 @@ pub struct _GDataInputStreamPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GDataInputStreamPrivate = *mut _GDataInputStreamPrivate; +pub type GDataInputStreamPrivate = _GDataInputStreamPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -2101,7 +2105,7 @@ pub struct _GDataOutputStreamPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GDataOutputStreamPrivate = *mut _GDataOutputStreamPrivate; +pub type GDataOutputStreamPrivate = _GDataOutputStreamPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -2483,7 +2487,7 @@ pub struct _GEmblemClass { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GEmblemClass = *mut _GEmblemClass; +pub type GEmblemClass = _GEmblemClass; #[derive(Copy, Clone)] #[repr(C)] @@ -2505,7 +2509,7 @@ pub struct _GEmblemedIconPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GEmblemedIconPrivate = *mut _GEmblemedIconPrivate; +pub type GEmblemedIconPrivate = _GEmblemedIconPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -2657,7 +2661,7 @@ pub struct _GFileEnumeratorPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GFileEnumeratorPrivate = *mut _GFileEnumeratorPrivate; +pub type GFileEnumeratorPrivate = _GFileEnumeratorPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -2744,7 +2748,7 @@ pub struct _GFileIOStreamPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GFileIOStreamPrivate = *mut _GFileIOStreamPrivate; +pub type GFileIOStreamPrivate = _GFileIOStreamPrivate; #[repr(C)] pub struct _GFileIconClass { @@ -2752,7 +2756,7 @@ pub struct _GFileIconClass { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GFileIconClass = *mut _GFileIconClass; +pub type GFileIconClass = _GFileIconClass; #[derive(Copy, Clone)] #[repr(C)] @@ -3531,7 +3535,7 @@ pub struct _GFileInfoClass { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GFileInfoClass = *mut _GFileInfoClass; +pub type GFileInfoClass = _GFileInfoClass; #[derive(Copy, Clone)] #[repr(C)] @@ -3605,7 +3609,7 @@ pub struct _GFileInputStreamPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GFileInputStreamPrivate = *mut _GFileInputStreamPrivate; +pub type GFileInputStreamPrivate = _GFileInputStreamPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -3642,7 +3646,7 @@ pub struct _GFileMonitorPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GFileMonitorPrivate = *mut _GFileMonitorPrivate; +pub type GFileMonitorPrivate = _GFileMonitorPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -3729,7 +3733,7 @@ pub struct _GFileOutputStreamPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GFileOutputStreamPrivate = *mut _GFileOutputStreamPrivate; +pub type GFileOutputStreamPrivate = _GFileOutputStreamPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -3799,7 +3803,7 @@ pub struct _GIOExtension { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GIOExtension = *mut _GIOExtension; +pub type GIOExtension = _GIOExtension; #[repr(C)] pub struct _GIOExtensionPoint { @@ -3807,7 +3811,7 @@ pub struct _GIOExtensionPoint { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GIOExtensionPoint = *mut _GIOExtensionPoint; +pub type GIOExtensionPoint = _GIOExtensionPoint; #[repr(C)] pub struct _GIOModuleClass { @@ -3815,7 +3819,7 @@ pub struct _GIOModuleClass { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GIOModuleClass = *mut _GIOModuleClass; +pub type GIOModuleClass = _GIOModuleClass; #[repr(C)] pub struct _GIOModuleScope { @@ -3823,7 +3827,7 @@ pub struct _GIOModuleScope { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GIOModuleScope = *mut _GIOModuleScope; +pub type GIOModuleScope = _GIOModuleScope; #[repr(C)] pub struct _GIOSchedulerJob { @@ -3831,7 +3835,7 @@ pub struct _GIOSchedulerJob { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GIOSchedulerJob = *mut _GIOSchedulerJob; +pub type GIOSchedulerJob = _GIOSchedulerJob; #[repr(C)] pub struct _GIOStreamAdapter { @@ -3839,7 +3843,7 @@ pub struct _GIOStreamAdapter { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GIOStreamAdapter = *mut _GIOStreamAdapter; +pub type GIOStreamAdapter = _GIOStreamAdapter; #[derive(Copy, Clone)] #[repr(C)] @@ -3903,7 +3907,7 @@ pub struct _GIOStreamPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GIOStreamPrivate = *mut _GIOStreamPrivate; +pub type GIOStreamPrivate = _GIOStreamPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -3970,7 +3974,7 @@ pub struct _GInetAddressMaskPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GInetAddressMaskPrivate = *mut _GInetAddressMaskPrivate; +pub type GInetAddressMaskPrivate = _GInetAddressMaskPrivate; #[repr(C)] pub struct _GInetAddressPrivate { @@ -3978,7 +3982,7 @@ pub struct _GInetAddressPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GInetAddressPrivate = *mut _GInetAddressPrivate; +pub type GInetAddressPrivate = _GInetAddressPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -4000,7 +4004,7 @@ pub struct _GInetSocketAddressPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GInetSocketAddressPrivate = *mut _GInetSocketAddressPrivate; +pub type GInetSocketAddressPrivate = _GInetSocketAddressPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -4160,7 +4164,7 @@ pub struct _GInputStreamPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GInputStreamPrivate = *mut _GInputStreamPrivate; +pub type GInputStreamPrivate = _GInputStreamPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -4285,7 +4289,7 @@ pub struct _GMemoryInputStreamPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GMemoryInputStreamPrivate = *mut _GMemoryInputStreamPrivate; +pub type GMemoryInputStreamPrivate = _GMemoryInputStreamPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -4333,7 +4337,7 @@ pub struct _GMemoryOutputStreamPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GMemoryOutputStreamPrivate = *mut _GMemoryOutputStreamPrivate; +pub type GMemoryOutputStreamPrivate = _GMemoryOutputStreamPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -4363,7 +4367,7 @@ pub struct _GMenuAttributeIterPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GMenuAttributeIterPrivate = *mut _GMenuAttributeIterPrivate; +pub type GMenuAttributeIterPrivate = _GMenuAttributeIterPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -4393,7 +4397,7 @@ pub struct _GMenuLinkIterPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GMenuLinkIterPrivate = *mut _GMenuLinkIterPrivate; +pub type GMenuLinkIterPrivate = _GMenuLinkIterPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -4443,7 +4447,7 @@ pub struct _GMenuModelPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GMenuModelPrivate = *mut _GMenuModelPrivate; +pub type GMenuModelPrivate = _GMenuModelPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -4660,7 +4664,7 @@ pub struct _GMountOperationPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GMountOperationPrivate = *mut _GMountOperationPrivate; +pub type GMountOperationPrivate = _GMountOperationPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -4682,7 +4686,7 @@ pub struct _GNativeSocketAddressPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GNativeSocketAddressPrivate = *mut _GNativeSocketAddressPrivate; +pub type GNativeSocketAddressPrivate = _GNativeSocketAddressPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -4721,7 +4725,7 @@ pub struct _GNetworkAddressPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GNetworkAddressPrivate = *mut _GNetworkAddressPrivate; +pub type GNetworkAddressPrivate = _GNetworkAddressPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -4786,7 +4790,7 @@ pub struct _GNetworkServicePrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GNetworkServicePrivate = *mut _GNetworkServicePrivate; +pub type GNetworkServicePrivate = _GNetworkServicePrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -4986,7 +4990,7 @@ pub struct _GOutputStreamPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GOutputStreamPrivate = *mut _GOutputStreamPrivate; +pub type GOutputStreamPrivate = _GOutputStreamPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -5066,7 +5070,7 @@ pub struct _GPermissionPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GPermissionPrivate = *mut _GPermissionPrivate; +pub type GPermissionPrivate = _GPermissionPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -5200,7 +5204,7 @@ pub struct _GProxyAddressEnumeratorPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GProxyAddressEnumeratorPrivate = *mut _GProxyAddressEnumeratorPrivate; +pub type GProxyAddressEnumeratorPrivate = _GProxyAddressEnumeratorPrivate; #[repr(C)] pub struct _GProxyAddressPrivate { @@ -5208,7 +5212,7 @@ pub struct _GProxyAddressPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GProxyAddressPrivate = *mut _GProxyAddressPrivate; +pub type GProxyAddressPrivate = _GProxyAddressPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -5497,7 +5501,7 @@ pub struct _GResolverPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GResolverPrivate = *mut _GResolverPrivate; +pub type GResolverPrivate = _GResolverPrivate; #[repr(C)] pub struct GResource { @@ -5614,7 +5618,7 @@ pub struct _GSettingsBackendPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GSettingsBackendPrivate = *mut _GSettingsBackendPrivate; +pub type GSettingsBackendPrivate = _GSettingsBackendPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -5648,7 +5652,7 @@ pub struct _GSettingsPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GSettingsPrivate = *mut _GSettingsPrivate; +pub type GSettingsPrivate = _GSettingsPrivate; #[repr(C)] pub struct GSettingsSchema { @@ -5709,7 +5713,7 @@ pub struct _GSimpleActionGroupPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GSimpleActionGroupPrivate = *mut _GSimpleActionGroupPrivate; +pub type GSimpleActionGroupPrivate = _GSimpleActionGroupPrivate; #[repr(C)] pub struct _GSimpleAsyncResultClass { @@ -5717,7 +5721,7 @@ pub struct _GSimpleAsyncResultClass { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GSimpleAsyncResultClass = *mut _GSimpleAsyncResultClass; +pub type GSimpleAsyncResultClass = _GSimpleAsyncResultClass; #[derive(Copy, Clone)] #[repr(C)] @@ -5749,7 +5753,7 @@ pub struct _GSimpleProxyResolverPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GSimpleProxyResolverPrivate = *mut _GSimpleProxyResolverPrivate; +pub type GSimpleProxyResolverPrivate = _GSimpleProxyResolverPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -5887,7 +5891,7 @@ pub struct _GSocketClientPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GSocketClientPrivate = *mut _GSocketClientPrivate; +pub type GSocketClientPrivate = _GSocketClientPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -5943,7 +5947,7 @@ pub struct _GSocketConnectionPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GSocketConnectionPrivate = *mut _GSocketConnectionPrivate; +pub type GSocketConnectionPrivate = _GSocketConnectionPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -5986,7 +5990,7 @@ pub struct _GSocketControlMessagePrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GSocketControlMessagePrivate = *mut _GSocketControlMessagePrivate; +pub type GSocketControlMessagePrivate = _GSocketControlMessagePrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -6023,7 +6027,7 @@ pub struct _GSocketListenerPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GSocketListenerPrivate = *mut _GSocketListenerPrivate; +pub type GSocketListenerPrivate = _GSocketListenerPrivate; #[repr(C)] pub struct _GSocketPrivate { @@ -6031,7 +6035,7 @@ pub struct _GSocketPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GSocketPrivate = *mut _GSocketPrivate; +pub type GSocketPrivate = _GSocketPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -6073,7 +6077,7 @@ pub struct _GSocketServicePrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GSocketServicePrivate = *mut _GSocketServicePrivate; +pub type GSocketServicePrivate = _GSocketServicePrivate; #[repr(C)] pub struct GSrvTarget { @@ -6110,7 +6114,7 @@ pub struct _GTaskClass { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GTaskClass = *mut _GTaskClass; +pub type GTaskClass = _GTaskClass; #[derive(Copy, Clone)] #[repr(C)] @@ -6132,7 +6136,7 @@ pub struct _GTcpConnectionPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GTcpConnectionPrivate = *mut _GTcpConnectionPrivate; +pub type GTcpConnectionPrivate = _GTcpConnectionPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -6154,7 +6158,7 @@ pub struct _GTcpWrapperConnectionPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GTcpWrapperConnectionPrivate = *mut _GTcpWrapperConnectionPrivate; +pub type GTcpWrapperConnectionPrivate = _GTcpWrapperConnectionPrivate; #[repr(C)] pub struct _GThemedIconClass { @@ -6162,7 +6166,21 @@ pub struct _GThemedIconClass { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GThemedIconClass = *mut _GThemedIconClass; +pub type GThemedIconClass = _GThemedIconClass; + +#[derive(Copy, Clone)] +#[repr(C)] +pub struct GThreadedResolverClass { + pub parent_class: GResolverClass, +} + +impl ::std::fmt::Debug for GThreadedResolverClass { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + f.debug_struct(&format!("GThreadedResolverClass @ {self:p}")) + .field("parent_class", &self.parent_class) + .finish() + } +} #[derive(Copy, Clone)] #[repr(C)] @@ -6202,7 +6220,7 @@ pub struct _GThreadedSocketServicePrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GThreadedSocketServicePrivate = *mut _GThreadedSocketServicePrivate; +pub type GThreadedSocketServicePrivate = _GThreadedSocketServicePrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -6277,7 +6295,7 @@ pub struct _GTlsCertificatePrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GTlsCertificatePrivate = *mut _GTlsCertificatePrivate; +pub type GTlsCertificatePrivate = _GTlsCertificatePrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -6362,7 +6380,7 @@ pub struct _GTlsConnectionPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GTlsConnectionPrivate = *mut _GTlsConnectionPrivate; +pub type GTlsConnectionPrivate = _GTlsConnectionPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -6540,7 +6558,7 @@ pub struct _GTlsDatabasePrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GTlsDatabasePrivate = *mut _GTlsDatabasePrivate; +pub type GTlsDatabasePrivate = _GTlsDatabasePrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -6636,7 +6654,7 @@ pub struct _GTlsInteractionPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GTlsInteractionPrivate = *mut _GTlsInteractionPrivate; +pub type GTlsInteractionPrivate = _GTlsInteractionPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -6666,7 +6684,7 @@ pub struct _GTlsPasswordPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GTlsPasswordPrivate = *mut _GTlsPasswordPrivate; +pub type GTlsPasswordPrivate = _GTlsPasswordPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -6702,7 +6720,7 @@ pub struct _GUnixConnectionPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GUnixConnectionPrivate = *mut _GUnixConnectionPrivate; +pub type GUnixConnectionPrivate = _GUnixConnectionPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -6728,7 +6746,7 @@ pub struct _GUnixCredentialsMessagePrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GUnixCredentialsMessagePrivate = *mut _GUnixCredentialsMessagePrivate; +pub type GUnixCredentialsMessagePrivate = _GUnixCredentialsMessagePrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -6760,7 +6778,7 @@ pub struct _GUnixFDListPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GUnixFDListPrivate = *mut _GUnixFDListPrivate; +pub type GUnixFDListPrivate = _GUnixFDListPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -6786,7 +6804,7 @@ pub struct _GUnixFDMessagePrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GUnixFDMessagePrivate = *mut _GUnixFDMessagePrivate; +pub type GUnixFDMessagePrivate = _GUnixFDMessagePrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -6818,7 +6836,7 @@ pub struct _GUnixInputStreamPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GUnixInputStreamPrivate = *mut _GUnixInputStreamPrivate; +pub type GUnixInputStreamPrivate = _GUnixInputStreamPrivate; #[repr(C)] pub struct GUnixMountEntry { @@ -6839,7 +6857,7 @@ pub struct _GUnixMountMonitorClass { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GUnixMountMonitorClass = *mut _GUnixMountMonitorClass; +pub type GUnixMountMonitorClass = _GUnixMountMonitorClass; #[repr(C)] pub struct GUnixMountPoint { @@ -6884,7 +6902,7 @@ pub struct _GUnixOutputStreamPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GUnixOutputStreamPrivate = *mut _GUnixOutputStreamPrivate; +pub type GUnixOutputStreamPrivate = _GUnixOutputStreamPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -6906,7 +6924,7 @@ pub struct _GUnixSocketAddressPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GUnixSocketAddressPrivate = *mut _GUnixSocketAddressPrivate; +pub type GUnixSocketAddressPrivate = _GUnixSocketAddressPrivate; #[derive(Copy, Clone)] #[repr(C)] @@ -8438,6 +8456,19 @@ impl ::std::fmt::Debug for GThemedIcon { } } +#[repr(C)] +pub struct GThreadedResolver { + _data: [u8; 0], + _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, +} + +impl ::std::fmt::Debug for GThreadedResolver { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + f.debug_struct(&format!("GThreadedResolver @ {self:p}")) + .finish() + } +} + #[derive(Copy, Clone)] #[repr(C)] pub struct GThreadedSocketService { @@ -9348,6 +9379,7 @@ extern "C" { // GResolverRecordType //========================================================================= pub fn g_resolver_record_type_get_type() -> GType; + pub fn g_resolver_record_type_to_rrtype(type_: GResolverRecordType) -> c_int; //========================================================================= // GResourceError @@ -10150,6 +10182,9 @@ extern "C" { cmdline: *mut GApplicationCommandLine, arg: *const c_char, ) -> *mut GFile; + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + pub fn g_application_command_line_done(cmdline: *mut GApplicationCommandLine); pub fn g_application_command_line_get_arguments( cmdline: *mut GApplicationCommandLine, argc: *mut c_int, @@ -10184,11 +10219,23 @@ extern "C" { format: *const c_char, ... ); + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + pub fn g_application_command_line_print_literal( + cmdline: *mut GApplicationCommandLine, + message: *const c_char, + ); pub fn g_application_command_line_printerr( cmdline: *mut GApplicationCommandLine, format: *const c_char, ... ); + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + pub fn g_application_command_line_printerr_literal( + cmdline: *mut GApplicationCommandLine, + message: *const c_char, + ); pub fn g_application_command_line_set_exit_status( cmdline: *mut GApplicationCommandLine, exit_status: c_int, @@ -10768,6 +10815,9 @@ extern "C" { error: *mut *mut glib::GError, ) -> *mut GDBusMessage; pub fn g_dbus_message_get_arg0(message: *mut GDBusMessage) -> *const c_char; + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + pub fn g_dbus_message_get_arg0_path(message: *mut GDBusMessage) -> *const c_char; pub fn g_dbus_message_get_body(message: *mut GDBusMessage) -> *mut glib::GVariant; pub fn g_dbus_message_get_byte_order(message: *mut GDBusMessage) -> GDBusMessageByteOrder; pub fn g_dbus_message_get_destination(message: *mut GDBusMessage) -> *const c_char; @@ -12802,6 +12852,14 @@ extern "C" { pub fn g_resolver_free_addresses(addresses: *mut glib::GList); pub fn g_resolver_free_targets(targets: *mut glib::GList); pub fn g_resolver_get_default() -> *mut GResolver; + pub fn g_resolver_records_from_res_query( + rrname: *const c_char, + rrtype: c_int, + answer: *const u8, + len: ssize_t, + herr: c_int, + error: *mut *mut glib::GError, + ) -> *mut glib::GList; #[cfg(feature = "v2_78")] #[cfg_attr(docsrs, doc(cfg(feature = "v2_78")))] pub fn g_resolver_get_timeout(resolver: *mut GResolver) -> c_uint; @@ -13410,6 +13468,25 @@ extern "C" { cancellable: *mut GCancellable, error: *mut *mut glib::GError, ) -> ssize_t; + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + pub fn g_socket_receive_bytes( + socket: *mut GSocket, + size: size_t, + timeout_us: i64, + cancellable: *mut GCancellable, + error: *mut *mut glib::GError, + ) -> *mut glib::GBytes; + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + pub fn g_socket_receive_bytes_from( + socket: *mut GSocket, + address: *mut *mut GSocketAddress, + size: size_t, + timeout_us: i64, + cancellable: *mut GCancellable, + error: *mut *mut glib::GError, + ) -> *mut glib::GBytes; pub fn g_socket_receive_from( socket: *mut GSocket, address: *mut *mut GSocketAddress, @@ -14073,11 +14150,27 @@ extern "C" { format: *const c_char, ... ); + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + pub fn g_task_return_new_error_literal( + task: *mut GTask, + domain: glib::GQuark, + code: c_int, + message: *const c_char, + ); pub fn g_task_return_pointer( task: *mut GTask, result: gpointer, result_destroy: glib::GDestroyNotify, ); + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + pub fn g_task_return_prefixed_error( + task: *mut GTask, + error: *mut glib::GError, + format: *const c_char, + ... + ); #[cfg(feature = "v2_64")] #[cfg_attr(docsrs, doc(cfg(feature = "v2_64")))] pub fn g_task_return_value(task: *mut GTask, result: *mut gobject::GValue); @@ -14148,6 +14241,11 @@ extern "C" { pub fn g_themed_icon_get_names(icon: *mut GThemedIcon) -> *const *const c_char; pub fn g_themed_icon_prepend_name(icon: *mut GThemedIcon, iconname: *const c_char); + //========================================================================= + // GThreadedResolver + //========================================================================= + pub fn g_threaded_resolver_get_type() -> GType; + //========================================================================= // GThreadedSocketService //========================================================================= diff --git a/gio/sys/tests/abi.rs b/gio/sys/tests/abi.rs index b850ea16184d..ae6c44559807 100644 --- a/gio/sys/tests/abi.rs +++ b/gio/sys/tests/abi.rs @@ -1895,6 +1895,13 @@ const RUST_LAYOUTS: &[(&str, Layout)] = &[ alignment: align_of::(), }, ), + ( + "GThreadedResolverClass", + Layout { + size: size_of::(), + alignment: align_of::(), + }, + ), ( "GThreadedSocketService", Layout { @@ -2708,6 +2715,7 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[ ("(guint) G_FILE_COPY_NONE", "0"), ("(guint) G_FILE_COPY_NO_FALLBACK_FOR_MOVE", "16"), ("(guint) G_FILE_COPY_OVERWRITE", "1"), + ("(guint) G_FILE_COPY_TARGET_DEFAULT_MODIFIED_TIME", "64"), ("(guint) G_FILE_COPY_TARGET_DEFAULT_PERMS", "32"), ("(guint) G_FILE_CREATE_NONE", "0"), ("(guint) G_FILE_CREATE_PRIVATE", "1"), @@ -2751,6 +2759,7 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[ ("(gint) G_IO_ERROR_CONNECTION_CLOSED", "44"), ("(gint) G_IO_ERROR_CONNECTION_REFUSED", "39"), ("(gint) G_IO_ERROR_DBUS_ERROR", "36"), + ("(gint) G_IO_ERROR_DESTINATION_UNSET", "48"), ("(gint) G_IO_ERROR_EXISTS", "2"), ("(gint) G_IO_ERROR_FAILED", "0"), ("(gint) G_IO_ERROR_FAILED_HANDLED", "30"), diff --git a/gio/sys/tests/constant.c b/gio/sys/tests/constant.c index 8b47edec2b45..5a013929b96c 100644 --- a/gio/sys/tests/constant.c +++ b/gio/sys/tests/constant.c @@ -325,6 +325,7 @@ int main() { PRINT_CONSTANT((guint) G_FILE_COPY_NONE); PRINT_CONSTANT((guint) G_FILE_COPY_NO_FALLBACK_FOR_MOVE); PRINT_CONSTANT((guint) G_FILE_COPY_OVERWRITE); + PRINT_CONSTANT((guint) G_FILE_COPY_TARGET_DEFAULT_MODIFIED_TIME); PRINT_CONSTANT((guint) G_FILE_COPY_TARGET_DEFAULT_PERMS); PRINT_CONSTANT((guint) G_FILE_CREATE_NONE); PRINT_CONSTANT((guint) G_FILE_CREATE_PRIVATE); @@ -368,6 +369,7 @@ int main() { PRINT_CONSTANT((gint) G_IO_ERROR_CONNECTION_CLOSED); PRINT_CONSTANT((gint) G_IO_ERROR_CONNECTION_REFUSED); PRINT_CONSTANT((gint) G_IO_ERROR_DBUS_ERROR); + PRINT_CONSTANT((gint) G_IO_ERROR_DESTINATION_UNSET); PRINT_CONSTANT((gint) G_IO_ERROR_EXISTS); PRINT_CONSTANT((gint) G_IO_ERROR_FAILED); PRINT_CONSTANT((gint) G_IO_ERROR_FAILED_HANDLED); diff --git a/gio/sys/tests/layout.c b/gio/sys/tests/layout.c index 6f6a95ad4ced..98ede29efacd 100644 --- a/gio/sys/tests/layout.c +++ b/gio/sys/tests/layout.c @@ -249,6 +249,7 @@ int main() { printf("%s;%zu;%zu\n", "GTcpWrapperConnection", sizeof(GTcpWrapperConnection), alignof(GTcpWrapperConnection)); printf("%s;%zu;%zu\n", "GTcpWrapperConnectionClass", sizeof(GTcpWrapperConnectionClass), alignof(GTcpWrapperConnectionClass)); printf("%s;%zu;%zu\n", "GTestDBusFlags", sizeof(GTestDBusFlags), alignof(GTestDBusFlags)); + printf("%s;%zu;%zu\n", "GThreadedResolverClass", sizeof(GThreadedResolverClass), alignof(GThreadedResolverClass)); printf("%s;%zu;%zu\n", "GThreadedSocketService", sizeof(GThreadedSocketService), alignof(GThreadedSocketService)); printf("%s;%zu;%zu\n", "GThreadedSocketServiceClass", sizeof(GThreadedSocketServiceClass), alignof(GThreadedSocketServiceClass)); printf("%s;%zu;%zu\n", "GTlsAuthenticationMode", sizeof(GTlsAuthenticationMode), alignof(GTlsAuthenticationMode)); diff --git a/gio/sys/versions.txt b/gio/sys/versions.txt index 511eac1e7f3c..2b08b0af6393 100644 --- a/gio/sys/versions.txt +++ b/gio/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ a2f936b77195) -from gir-files (https://github.com/gtk-rs/gir-files @ 20031a537e40) +Generated by gir (https://github.com/gtk-rs/gir @ 1c7a6b57a5fc) +from gir-files (https://github.com/gtk-rs/gir-files @ 21b29d0e0c1a) diff --git a/glib/gobject-sys/Cargo.toml b/glib/gobject-sys/Cargo.toml index bf707ef3a3d1..ca25557a932c 100644 --- a/glib/gobject-sys/Cargo.toml +++ b/glib/gobject-sys/Cargo.toml @@ -22,6 +22,7 @@ v2_72 = ["v2_70"] v2_74 = ["v2_72"] v2_76 = ["v2_74"] v2_78 = ["v2_74"] +v2_80 = ["v2_78"] [lib] name = "gobject_sys" @@ -70,6 +71,9 @@ version = "2.76" [package.metadata.system-deps.gobject_2_0.v2_78] version = "2.77" +[package.metadata.system-deps.gobject_2_0.v2_80] +version = "2.80" + [package.metadata.docs.rs] rustc-args = ["--cfg", "docsrs"] rustdoc-args = ["--cfg", "docsrs", "--generate-link-to-definition"] diff --git a/glib/gobject-sys/src/lib.rs b/glib/gobject-sys/src/lib.rs index b6e648034548..edc502d38ea8 100644 --- a/glib/gobject-sys/src/lib.rs +++ b/glib/gobject-sys/src/lib.rs @@ -53,13 +53,14 @@ pub const G_PARAM_USER_SHIFT: c_int = 8; pub const G_SIGNAL_FLAGS_MASK: c_int = 511; pub const G_SIGNAL_MATCH_MASK: c_int = 63; pub const G_TYPE_FLAG_RESERVED_ID_BIT: GType = 1; -pub const G_TYPE_FUNDAMENTAL_MAX: c_int = 255; +pub const G_TYPE_FUNDAMENTAL_MAX: c_int = 1020; pub const G_TYPE_FUNDAMENTAL_SHIFT: c_int = 2; pub const G_TYPE_RESERVED_BSE_FIRST: c_int = 32; pub const G_TYPE_RESERVED_BSE_LAST: c_int = 48; pub const G_TYPE_RESERVED_GLIB_FIRST: c_int = 22; pub const G_TYPE_RESERVED_GLIB_LAST: c_int = 31; pub const G_TYPE_RESERVED_USER_FIRST: c_int = 49; +pub const G_VALUE_COLLECT_FORMAT_MAX_LENGTH: c_int = 8; pub const G_VALUE_INTERNED_STRING: c_int = 268435456; pub const G_VALUE_NOCOPY_CONTENTS: c_int = 134217728; @@ -75,6 +76,14 @@ pub const G_CONNECT_DEFAULT: GConnectFlags = 0; pub const G_CONNECT_AFTER: GConnectFlags = 1; pub const G_CONNECT_SWAPPED: GConnectFlags = 2; +pub type GIOCondition = c_uint; +pub const G_IO_IN: GIOCondition = 1; +pub const G_IO_OUT: GIOCondition = 4; +pub const G_IO_PRI: GIOCondition = 2; +pub const G_IO_ERR: GIOCondition = 8; +pub const G_IO_HUP: GIOCondition = 16; +pub const G_IO_NVAL: GIOCondition = 32; + pub type GParamFlags = c_uint; pub const G_PARAM_READABLE: GParamFlags = 1; pub const G_PARAM_WRITABLE: GParamFlags = 2; @@ -130,15 +139,25 @@ pub const G_TYPE_FLAG_DERIVABLE: GTypeFundamentalFlags = 4; pub const G_TYPE_FLAG_DEEP_DERIVABLE: GTypeFundamentalFlags = 8; // Unions +#[derive(Copy, Clone)] #[repr(C)] -pub struct GTypeCValue { - _data: [u8; 0], - _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, +pub union GTypeCValue { + pub v_int: c_int, + pub v_long: c_long, + pub v_int64: i64, + pub v_double: c_double, + pub v_pointer: gpointer, } impl ::std::fmt::Debug for GTypeCValue { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - f.debug_struct(&format!("GTypeCValue @ {self:p}")).finish() + f.debug_struct(&format!("GTypeCValue @ {self:p}")) + .field("v_int", unsafe { &self.v_int }) + .field("v_long", unsafe { &self.v_long }) + .field("v_int64", unsafe { &self.v_int64 }) + .field("v_double", unsafe { &self.v_double }) + .field("v_pointer", unsafe { &self.v_pointer }) + .finish() } } @@ -514,7 +533,7 @@ pub struct _GParamSpecPool { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GParamSpecPool = *mut _GParamSpecPool; +pub type GParamSpecPool = _GParamSpecPool; #[derive(Copy, Clone)] #[repr(C)] @@ -1391,6 +1410,11 @@ extern "C" { //========================================================================= pub fn g_binding_flags_get_type() -> GType; + //========================================================================= + // GIOCondition + //========================================================================= + pub fn g_io_condition_get_type() -> GType; + //========================================================================= // GCClosure //========================================================================= @@ -1698,6 +1722,9 @@ extern "C" { //========================================================================= // GParamSpecPool //========================================================================= + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + pub fn g_param_spec_pool_free(pool: *mut GParamSpecPool); pub fn g_param_spec_pool_insert( pool: *mut GParamSpecPool, pspec: *mut GParamSpec, @@ -1836,6 +1863,9 @@ extern "C" { pub fn g_value_set_uint64(value: *mut GValue, v_uint64: u64); pub fn g_value_set_ulong(value: *mut GValue, v_ulong: c_ulong); pub fn g_value_set_variant(value: *mut GValue, variant: *mut glib::GVariant); + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + pub fn g_value_steal_string(value: *mut GValue) -> *mut c_char; pub fn g_value_take_boxed(value: *mut GValue, v_boxed: gconstpointer); pub fn g_value_take_object(value: *mut GValue, v_object: gpointer); pub fn g_value_take_param(value: *mut GValue, param: *mut GParamSpec); @@ -2704,8 +2734,6 @@ extern "C" { pub fn g_signal_stop_emission(instance: *mut GObject, signal_id: c_uint, detail: glib::GQuark); pub fn g_signal_stop_emission_by_name(instance: *mut GObject, detailed_signal: *const c_char); pub fn g_signal_type_cclosure_new(itype: GType, struct_offset: c_uint) -> *mut GClosure; - pub fn g_source_set_closure(source: *mut glib::GSource, closure: *mut GClosure); - pub fn g_source_set_dummy_callback(source: *mut glib::GSource); pub fn g_strdup_value_contents(value: *const GValue) -> *mut c_char; pub fn g_type_add_class_cache_func(cache_data: gpointer, cache_func: GTypeClassCacheFunc); pub fn g_type_add_class_private(class_type: GType, private_size: size_t); @@ -2794,5 +2822,6 @@ extern "C" { pub fn g_type_remove_interface_check(check_data: gpointer, check_func: GTypeInterfaceCheckFunc); pub fn g_type_set_qdata(type_: GType, quark: glib::GQuark, data: gpointer); pub fn g_type_test_flags(type_: GType, flags: c_uint) -> gboolean; + pub fn g_variant_get_gtype() -> GType; } diff --git a/glib/gobject-sys/tests/abi.rs b/glib/gobject-sys/tests/abi.rs index cdda3dd9dc88..db68c468caff 100644 --- a/glib/gobject-sys/tests/abi.rs +++ b/glib/gobject-sys/tests/abi.rs @@ -250,6 +250,13 @@ const RUST_LAYOUTS: &[(&str, Layout)] = &[ alignment: align_of::(), }, ), + ( + "GIOCondition", + Layout { + size: size_of::(), + alignment: align_of::(), + }, + ), ( "GInitiallyUnowned", Layout { @@ -516,6 +523,13 @@ const RUST_LAYOUTS: &[(&str, Layout)] = &[ alignment: align_of::(), }, ), + ( + "GTypeCValue", + Layout { + size: size_of::(), + alignment: align_of::(), + }, + ), ( "GTypeClass", Layout { @@ -638,6 +652,12 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[ ("(guint) G_CONNECT_AFTER", "1"), ("(guint) G_CONNECT_DEFAULT", "0"), ("(guint) G_CONNECT_SWAPPED", "2"), + ("(guint) G_IO_ERR", "8"), + ("(guint) G_IO_HUP", "16"), + ("(guint) G_IO_IN", "1"), + ("(guint) G_IO_NVAL", "32"), + ("(guint) G_IO_OUT", "4"), + ("(guint) G_IO_PRI", "2"), ("(guint) G_PARAM_CONSTRUCT", "4"), ("(guint) G_PARAM_CONSTRUCT_ONLY", "8"), ("(guint) G_PARAM_DEPRECATED", "2147483648"), @@ -686,13 +706,14 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[ ("(guint) G_TYPE_FLAG_NONE", "0"), ("G_TYPE_FLAG_RESERVED_ID_BIT", "1"), ("(guint) G_TYPE_FLAG_VALUE_ABSTRACT", "32"), - ("G_TYPE_FUNDAMENTAL_MAX", "255"), + ("G_TYPE_FUNDAMENTAL_MAX", "1020"), ("G_TYPE_FUNDAMENTAL_SHIFT", "2"), ("G_TYPE_RESERVED_BSE_FIRST", "32"), ("G_TYPE_RESERVED_BSE_LAST", "48"), ("G_TYPE_RESERVED_GLIB_FIRST", "22"), ("G_TYPE_RESERVED_GLIB_LAST", "31"), ("G_TYPE_RESERVED_USER_FIRST", "49"), + ("G_VALUE_COLLECT_FORMAT_MAX_LENGTH", "8"), ("G_VALUE_INTERNED_STRING", "268435456"), ("G_VALUE_NOCOPY_CONTENTS", "134217728"), ]; diff --git a/glib/gobject-sys/tests/constant.c b/glib/gobject-sys/tests/constant.c index 19ffa724fb77..89e383736dd9 100644 --- a/glib/gobject-sys/tests/constant.c +++ b/glib/gobject-sys/tests/constant.c @@ -35,6 +35,12 @@ int main() { PRINT_CONSTANT((guint) G_CONNECT_AFTER); PRINT_CONSTANT((guint) G_CONNECT_DEFAULT); PRINT_CONSTANT((guint) G_CONNECT_SWAPPED); + PRINT_CONSTANT((guint) G_IO_ERR); + PRINT_CONSTANT((guint) G_IO_HUP); + PRINT_CONSTANT((guint) G_IO_IN); + PRINT_CONSTANT((guint) G_IO_NVAL); + PRINT_CONSTANT((guint) G_IO_OUT); + PRINT_CONSTANT((guint) G_IO_PRI); PRINT_CONSTANT((guint) G_PARAM_CONSTRUCT); PRINT_CONSTANT((guint) G_PARAM_CONSTRUCT_ONLY); PRINT_CONSTANT((guint) G_PARAM_DEPRECATED); @@ -90,6 +96,7 @@ int main() { PRINT_CONSTANT(G_TYPE_RESERVED_GLIB_FIRST); PRINT_CONSTANT(G_TYPE_RESERVED_GLIB_LAST); PRINT_CONSTANT(G_TYPE_RESERVED_USER_FIRST); + PRINT_CONSTANT(G_VALUE_COLLECT_FORMAT_MAX_LENGTH); PRINT_CONSTANT(G_VALUE_INTERNED_STRING); PRINT_CONSTANT(G_VALUE_NOCOPY_CONTENTS); return 0; diff --git a/glib/gobject-sys/tests/layout.c b/glib/gobject-sys/tests/layout.c index 528e56993792..67f5bc515532 100644 --- a/glib/gobject-sys/tests/layout.c +++ b/glib/gobject-sys/tests/layout.c @@ -14,6 +14,7 @@ int main() { printf("%s;%zu;%zu\n", "GEnumValue", sizeof(GEnumValue), alignof(GEnumValue)); printf("%s;%zu;%zu\n", "GFlagsClass", sizeof(GFlagsClass), alignof(GFlagsClass)); printf("%s;%zu;%zu\n", "GFlagsValue", sizeof(GFlagsValue), alignof(GFlagsValue)); + printf("%s;%zu;%zu\n", "GIOCondition", sizeof(GIOCondition), alignof(GIOCondition)); printf("%s;%zu;%zu\n", "GInitiallyUnowned", sizeof(GInitiallyUnowned), alignof(GInitiallyUnowned)); printf("%s;%zu;%zu\n", "GInitiallyUnownedClass", sizeof(GInitiallyUnownedClass), alignof(GInitiallyUnownedClass)); printf("%s;%zu;%zu\n", "GInterfaceInfo", sizeof(GInterfaceInfo), alignof(GInterfaceInfo)); @@ -52,6 +53,7 @@ int main() { printf("%s;%zu;%zu\n", "GSignalInvocationHint", sizeof(GSignalInvocationHint), alignof(GSignalInvocationHint)); printf("%s;%zu;%zu\n", "GSignalMatchType", sizeof(GSignalMatchType), alignof(GSignalMatchType)); printf("%s;%zu;%zu\n", "GSignalQuery", sizeof(GSignalQuery), alignof(GSignalQuery)); + printf("%s;%zu;%zu\n", "GTypeCValue", sizeof(GTypeCValue), alignof(GTypeCValue)); printf("%s;%zu;%zu\n", "GTypeClass", sizeof(GTypeClass), alignof(GTypeClass)); printf("%s;%zu;%zu\n", "GTypeDebugFlags", sizeof(GTypeDebugFlags), alignof(GTypeDebugFlags)); printf("%s;%zu;%zu\n", "GTypeFlags", sizeof(GTypeFlags), alignof(GTypeFlags)); diff --git a/glib/gobject-sys/versions.txt b/glib/gobject-sys/versions.txt index 511eac1e7f3c..2b08b0af6393 100644 --- a/glib/gobject-sys/versions.txt +++ b/glib/gobject-sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ a2f936b77195) -from gir-files (https://github.com/gtk-rs/gir-files @ 20031a537e40) +Generated by gir (https://github.com/gtk-rs/gir @ 1c7a6b57a5fc) +from gir-files (https://github.com/gtk-rs/gir-files @ 21b29d0e0c1a) diff --git a/glib/src/auto/date_time.rs b/glib/src/auto/date_time.rs index 6281dd9bdbdd..a23362b85d5e 100644 --- a/glib/src/auto/date_time.rs +++ b/glib/src/auto/date_time.rs @@ -77,6 +77,17 @@ impl DateTime { } } + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + #[doc(alias = "g_date_time_new_from_unix_local_usec")] + #[doc(alias = "new_from_unix_local_usec")] + pub fn from_unix_local_usec(usecs: i64) -> Result { + unsafe { + Option::<_>::from_glib_full(ffi::g_date_time_new_from_unix_local_usec(usecs)) + .ok_or_else(|| crate::bool_error!("Invalid date")) + } + } + #[doc(alias = "g_date_time_new_from_unix_utc")] #[doc(alias = "new_from_unix_utc")] pub fn from_unix_utc(t: i64) -> Result { @@ -86,6 +97,17 @@ impl DateTime { } } + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + #[doc(alias = "g_date_time_new_from_unix_utc_usec")] + #[doc(alias = "new_from_unix_utc_usec")] + pub fn from_unix_utc_usec(usecs: i64) -> Result { + unsafe { + Option::<_>::from_glib_full(ffi::g_date_time_new_from_unix_utc_usec(usecs)) + .ok_or_else(|| crate::bool_error!("Invalid date")) + } + } + #[doc(alias = "g_date_time_new_local")] #[doc(alias = "new_local")] pub fn from_local( @@ -455,6 +477,13 @@ impl DateTime { unsafe { ffi::g_date_time_to_unix(self.to_glib_none().0) } } + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + #[doc(alias = "g_date_time_to_unix_usec")] + pub fn to_unix_usec(&self) -> i64 { + unsafe { ffi::g_date_time_to_unix_usec(self.to_glib_none().0) } + } + #[doc(alias = "g_date_time_to_utc")] pub fn to_utc(&self) -> Result { unsafe { diff --git a/glib/src/auto/enums.rs b/glib/src/auto/enums.rs index 036d1b61cd93..6e6a7e45273e 100644 --- a/glib/src/auto/enums.rs +++ b/glib/src/auto/enums.rs @@ -664,6 +664,60 @@ impl FromGlib for NormalizeMode { } } +impl StaticType for NormalizeMode { + #[inline] + #[doc(alias = "g_normalize_mode_get_type")] + fn static_type() -> crate::Type { + unsafe { from_glib(ffi::g_normalize_mode_get_type()) } + } +} + +impl crate::HasParamSpec for NormalizeMode { + type ParamSpec = crate::ParamSpecEnum; + type SetValue = Self; + type BuilderFn = fn(&str, Self) -> crate::ParamSpecEnumBuilder; + + fn param_spec_builder() -> Self::BuilderFn { + Self::ParamSpec::builder_with_default + } +} + +impl crate::value::ValueType for NormalizeMode { + type Type = Self; +} + +unsafe impl<'a> crate::value::FromValue<'a> for NormalizeMode { + type Checker = crate::value::GenericValueTypeChecker; + + #[inline] + unsafe fn from_value(value: &'a crate::Value) -> Self { + from_glib(crate::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) + } +} + +impl ToValue for NormalizeMode { + #[inline] + fn to_value(&self) -> crate::Value { + let mut value = crate::Value::for_value_type::(); + unsafe { + crate::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); + } + value + } + + #[inline] + fn value_type(&self) -> crate::Type { + Self::static_type() + } +} + +impl From for crate::Value { + #[inline] + fn from(v: NormalizeMode) -> Self { + ToValue::to_value(&v) + } +} + #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "GOptionArg")] @@ -904,6 +958,16 @@ pub enum UnicodeBreakType { EmojiModifier, #[doc(alias = "G_UNICODE_BREAK_ZERO_WIDTH_JOINER")] ZeroWidthJoiner, + #[doc(alias = "G_UNICODE_BREAK_AKSARA")] + Aksara, + #[doc(alias = "G_UNICODE_BREAK_AKSARA_PRE_BASE")] + AksaraPreBase, + #[doc(alias = "G_UNICODE_BREAK_AKSARA_START")] + AksaraStart, + #[doc(alias = "G_UNICODE_BREAK_VIRAMA_FINAL")] + ViramaFinal, + #[doc(alias = "G_UNICODE_BREAK_VIRAMA")] + Virama, #[doc(hidden)] __Unknown(i32), } @@ -957,6 +1021,11 @@ impl IntoGlib for UnicodeBreakType { Self::EmojiBase => ffi::G_UNICODE_BREAK_EMOJI_BASE, Self::EmojiModifier => ffi::G_UNICODE_BREAK_EMOJI_MODIFIER, Self::ZeroWidthJoiner => ffi::G_UNICODE_BREAK_ZERO_WIDTH_JOINER, + Self::Aksara => ffi::G_UNICODE_BREAK_AKSARA, + Self::AksaraPreBase => ffi::G_UNICODE_BREAK_AKSARA_PRE_BASE, + Self::AksaraStart => ffi::G_UNICODE_BREAK_AKSARA_START, + Self::ViramaFinal => ffi::G_UNICODE_BREAK_VIRAMA_FINAL, + Self::Virama => ffi::G_UNICODE_BREAK_VIRAMA, Self::__Unknown(value) => value, } } @@ -1009,11 +1078,70 @@ impl FromGlib for UnicodeBreakType { ffi::G_UNICODE_BREAK_EMOJI_BASE => Self::EmojiBase, ffi::G_UNICODE_BREAK_EMOJI_MODIFIER => Self::EmojiModifier, ffi::G_UNICODE_BREAK_ZERO_WIDTH_JOINER => Self::ZeroWidthJoiner, + ffi::G_UNICODE_BREAK_AKSARA => Self::Aksara, + ffi::G_UNICODE_BREAK_AKSARA_PRE_BASE => Self::AksaraPreBase, + ffi::G_UNICODE_BREAK_AKSARA_START => Self::AksaraStart, + ffi::G_UNICODE_BREAK_VIRAMA_FINAL => Self::ViramaFinal, + ffi::G_UNICODE_BREAK_VIRAMA => Self::Virama, value => Self::__Unknown(value), } } } +impl StaticType for UnicodeBreakType { + #[inline] + #[doc(alias = "g_unicode_break_type_get_type")] + fn static_type() -> crate::Type { + unsafe { from_glib(ffi::g_unicode_break_type_get_type()) } + } +} + +impl crate::HasParamSpec for UnicodeBreakType { + type ParamSpec = crate::ParamSpecEnum; + type SetValue = Self; + type BuilderFn = fn(&str, Self) -> crate::ParamSpecEnumBuilder; + + fn param_spec_builder() -> Self::BuilderFn { + Self::ParamSpec::builder_with_default + } +} + +impl crate::value::ValueType for UnicodeBreakType { + type Type = Self; +} + +unsafe impl<'a> crate::value::FromValue<'a> for UnicodeBreakType { + type Checker = crate::value::GenericValueTypeChecker; + + #[inline] + unsafe fn from_value(value: &'a crate::Value) -> Self { + from_glib(crate::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) + } +} + +impl ToValue for UnicodeBreakType { + #[inline] + fn to_value(&self) -> crate::Value { + let mut value = crate::Value::for_value_type::(); + unsafe { + crate::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); + } + value + } + + #[inline] + fn value_type(&self) -> crate::Type { + Self::static_type() + } +} + +impl From for crate::Value { + #[inline] + fn from(v: UnicodeBreakType) -> Self { + ToValue::to_value(&v) + } +} + #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "GUnicodeScript")] @@ -1370,6 +1498,18 @@ pub enum UnicodeScript { __Unknown(i32), } +impl UnicodeScript { + #[doc(alias = "g_unicode_script_from_iso15924")] + pub fn from_iso15924(iso15924: u32) -> UnicodeScript { + unsafe { from_glib(ffi::g_unicode_script_from_iso15924(iso15924)) } + } + + #[doc(alias = "g_unicode_script_to_iso15924")] + pub fn to_iso15924(self) -> u32 { + unsafe { ffi::g_unicode_script_to_iso15924(self.into_glib()) } + } +} + #[doc(hidden)] impl IntoGlib for UnicodeScript { type GlibType = ffi::GUnicodeScript; @@ -1738,6 +1878,60 @@ impl FromGlib for UnicodeScript { } } +impl StaticType for UnicodeScript { + #[inline] + #[doc(alias = "g_unicode_script_get_type")] + fn static_type() -> crate::Type { + unsafe { from_glib(ffi::g_unicode_script_get_type()) } + } +} + +impl crate::HasParamSpec for UnicodeScript { + type ParamSpec = crate::ParamSpecEnum; + type SetValue = Self; + type BuilderFn = fn(&str, Self) -> crate::ParamSpecEnumBuilder; + + fn param_spec_builder() -> Self::BuilderFn { + Self::ParamSpec::builder_with_default + } +} + +impl crate::value::ValueType for UnicodeScript { + type Type = Self; +} + +unsafe impl<'a> crate::value::FromValue<'a> for UnicodeScript { + type Checker = crate::value::GenericValueTypeChecker; + + #[inline] + unsafe fn from_value(value: &'a crate::Value) -> Self { + from_glib(crate::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) + } +} + +impl ToValue for UnicodeScript { + #[inline] + fn to_value(&self) -> crate::Value { + let mut value = crate::Value::for_value_type::(); + unsafe { + crate::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); + } + value + } + + #[inline] + fn value_type(&self) -> crate::Type { + Self::static_type() + } +} + +impl From for crate::Value { + #[inline] + fn from(v: UnicodeScript) -> Self { + ToValue::to_value(&v) + } +} + #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "GUnicodeType")] @@ -1886,6 +2080,60 @@ impl FromGlib for UnicodeType { } } +impl StaticType for UnicodeType { + #[inline] + #[doc(alias = "g_unicode_type_get_type")] + fn static_type() -> crate::Type { + unsafe { from_glib(ffi::g_unicode_type_get_type()) } + } +} + +impl crate::HasParamSpec for UnicodeType { + type ParamSpec = crate::ParamSpecEnum; + type SetValue = Self; + type BuilderFn = fn(&str, Self) -> crate::ParamSpecEnumBuilder; + + fn param_spec_builder() -> Self::BuilderFn { + Self::ParamSpec::builder_with_default + } +} + +impl crate::value::ValueType for UnicodeType { + type Type = Self; +} + +unsafe impl<'a> crate::value::FromValue<'a> for UnicodeType { + type Checker = crate::value::GenericValueTypeChecker; + + #[inline] + unsafe fn from_value(value: &'a crate::Value) -> Self { + from_glib(crate::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) + } +} + +impl ToValue for UnicodeType { + #[inline] + fn to_value(&self) -> crate::Value { + let mut value = crate::Value::for_value_type::(); + unsafe { + crate::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); + } + value + } + + #[inline] + fn value_type(&self) -> crate::Type { + Self::static_type() + } +} + +impl From for crate::Value { + #[inline] + fn from(v: UnicodeType) -> Self { + ToValue::to_value(&v) + } +} + #[cfg(feature = "v2_66")] #[cfg_attr(docsrs, doc(cfg(feature = "v2_66")))] #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] diff --git a/glib/src/auto/functions.rs b/glib/src/auto/functions.rs index ae819b6236ee..ef9aed618b68 100644 --- a/glib/src/auto/functions.rs +++ b/glib/src/auto/functions.rs @@ -7,7 +7,7 @@ use crate::FileSetContentsFlags; use crate::{ translate::*, Bytes, ChecksumType, Error, FileTest, FormatSizeFlags, Pid, Source, SpawnFlags, - UnicodeScript, UserDirectory, + UserDirectory, }; use std::boxed::Box as Box_; @@ -54,6 +54,13 @@ pub fn base64_encode(data: &[u8]) -> crate::GString { // unsafe { TODO: call ffi:g_base64_encode_step() } //} +#[doc(alias = "g_blow_chunks")] +pub fn blow_chunks() { + unsafe { + ffi::g_blow_chunks(); + } +} + #[doc(alias = "glib_check_version")] pub fn check_version( required_major: u32, @@ -69,6 +76,11 @@ pub fn check_version( } } +#[doc(alias = "g_chmod")] +pub fn chmod(filename: impl AsRef, mode: i32) -> i32 { + unsafe { ffi::g_chmod(filename.as_ref().to_glib_none().0, mode) } +} + #[doc(alias = "g_compute_checksum_for_bytes")] pub fn compute_checksum_for_bytes( checksum_type: ChecksumType, @@ -127,6 +139,11 @@ pub fn compute_hmac_for_data(digest_type: ChecksumType, key: &[u8], data: &[u8]) } } +#[doc(alias = "g_creat")] +pub fn creat(filename: impl AsRef, mode: i32) -> i32 { + unsafe { ffi::g_creat(filename.as_ref().to_glib_none().0, mode) } +} + #[doc(alias = "g_dcgettext")] pub fn dcgettext(domain: Option<&str>, msgid: &str, category: i32) -> crate::GString { unsafe { @@ -313,6 +330,11 @@ pub fn find_program_in_path(program: impl AsRef) -> Option, mode: &str) -> /*Unimplemented*/Option { +// unsafe { TODO: call ffi:g_fopen() } +//} + #[doc(alias = "g_format_size")] pub fn format_size(size: u64) -> crate::GString { unsafe { from_glib_full(ffi::g_format_size(size)) } @@ -323,6 +345,18 @@ pub fn format_size_full(size: u64, flags: FormatSizeFlags) -> crate::GString { unsafe { from_glib_full(ffi::g_format_size_full(size, flags.into_glib())) } } +//#[doc(alias = "g_freopen")] +//pub fn freopen(filename: impl AsRef, mode: &str, stream: /*Unimplemented*/Option) -> /*Unimplemented*/Option { +// unsafe { TODO: call ffi:g_freopen() } +//} + +#[cfg(feature = "v2_64")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2_64")))] +#[doc(alias = "g_fsync")] +pub fn fsync(fd: i32) -> i32 { + unsafe { ffi::g_fsync(fd) } +} + #[doc(alias = "g_get_application_name")] #[doc(alias = "get_application_name")] pub fn application_name() -> Option { @@ -530,6 +564,11 @@ pub fn listenv() -> Vec { unsafe { FromGlibPtrContainer::from_glib_full(ffi::g_listenv()) } } +//#[doc(alias = "g_lstat")] +//pub fn lstat(filename: impl AsRef, buf: /*Ignored*/&mut StatBuf) -> i32 { +// unsafe { TODO: call ffi:g_lstat() } +//} + #[doc(alias = "g_main_current_source")] pub fn main_current_source() -> Option { unsafe { from_glib_none(ffi::g_main_current_source()) } @@ -546,6 +585,11 @@ pub fn markup_escape_text(text: &str) -> crate::GString { unsafe { from_glib_full(ffi::g_markup_escape_text(text.to_glib_none().0, length)) } } +#[doc(alias = "g_mkdir")] +pub fn mkdir(filename: impl AsRef, mode: i32) -> i32 { + unsafe { ffi::g_mkdir(filename.as_ref().to_glib_none().0, mode) } +} + #[doc(alias = "g_mkdir_with_parents")] pub fn mkdir_with_parents(pathname: impl AsRef, mode: i32) -> i32 { unsafe { ffi::g_mkdir_with_parents(pathname.as_ref().to_glib_none().0, mode) } @@ -565,6 +609,11 @@ pub fn on_error_stack_trace(prg_name: &str) { } } +#[doc(alias = "g_open")] +pub fn open(filename: impl AsRef, flags: i32, mode: i32) -> i32 { + unsafe { ffi::g_open(filename.as_ref().to_glib_none().0, flags, mode) } +} + #[doc(alias = "g_path_get_basename")] #[allow(dead_code)] pub(crate) fn path_get_basename(file_name: impl AsRef) -> std::path::PathBuf { @@ -620,6 +669,24 @@ pub fn reload_user_special_dirs_cache() { } } +#[doc(alias = "g_remove")] +pub fn remove(filename: impl AsRef) -> i32 { + unsafe { ffi::g_remove(filename.as_ref().to_glib_none().0) } +} + +#[doc(alias = "g_rename")] +pub fn rename( + oldfilename: impl AsRef, + newfilename: impl AsRef, +) -> i32 { + unsafe { + ffi::g_rename( + oldfilename.as_ref().to_glib_none().0, + newfilename.as_ref().to_glib_none().0, + ) + } +} + #[doc(alias = "g_set_application_name")] pub fn set_application_name(application_name: &str) { unsafe { @@ -627,6 +694,16 @@ pub fn set_application_name(application_name: &str) { } } +#[doc(alias = "g_set_prgname_once")] +pub fn set_prgname_once(prgname: &str) -> bool { + unsafe { from_glib(ffi::g_set_prgname_once(prgname.to_glib_none().0)) } +} + +//#[doc(alias = "g_set_user_dirs")] +//pub fn set_user_dirs(first_dir_type: &str, : /*Unknown conversion*//*Unimplemented*/Basic: VarArgs) { +// unsafe { TODO: call ffi:g_set_user_dirs() } +//} + #[doc(alias = "g_setenv")] pub fn setenv( variable: impl AsRef, @@ -695,6 +772,13 @@ pub fn shell_unquote( } } +#[doc(alias = "g_slice_debug_tree_statistics")] +pub fn slice_debug_tree_statistics() { + unsafe { + ffi::g_slice_debug_tree_statistics(); + } +} + #[doc(alias = "g_spaced_primes_closest")] pub fn spaced_primes_closest(num: u32) -> u32 { unsafe { ffi::g_spaced_primes_closest(num) } @@ -814,14 +898,32 @@ pub fn spawn_command_line_async( // unsafe { TODO: call ffi:g_spawn_sync() } //} -#[doc(alias = "g_unicode_script_from_iso15924")] -pub fn unicode_script_from_iso15924(iso15924: u32) -> UnicodeScript { - unsafe { from_glib(ffi::g_unicode_script_from_iso15924(iso15924)) } +//#[doc(alias = "g_stat")] +//pub fn stat(filename: impl AsRef, buf: /*Ignored*/&mut StatBuf) -> i32 { +// unsafe { TODO: call ffi:g_stat() } +//} + +#[doc(alias = "g_trace_define_int64_counter")] +pub fn trace_define_int64_counter(group: &str, name: &str, description: &str) -> u32 { + unsafe { + ffi::g_trace_define_int64_counter( + group.to_glib_none().0, + name.to_glib_none().0, + description.to_glib_none().0, + ) + } } -#[doc(alias = "g_unicode_script_to_iso15924")] -pub fn unicode_script_to_iso15924(script: UnicodeScript) -> u32 { - unsafe { ffi::g_unicode_script_to_iso15924(script.into_glib()) } +//#[doc(alias = "g_trace_mark")] +//pub fn trace_mark(begin_time_nsec: i64, duration_nsec: i64, group: &str, name: &str, message_format: &str, : /*Unknown conversion*//*Unimplemented*/Basic: VarArgs) { +// unsafe { TODO: call ffi:g_trace_mark() } +//} + +#[doc(alias = "g_trace_set_int64_counter")] +pub fn trace_set_int64_counter(id: u32, value: i64) { + unsafe { + ffi::g_trace_set_int64_counter(id, value); + } } //#[cfg(unix)] @@ -852,6 +954,11 @@ pub fn usleep(microseconds: libc::c_ulong) { } } +//#[doc(alias = "g_utime")] +//pub fn utime(filename: impl AsRef, utb: /*Unimplemented*/Option) -> i32 { +// unsafe { TODO: call ffi:g_utime() } +//} + #[doc(alias = "g_uuid_string_is_valid")] pub fn uuid_string_is_valid(str: &str) -> bool { unsafe { from_glib(ffi::g_uuid_string_is_valid(str.to_glib_none().0)) } @@ -861,3 +968,72 @@ pub fn uuid_string_is_valid(str: &str) -> bool { pub fn uuid_string_random() -> crate::GString { unsafe { from_glib_full(ffi::g_uuid_string_random()) } } + +//#[doc(alias = "g_win32_check_windows_version")] +//pub fn win32_check_windows_version(major: i32, minor: i32, spver: i32, os_type: /*Ignored*/Win32OSType) -> bool { +// unsafe { TODO: call ffi:g_win32_check_windows_version() } +//} + +#[doc(alias = "g_win32_error_message")] +pub fn win32_error_message(error: i32) -> crate::GString { + unsafe { from_glib_full(ffi::g_win32_error_message(error)) } +} + +#[doc(alias = "g_win32_ftruncate")] +pub fn win32_ftruncate(f: i32, size: u32) -> i32 { + unsafe { ffi::g_win32_ftruncate(f, size) } +} + +#[doc(alias = "g_win32_get_command_line")] +pub fn win32_get_command_line() -> Vec { + unsafe { FromGlibPtrContainer::from_glib_none(ffi::g_win32_get_command_line()) } +} + +#[doc(alias = "g_win32_get_package_installation_directory")] +pub fn win32_get_package_installation_directory(package: &str, dll_name: &str) -> crate::GString { + unsafe { + from_glib_full(ffi::g_win32_get_package_installation_directory( + package.to_glib_none().0, + dll_name.to_glib_none().0, + )) + } +} + +//#[doc(alias = "g_win32_get_package_installation_directory_of_module")] +//pub fn win32_get_package_installation_directory_of_module(hmodule: /*Unimplemented*/Option) -> crate::GString { +// unsafe { TODO: call ffi:g_win32_get_package_installation_directory_of_module() } +//} + +#[doc(alias = "g_win32_get_package_installation_subdirectory")] +pub fn win32_get_package_installation_subdirectory( + package: &str, + dll_name: &str, + subdir: &str, +) -> crate::GString { + unsafe { + from_glib_full(ffi::g_win32_get_package_installation_subdirectory( + package.to_glib_none().0, + dll_name.to_glib_none().0, + subdir.to_glib_none().0, + )) + } +} + +#[doc(alias = "g_win32_get_windows_version")] +pub fn win32_get_windows_version() -> u32 { + unsafe { ffi::g_win32_get_windows_version() } +} + +#[doc(alias = "g_win32_getlocale")] +pub fn win32_getlocale() -> crate::GString { + unsafe { from_glib_full(ffi::g_win32_getlocale()) } +} + +#[doc(alias = "g_win32_locale_filename_from_utf8")] +pub fn win32_locale_filename_from_utf8(utf8filename: &str) -> crate::GString { + unsafe { + from_glib_full(ffi::g_win32_locale_filename_from_utf8( + utf8filename.to_glib_none().0, + )) + } +} diff --git a/glib/src/auto/markup_parse_context.rs b/glib/src/auto/markup_parse_context.rs index bfaf48b87711..2d9703e5d5b5 100644 --- a/glib/src/auto/markup_parse_context.rs +++ b/glib/src/auto/markup_parse_context.rs @@ -45,11 +45,15 @@ impl MarkupParseContext { } } - //#[doc(alias = "g_markup_parse_context_get_element_stack")] - //#[doc(alias = "get_element_stack")] - //pub fn element_stack(&self) -> /*Unimplemented*/Vec { - // unsafe { TODO: call ffi:g_markup_parse_context_get_element_stack() } - //} + #[doc(alias = "g_markup_parse_context_get_element_stack")] + #[doc(alias = "get_element_stack")] + pub fn element_stack(&self) -> Vec { + unsafe { + FromGlibPtrContainer::from_glib_none(ffi::g_markup_parse_context_get_element_stack( + self.to_glib_none().0, + )) + } + } #[doc(alias = "g_markup_parse_context_get_position")] #[doc(alias = "get_position")] diff --git a/glib/src/auto/regex.rs b/glib/src/auto/regex.rs index d41ce1f7354b..b24c8d6cf0b9 100644 --- a/glib/src/auto/regex.rs +++ b/glib/src/auto/regex.rs @@ -81,7 +81,7 @@ impl Regex { } //#[doc(alias = "g_regex_replace_eval")] - //pub fn replace_eval(&self, string: &[&str], start_position: i32, match_options: RegexMatchFlags, eval: /*Unimplemented*/Fn(&MatchInfo, /*Ignored*/String) -> bool, user_data: /*Unimplemented*/Option) -> Result { + //pub fn replace_eval(&self, string: &[&str], start_position: i32, match_options: RegexMatchFlags, eval: /*Unimplemented*/FnMut(&MatchInfo, /*Ignored*/String) -> bool, user_data: /*Unimplemented*/Option) -> Result { // unsafe { TODO: call ffi:g_regex_replace_eval() } //} } diff --git a/glib/src/auto/versions.txt b/glib/src/auto/versions.txt index 511eac1e7f3c..2b08b0af6393 100644 --- a/glib/src/auto/versions.txt +++ b/glib/src/auto/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ a2f936b77195) -from gir-files (https://github.com/gtk-rs/gir-files @ 20031a537e40) +Generated by gir (https://github.com/gtk-rs/gir @ 1c7a6b57a5fc) +from gir-files (https://github.com/gtk-rs/gir-files @ 21b29d0e0c1a) diff --git a/glib/sys/Cargo.toml b/glib/sys/Cargo.toml index a64b5fa739a9..c075e97d85ea 100644 --- a/glib/sys/Cargo.toml +++ b/glib/sys/Cargo.toml @@ -20,6 +20,7 @@ v2_72 = ["v2_70"] v2_74 = ["v2_72"] v2_76 = ["v2_74"] v2_78 = ["v2_76"] +v2_80 = ["v2_78"] [lib] name = "glib_sys" @@ -74,6 +75,9 @@ version = "2.76" [package.metadata.system-deps.glib_2_0.v2_78] version = "2.77" +[package.metadata.system-deps.glib_2_0.v2_80] +version = "2.80" + [package.metadata.system-deps.gobject_2_0] name = "gobject-2.0" version = "2.56" diff --git a/glib/sys/src/lib.rs b/glib/sys/src/lib.rs index a38bf05bfa8e..c566077dcee6 100644 --- a/glib/sys/src/lib.rs +++ b/glib/sys/src/lib.rs @@ -41,7 +41,6 @@ pub type GRefString = c_char; pub type GStrv = *mut *mut c_char; pub type GTime = i32; pub type GTimeSpan = i64; -pub type GType = size_t; // Enums pub type GBookmarkFileError = c_int; @@ -344,6 +343,12 @@ pub const G_TEST_RUN_INCOMPLETE: GTestResult = 3; pub type GThreadError = c_int; pub const G_THREAD_ERROR_AGAIN: GThreadError = 0; +pub type GThreadPriority = c_int; +pub const G_THREAD_PRIORITY_LOW: GThreadPriority = 0; +pub const G_THREAD_PRIORITY_NORMAL: GThreadPriority = 1; +pub const G_THREAD_PRIORITY_HIGH: GThreadPriority = 2; +pub const G_THREAD_PRIORITY_URGENT: GThreadPriority = 3; + pub type GTimeType = c_int; pub const G_TIME_TYPE_STANDARD: GTimeType = 0; pub const G_TIME_TYPE_DAYLIGHT: GTimeType = 1; @@ -425,6 +430,11 @@ pub const G_UNICODE_BREAK_REGIONAL_INDICATOR: GUnicodeBreakType = 39; pub const G_UNICODE_BREAK_EMOJI_BASE: GUnicodeBreakType = 40; pub const G_UNICODE_BREAK_EMOJI_MODIFIER: GUnicodeBreakType = 41; pub const G_UNICODE_BREAK_ZERO_WIDTH_JOINER: GUnicodeBreakType = 42; +pub const G_UNICODE_BREAK_AKSARA: GUnicodeBreakType = 43; +pub const G_UNICODE_BREAK_AKSARA_PRE_BASE: GUnicodeBreakType = 44; +pub const G_UNICODE_BREAK_AKSARA_START: GUnicodeBreakType = 45; +pub const G_UNICODE_BREAK_VIRAMA_FINAL: GUnicodeBreakType = 46; +pub const G_UNICODE_BREAK_VIRAMA: GUnicodeBreakType = 47; pub type GUnicodeScript = c_int; pub const G_UNICODE_SCRIPT_INVALID_CODE: GUnicodeScript = -1; @@ -626,6 +636,10 @@ pub const G_UNICODE_LINE_SEPARATOR: GUnicodeType = 27; pub const G_UNICODE_PARAGRAPH_SEPARATOR: GUnicodeType = 28; pub const G_UNICODE_SPACE_SEPARATOR: GUnicodeType = 29; +pub type GUnixPipeEnd = c_int; +pub const G_UNIX_PIPE_END_READ: GUnixPipeEnd = 0; +pub const G_UNIX_PIPE_END_WRITE: GUnixPipeEnd = 1; + pub type GUriError = c_int; pub const G_URI_ERROR_FAILED: GUriError = 0; pub const G_URI_ERROR_BAD_SCHEME: GUriError = 1; @@ -690,7 +704,17 @@ pub const G_VARIANT_PARSE_ERROR_UNTERMINATED_STRING_CONSTANT: GVariantParseError pub const G_VARIANT_PARSE_ERROR_VALUE_EXPECTED: GVariantParseError = 17; pub const G_VARIANT_PARSE_ERROR_RECURSION: GVariantParseError = 18; +pub type GWin32OSType = c_int; +pub const G_WIN32_OS_ANY: GWin32OSType = 0; +pub const G_WIN32_OS_WORKSTATION: GWin32OSType = 1; +pub const G_WIN32_OS_SERVER: GWin32OSType = 2; + // Constants +pub const G_ALLOCATOR_LIST: c_int = 1; +pub const G_ALLOCATOR_NODE: c_int = 3; +pub const G_ALLOCATOR_SLIST: c_int = 2; +pub const G_ALLOC_AND_FREE: c_int = 2; +pub const G_ALLOC_ONLY: c_int = 1; pub const G_ASCII_DTOSTR_BUF_SIZE: c_int = 39; pub const G_ATOMIC_REF_COUNT_INIT: c_int = 1; pub const G_BIG_ENDIAN: c_int = 4321; @@ -763,6 +787,7 @@ pub const G_TIME_SPAN_HOUR: i64 = 3600000000; pub const G_TIME_SPAN_MILLISECOND: i64 = 1000; pub const G_TIME_SPAN_MINUTE: i64 = 60000000; pub const G_TIME_SPAN_SECOND: i64 = 1000000; +pub const G_TRACE_CURRENT_TIME: c_int = 0; pub const G_UNICHAR_MAX_DECOMPOSITION_LENGTH: c_int = 18; pub const G_URI_RESERVED_CHARS_GENERIC_DELIMITERS: &[u8] = b":/?#[]@\0"; pub const G_URI_RESERVED_CHARS_SUBCOMPONENT_DELIMITERS: &[u8] = b"!$&'()*+,;=\0"; @@ -1089,11 +1114,17 @@ impl ::std::fmt::Debug for GVariantDict_u { } // Callbacks +pub type GCacheDestroyFunc = Option; +pub type GCacheDupFunc = Option gpointer>; +pub type GCacheNewFunc = Option gpointer>; pub type GChildWatchFunc = Option; pub type GClearHandleFunc = Option; pub type GCompareDataFunc = Option c_int>; pub type GCompareFunc = Option c_int>; +pub type GCompletionFunc = Option *mut c_char>; +pub type GCompletionStrncmpFunc = + Option c_int>; pub type GCopyFunc = Option gpointer>; pub type GDataForeachFunc = Option; pub type GDestroyNotify = Option; @@ -1166,6 +1197,14 @@ pub type GUnixFDSourceFunc = pub type GVoidFunc = Option; // Records +#[repr(C)] +pub struct _GAllocator { + _data: [u8; 0], + _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, +} + +pub type GAllocator = _GAllocator; + #[derive(Copy, Clone)] #[repr(C)] pub struct GArray { @@ -1188,7 +1227,7 @@ pub struct _GAsyncQueue { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GAsyncQueue = *mut _GAsyncQueue; +pub type GAsyncQueue = _GAsyncQueue; #[repr(C)] pub struct GBookmarkFile { @@ -1231,6 +1270,14 @@ impl ::std::fmt::Debug for GBytes { } } +#[repr(C)] +pub struct _GCache { + _data: [u8; 0], + _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, +} + +pub type GCache = _GCache; + #[repr(C)] pub struct GChecksum { _data: [u8; 0], @@ -1243,6 +1290,28 @@ impl ::std::fmt::Debug for GChecksum { } } +#[derive(Copy, Clone)] +#[repr(C)] +pub struct GCompletion { + pub items: *mut GList, + pub func: GCompletionFunc, + pub prefix: *mut c_char, + pub cache: *mut GList, + pub strncmp_func: GCompletionStrncmpFunc, +} + +impl ::std::fmt::Debug for GCompletion { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + f.debug_struct(&format!("GCompletion @ {self:p}")) + .field("items", &self.items) + .field("func", &self.func) + .field("prefix", &self.prefix) + .field("cache", &self.cache) + .field("strncmp_func", &self.strncmp_func) + .finish() + } +} + #[derive(Copy, Clone)] #[repr(C)] pub struct GCond { @@ -1262,7 +1331,7 @@ pub struct _GData { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GData = *mut _GData; +pub type GData = _GData; #[derive(Copy, Clone)] #[repr(C)] @@ -1309,12 +1378,16 @@ impl ::std::fmt::Debug for GDebugKey { } #[repr(C)] -pub struct _GDir { +pub struct GDir { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GDir = *mut _GDir; +impl ::std::fmt::Debug for GDir { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + f.debug_struct(&format!("GDir @ {self:p}")).finish() + } +} #[repr(C)] pub struct GDoubleIEEE754_mpn { @@ -1395,12 +1468,16 @@ impl ::std::fmt::Debug for GHashTableIter { } #[repr(C)] -pub struct _GHmac { +pub struct GHmac { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GHmac = *mut _GHmac; +impl ::std::fmt::Debug for GHmac { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + f.debug_struct(&format!("GHmac @ {self:p}")).finish() + } +} #[derive(Copy, Clone)] #[repr(C)] @@ -1689,6 +1766,14 @@ impl ::std::fmt::Debug for GMatchInfo { } } +#[repr(C)] +pub struct _GMemChunk { + _data: [u8; 0], + _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, +} + +pub type GMemChunk = _GMemChunk; + #[derive(Copy, Clone)] #[repr(C)] pub struct GMemVTable { @@ -1754,7 +1839,7 @@ pub struct _GOptionContext { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GOptionContext = *mut _GOptionContext; +pub type GOptionContext = _GOptionContext; #[derive(Copy, Clone)] #[repr(C)] @@ -1880,12 +1965,16 @@ impl ::std::fmt::Debug for GRWLock { } #[repr(C)] -pub struct _GRand { +pub struct GRand { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GRand = *mut _GRand; +impl ::std::fmt::Debug for GRand { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + f.debug_struct(&format!("GRand @ {self:p}")).finish() + } +} #[derive(Copy, Clone)] #[repr(C)] @@ -1912,6 +2001,14 @@ impl ::std::fmt::Debug for GRegex { } } +#[repr(C)] +pub struct _GRelation { + _data: [u8; 0], + _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, +} + +pub type GRelation = _GRelation; + #[derive(Copy, Clone)] #[repr(C)] pub struct GSList { @@ -2005,7 +2102,7 @@ pub struct _GSequence { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GSequence = *mut _GSequence; +pub type GSequence = _GSequence; #[repr(C)] pub struct _GSequenceIter { @@ -2013,7 +2110,7 @@ pub struct _GSequenceIter { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GSequenceIter = *mut _GSequenceIter; +pub type GSequenceIter = _GSequenceIter; #[derive(Copy, Clone)] #[repr(C)] @@ -2085,7 +2182,7 @@ pub struct _GSourcePrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GSourcePrivate = *mut _GSourcePrivate; +pub type GSourcePrivate = _GSourcePrivate; #[repr(C)] pub struct _GStatBuf { @@ -2093,7 +2190,67 @@ pub struct _GStatBuf { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GStatBuf = *mut _GStatBuf; +pub type GStatBuf = _GStatBuf; + +#[derive(Copy, Clone)] +#[repr(C)] +pub struct GStaticMutex { + pub mutex: *mut GMutex, +} + +impl ::std::fmt::Debug for GStaticMutex { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + f.debug_struct(&format!("GStaticMutex @ {self:p}")) + .field("mutex", &self.mutex) + .finish() + } +} + +#[derive(Copy, Clone)] +#[repr(C)] +pub struct GStaticPrivate { + pub index: c_uint, +} + +impl ::std::fmt::Debug for GStaticPrivate { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + f.debug_struct(&format!("GStaticPrivate @ {self:p}")) + .finish() + } +} + +#[derive(Copy, Clone)] +#[repr(C)] +pub struct GStaticRWLock { + pub mutex: GStaticMutex, + pub read_cond: *mut GCond, + pub write_cond: *mut GCond, + pub read_counter: c_uint, + pub have_writer: gboolean, + pub want_to_read: c_uint, + pub want_to_write: c_uint, +} + +impl ::std::fmt::Debug for GStaticRWLock { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + f.debug_struct(&format!("GStaticRWLock @ {self:p}")) + .finish() + } +} + +#[derive(Copy, Clone)] +#[repr(C)] +pub struct GStaticRecMutex { + pub mutex: GStaticMutex, + pub depth: c_uint, +} + +impl ::std::fmt::Debug for GStaticRecMutex { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + f.debug_struct(&format!("GStaticRecMutex @ {self:p}")) + .finish() + } +} #[derive(Copy, Clone)] #[repr(C)] @@ -2119,15 +2276,19 @@ pub struct _GStringChunk { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GStringChunk = *mut _GStringChunk; +pub type GStringChunk = _GStringChunk; #[repr(C)] -pub struct _GStrvBuilder { +pub struct GStrvBuilder { _data: [u8; 0], _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GStrvBuilder = *mut _GStrvBuilder; +impl ::std::fmt::Debug for GStrvBuilder { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + f.debug_struct(&format!("GStrvBuilder @ {self:p}")).finish() + } +} #[repr(C)] pub struct _GTestCase { @@ -2135,7 +2296,7 @@ pub struct _GTestCase { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GTestCase = *mut _GTestCase; +pub type GTestCase = _GTestCase; #[derive(Copy, Clone)] #[repr(C)] @@ -2181,12 +2342,15 @@ pub struct _GTestSuite { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GTestSuite = *mut _GTestSuite; +pub type GTestSuite = _GTestSuite; +#[derive(Copy, Clone)] #[repr(C)] pub struct GThread { - _data: [u8; 0], - _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, + pub func: GThreadFunc, + pub data: gpointer, + pub joinable: gboolean, + pub priority: GThreadPriority, } impl ::std::fmt::Debug for GThread { @@ -2195,6 +2359,72 @@ impl ::std::fmt::Debug for GThread { } } +#[derive(Copy, Clone)] +#[repr(C)] +pub struct GThreadFunctions { + pub mutex_new: Option *mut GMutex>, + pub mutex_lock: Option, + pub mutex_trylock: Option gboolean>, + pub mutex_unlock: Option, + pub mutex_free: Option, + pub cond_new: Option *mut GCond>, + pub cond_signal: Option, + pub cond_broadcast: Option, + pub cond_wait: Option, + pub cond_timed_wait: + Option gboolean>, + pub cond_free: Option, + pub private_new: Option *mut GPrivate>, + pub private_get: Option gpointer>, + pub private_set: Option, + pub thread_create: Option< + unsafe extern "C" fn( + GThreadFunc, + gpointer, + c_ulong, + gboolean, + gboolean, + GThreadPriority, + gpointer, + *mut *mut GError, + ), + >, + pub thread_yield: Option, + pub thread_join: Option, + pub thread_exit: Option, + pub thread_set_priority: Option, + pub thread_self: Option, + pub thread_equal: Option gboolean>, +} + +impl ::std::fmt::Debug for GThreadFunctions { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + f.debug_struct(&format!("GThreadFunctions @ {self:p}")) + .field("mutex_new", &self.mutex_new) + .field("mutex_lock", &self.mutex_lock) + .field("mutex_trylock", &self.mutex_trylock) + .field("mutex_unlock", &self.mutex_unlock) + .field("mutex_free", &self.mutex_free) + .field("cond_new", &self.cond_new) + .field("cond_signal", &self.cond_signal) + .field("cond_broadcast", &self.cond_broadcast) + .field("cond_wait", &self.cond_wait) + .field("cond_timed_wait", &self.cond_timed_wait) + .field("cond_free", &self.cond_free) + .field("private_new", &self.private_new) + .field("private_get", &self.private_get) + .field("private_set", &self.private_set) + .field("thread_create", &self.thread_create) + .field("thread_yield", &self.thread_yield) + .field("thread_join", &self.thread_join) + .field("thread_exit", &self.thread_exit) + .field("thread_set_priority", &self.thread_set_priority) + .field("thread_self", &self.thread_self) + .field("thread_equal", &self.thread_equal) + .finish() + } +} + #[derive(Copy, Clone)] #[repr(C)] pub struct GThreadPool { @@ -2247,7 +2477,7 @@ pub struct _GTimer { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GTimer = *mut _GTimer; +pub type GTimer = _GTimer; #[derive(Copy, Clone)] #[repr(C)] @@ -2281,7 +2511,35 @@ pub struct _GTreeNode { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type GTreeNode = *mut _GTreeNode; +pub type GTreeNode = _GTreeNode; + +#[derive(Copy, Clone)] +#[repr(C)] +pub struct GTuples { + pub len: c_uint, +} + +impl ::std::fmt::Debug for GTuples { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + f.debug_struct(&format!("GTuples @ {self:p}")) + .field("len", &self.len) + .finish() + } +} + +#[derive(Copy, Clone)] +#[repr(C)] +pub struct GUnixPipe { + pub fds: [c_int; 2], +} + +impl ::std::fmt::Debug for GUnixPipe { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + f.debug_struct(&format!("GUnixPipe @ {self:p}")) + .field("fds", &self.fds) + .finish() + } +} #[repr(C)] pub struct GUri { @@ -2415,6 +2673,28 @@ impl ::std::fmt::Debug for GVariantType { #[link(name = "glib-2.0")] extern "C" { + //========================================================================= + // GNormalizeMode + //========================================================================= + pub fn g_normalize_mode_get_type() -> GType; + + //========================================================================= + // GUnicodeBreakType + //========================================================================= + pub fn g_unicode_break_type_get_type() -> GType; + + //========================================================================= + // GUnicodeScript + //========================================================================= + pub fn g_unicode_script_get_type() -> GType; + pub fn g_unicode_script_from_iso15924(iso15924: u32) -> GUnicodeScript; + pub fn g_unicode_script_to_iso15924(script: GUnicodeScript) -> u32; + + //========================================================================= + // GUnicodeType + //========================================================================= + pub fn g_unicode_type_get_type() -> GType; + //========================================================================= // GIOCondition //========================================================================= @@ -2424,10 +2704,18 @@ extern "C" { // GMutex //========================================================================= pub fn g_mutex_clear(mutex: *mut GMutex); + pub fn g_mutex_free(mutex: *mut GMutex); pub fn g_mutex_init(mutex: *mut GMutex); pub fn g_mutex_lock(mutex: *mut GMutex); pub fn g_mutex_trylock(mutex: *mut GMutex) -> gboolean; pub fn g_mutex_unlock(mutex: *mut GMutex); + pub fn g_mutex_new() -> *mut GMutex; + + //========================================================================= + // GAllocator + //========================================================================= + pub fn g_allocator_free(allocator: *mut GAllocator); + pub fn g_allocator_new(name: *const c_char, n_preallocs: c_uint) -> *mut GAllocator; //========================================================================= // GArray @@ -2902,6 +3190,24 @@ extern "C" { pub fn g_bytes_unref_to_array(bytes: *mut GBytes) -> *mut GByteArray; pub fn g_bytes_unref_to_data(bytes: *mut GBytes, size: *mut size_t) -> gpointer; + //========================================================================= + // GCache + //========================================================================= + pub fn g_cache_destroy(cache: *mut GCache); + pub fn g_cache_insert(cache: *mut GCache, key: gpointer) -> gpointer; + pub fn g_cache_key_foreach(cache: *mut GCache, func: GHFunc, user_data: gpointer); + pub fn g_cache_remove(cache: *mut GCache, value: gconstpointer); + pub fn g_cache_value_foreach(cache: *mut GCache, func: GHFunc, user_data: gpointer); + pub fn g_cache_new( + value_new_func: GCacheNewFunc, + value_destroy_func: GCacheDestroyFunc, + key_dup_func: GCacheDupFunc, + key_destroy_func: GCacheDestroyFunc, + hash_key_func: GHashFunc, + hash_value_func: GHashFunc, + key_equal_func: GEqualFunc, + ) -> *mut GCache; + //========================================================================= // GChecksum //========================================================================= @@ -2919,15 +3225,42 @@ extern "C" { pub fn g_checksum_update(checksum: *mut GChecksum, data: *const u8, length: ssize_t); pub fn g_checksum_type_get_length(checksum_type: GChecksumType) -> ssize_t; + //========================================================================= + // GCompletion + //========================================================================= + pub fn g_completion_add_items(cmp: *mut GCompletion, items: *mut GList); + pub fn g_completion_clear_items(cmp: *mut GCompletion); + pub fn g_completion_complete( + cmp: *mut GCompletion, + prefix: *const c_char, + new_prefix: *mut *mut c_char, + ) -> *mut GList; + pub fn g_completion_complete_utf8( + cmp: *mut GCompletion, + prefix: *const c_char, + new_prefix: *mut *mut c_char, + ) -> *mut GList; + pub fn g_completion_free(cmp: *mut GCompletion); + pub fn g_completion_remove_items(cmp: *mut GCompletion, items: *mut GList); + pub fn g_completion_set_compare(cmp: *mut GCompletion, strncmp_func: GCompletionStrncmpFunc); + pub fn g_completion_new(func: GCompletionFunc) -> *mut GCompletion; + //========================================================================= // GCond //========================================================================= pub fn g_cond_broadcast(cond: *mut GCond); pub fn g_cond_clear(cond: *mut GCond); + pub fn g_cond_free(cond: *mut GCond); pub fn g_cond_init(cond: *mut GCond); pub fn g_cond_signal(cond: *mut GCond); + pub fn g_cond_timed_wait( + cond: *mut GCond, + mutex: *mut GMutex, + abs_time: *mut GTimeVal, + ) -> gboolean; pub fn g_cond_wait(cond: *mut GCond, mutex: *mut GMutex); pub fn g_cond_wait_until(cond: *mut GCond, mutex: *mut GMutex, end_time: i64) -> gboolean; + pub fn g_cond_new() -> *mut GCond; //========================================================================= // GDate @@ -3008,7 +3341,13 @@ extern "C" { pub fn g_date_time_new_from_timeval_local(tv: *const GTimeVal) -> *mut GDateTime; pub fn g_date_time_new_from_timeval_utc(tv: *const GTimeVal) -> *mut GDateTime; pub fn g_date_time_new_from_unix_local(t: i64) -> *mut GDateTime; + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + pub fn g_date_time_new_from_unix_local_usec(usecs: i64) -> *mut GDateTime; pub fn g_date_time_new_from_unix_utc(t: i64) -> *mut GDateTime; + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + pub fn g_date_time_new_from_unix_utc_usec(usecs: i64) -> *mut GDateTime; pub fn g_date_time_new_local( year: c_int, month: c_int, @@ -3082,17 +3421,27 @@ extern "C" { pub fn g_date_time_to_timeval(datetime: *mut GDateTime, tv: *mut GTimeVal) -> gboolean; pub fn g_date_time_to_timezone(datetime: *mut GDateTime, tz: *mut GTimeZone) -> *mut GDateTime; pub fn g_date_time_to_unix(datetime: *mut GDateTime) -> i64; + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + pub fn g_date_time_to_unix_usec(datetime: *mut GDateTime) -> i64; pub fn g_date_time_to_utc(datetime: *mut GDateTime) -> *mut GDateTime; pub fn g_date_time_unref(datetime: *mut GDateTime); //========================================================================= // GDir //========================================================================= + pub fn g_dir_get_type() -> GType; + pub fn g_dir_open(path: *const c_char, flags: c_uint, error: *mut *mut GError) -> *mut GDir; pub fn g_dir_close(dir: *mut GDir); pub fn g_dir_read_name(dir: *mut GDir) -> *const c_char; + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + pub fn g_dir_ref(dir: *mut GDir) -> *mut GDir; pub fn g_dir_rewind(dir: *mut GDir); + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + pub fn g_dir_unref(dir: *mut GDir); pub fn g_dir_make_tmp(tmpl: *const c_char, error: *mut *mut GError) -> *mut c_char; - pub fn g_dir_open(path: *const c_char, flags: c_uint, error: *mut *mut GError) -> *mut GDir; //========================================================================= // GError @@ -3224,13 +3573,14 @@ extern "C" { //========================================================================= // GHmac //========================================================================= + pub fn g_hmac_get_type() -> GType; + pub fn g_hmac_new(digest_type: GChecksumType, key: *const u8, key_len: size_t) -> *mut GHmac; pub fn g_hmac_copy(hmac: *const GHmac) -> *mut GHmac; pub fn g_hmac_get_digest(hmac: *mut GHmac, buffer: *mut u8, digest_len: *mut size_t); pub fn g_hmac_get_string(hmac: *mut GHmac) -> *const c_char; pub fn g_hmac_ref(hmac: *mut GHmac) -> *mut GHmac; pub fn g_hmac_unref(hmac: *mut GHmac); pub fn g_hmac_update(hmac: *mut GHmac, data: *const u8, length: ssize_t); - pub fn g_hmac_new(digest_type: GChecksumType, key: *const u8, key_len: size_t) -> *mut GHmac; //========================================================================= // GHook @@ -3742,8 +4092,10 @@ extern "C" { pub fn g_list_nth(list: *mut GList, n: c_uint) -> *mut GList; pub fn g_list_nth_data(list: *mut GList, n: c_uint) -> gpointer; pub fn g_list_nth_prev(list: *mut GList, n: c_uint) -> *mut GList; + pub fn g_list_pop_allocator(); pub fn g_list_position(list: *mut GList, llink: *mut GList) -> c_int; pub fn g_list_prepend(list: *mut GList, data: gpointer) -> *mut GList; + pub fn g_list_push_allocator(allocator: *mut GAllocator); pub fn g_list_remove(list: *mut GList, data: gconstpointer) -> *mut GList; pub fn g_list_remove_all(list: *mut GList, data: gconstpointer) -> *mut GList; pub fn g_list_remove_link(list: *mut GList, llink: *mut GList) -> *mut GList; @@ -3934,6 +4286,24 @@ extern "C" { pub fn g_match_info_ref(match_info: *mut GMatchInfo) -> *mut GMatchInfo; pub fn g_match_info_unref(match_info: *mut GMatchInfo); + //========================================================================= + // GMemChunk + //========================================================================= + pub fn g_mem_chunk_alloc(mem_chunk: *mut GMemChunk) -> gpointer; + pub fn g_mem_chunk_alloc0(mem_chunk: *mut GMemChunk) -> gpointer; + pub fn g_mem_chunk_clean(mem_chunk: *mut GMemChunk); + pub fn g_mem_chunk_destroy(mem_chunk: *mut GMemChunk); + pub fn g_mem_chunk_free(mem_chunk: *mut GMemChunk, mem: gpointer); + pub fn g_mem_chunk_print(mem_chunk: *mut GMemChunk); + pub fn g_mem_chunk_reset(mem_chunk: *mut GMemChunk); + pub fn g_mem_chunk_info(); + pub fn g_mem_chunk_new( + name: *const c_char, + atom_size: c_int, + area_size: size_t, + type_: c_int, + ) -> *mut GMemChunk; + //========================================================================= // GNode //========================================================================= @@ -3989,13 +4359,22 @@ extern "C" { ); pub fn g_node_unlink(node: *mut GNode); pub fn g_node_new(data: gpointer) -> *mut GNode; + pub fn g_node_pop_allocator(); + pub fn g_node_push_allocator(allocator: *mut GAllocator); //========================================================================= // GOnce //========================================================================= pub fn g_once_impl(once: *mut GOnce, func: GThreadFunc, arg: gpointer) -> gpointer; pub fn g_once_init_enter(location: *mut c_void) -> gboolean; + pub fn g_once_init_enter_impl(location: *mut size_t) -> gboolean; + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + pub fn g_once_init_enter_pointer(location: *mut c_void) -> gboolean; pub fn g_once_init_leave(location: *mut c_void, result: size_t); + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + pub fn g_once_init_leave_pointer(location: *mut c_void, result: gpointer); //========================================================================= // GOptionContext @@ -4165,6 +4544,7 @@ extern "C" { pub fn g_private_get(key: *mut GPrivate) -> gpointer; pub fn g_private_replace(key: *mut GPrivate, value: gpointer); pub fn g_private_set(key: *mut GPrivate, value: gpointer); + pub fn g_private_new(notify: GDestroyNotify) -> *mut GPrivate; //========================================================================= // GPtrArray @@ -4366,6 +4746,10 @@ extern "C" { //========================================================================= // GRand //========================================================================= + pub fn g_rand_get_type() -> GType; + pub fn g_rand_new() -> *mut GRand; + pub fn g_rand_new_with_seed(seed: u32) -> *mut GRand; + pub fn g_rand_new_with_seed_array(seed: *const u32, seed_length: c_uint) -> *mut GRand; pub fn g_rand_copy(rand_: *mut GRand) -> *mut GRand; pub fn g_rand_double(rand_: *mut GRand) -> c_double; pub fn g_rand_double_range(rand_: *mut GRand, begin: c_double, end: c_double) -> c_double; @@ -4374,9 +4758,6 @@ extern "C" { pub fn g_rand_int_range(rand_: *mut GRand, begin: i32, end: i32) -> i32; pub fn g_rand_set_seed(rand_: *mut GRand, seed: u32); pub fn g_rand_set_seed_array(rand_: *mut GRand, seed: *const u32, seed_length: c_uint); - pub fn g_rand_new() -> *mut GRand; - pub fn g_rand_new_with_seed(seed: u32) -> *mut GRand; - pub fn g_rand_new_with_seed_array(seed: *const u32, seed_length: c_uint) -> *mut GRand; //========================================================================= // GRecMutex @@ -4500,6 +4881,28 @@ extern "C" { match_options: GRegexMatchFlags, ) -> *mut *mut c_char; + //========================================================================= + // GRelation + //========================================================================= + pub fn g_relation_count(relation: *mut GRelation, key: gconstpointer, field: c_int) -> c_int; + pub fn g_relation_delete(relation: *mut GRelation, key: gconstpointer, field: c_int) -> c_int; + pub fn g_relation_destroy(relation: *mut GRelation); + pub fn g_relation_exists(relation: *mut GRelation, ...) -> gboolean; + pub fn g_relation_index( + relation: *mut GRelation, + field: c_int, + hash_func: GHashFunc, + key_equal_func: GEqualFunc, + ); + pub fn g_relation_insert(relation: *mut GRelation, ...); + pub fn g_relation_print(relation: *mut GRelation); + pub fn g_relation_select( + relation: *mut GRelation, + key: gconstpointer, + field: c_int, + ) -> *mut GTuples; + pub fn g_relation_new(fields: c_int) -> *mut GRelation; + //========================================================================= // GSList //========================================================================= @@ -4545,8 +4948,10 @@ extern "C" { pub fn g_slist_length(list: *mut GSList) -> c_uint; pub fn g_slist_nth(list: *mut GSList, n: c_uint) -> *mut GSList; pub fn g_slist_nth_data(list: *mut GSList, n: c_uint) -> gpointer; + pub fn g_slist_pop_allocator(); pub fn g_slist_position(list: *mut GSList, llink: *mut GSList) -> c_int; pub fn g_slist_prepend(list: *mut GSList, data: gpointer) -> *mut GSList; + pub fn g_slist_push_allocator(allocator: *mut GAllocator); pub fn g_slist_remove(list: *mut GSList, data: gconstpointer) -> *mut GSList; pub fn g_slist_remove_all(list: *mut GSList, data: gconstpointer) -> *mut GSList; pub fn g_slist_remove_link(list: *mut GSList, link_: *mut GSList) -> *mut GSList; @@ -4766,6 +5171,48 @@ extern "C" { pub fn g_source_remove_by_user_data(user_data: gpointer) -> gboolean; pub fn g_source_set_name_by_id(tag: c_uint, name: *const c_char); + //========================================================================= + // GStaticMutex + //========================================================================= + pub fn g_static_mutex_free(mutex: *mut GStaticMutex); + pub fn g_static_mutex_get_mutex_impl(mutex: *mut GStaticMutex) -> *mut GMutex; + pub fn g_static_mutex_init(mutex: *mut GStaticMutex); + + //========================================================================= + // GStaticPrivate + //========================================================================= + pub fn g_static_private_free(private_key: *mut GStaticPrivate); + pub fn g_static_private_get(private_key: *mut GStaticPrivate) -> gpointer; + pub fn g_static_private_init(private_key: *mut GStaticPrivate); + pub fn g_static_private_set( + private_key: *mut GStaticPrivate, + data: gpointer, + notify: GDestroyNotify, + ); + + //========================================================================= + // GStaticRWLock + //========================================================================= + pub fn g_static_rw_lock_free(lock: *mut GStaticRWLock); + pub fn g_static_rw_lock_init(lock: *mut GStaticRWLock); + pub fn g_static_rw_lock_reader_lock(lock: *mut GStaticRWLock); + pub fn g_static_rw_lock_reader_trylock(lock: *mut GStaticRWLock) -> gboolean; + pub fn g_static_rw_lock_reader_unlock(lock: *mut GStaticRWLock); + pub fn g_static_rw_lock_writer_lock(lock: *mut GStaticRWLock); + pub fn g_static_rw_lock_writer_trylock(lock: *mut GStaticRWLock) -> gboolean; + pub fn g_static_rw_lock_writer_unlock(lock: *mut GStaticRWLock); + + //========================================================================= + // GStaticRecMutex + //========================================================================= + pub fn g_static_rec_mutex_free(mutex: *mut GStaticRecMutex); + pub fn g_static_rec_mutex_init(mutex: *mut GStaticRecMutex); + pub fn g_static_rec_mutex_lock(mutex: *mut GStaticRecMutex); + pub fn g_static_rec_mutex_lock_full(mutex: *mut GStaticRecMutex, depth: c_uint); + pub fn g_static_rec_mutex_trylock(mutex: *mut GStaticRecMutex) -> gboolean; + pub fn g_static_rec_mutex_unlock(mutex: *mut GStaticRecMutex); + pub fn g_static_rec_mutex_unlock_full(mutex: *mut GStaticRecMutex) -> c_uint; + //========================================================================= // GString //========================================================================= @@ -4868,6 +5315,12 @@ extern "C" { //========================================================================= #[cfg(feature = "v2_68")] #[cfg_attr(docsrs, doc(cfg(feature = "v2_68")))] + pub fn g_strv_builder_get_type() -> GType; + #[cfg(feature = "v2_68")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_68")))] + pub fn g_strv_builder_new() -> *mut GStrvBuilder; + #[cfg(feature = "v2_68")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_68")))] pub fn g_strv_builder_add(builder: *mut GStrvBuilder, value: *const c_char); #[cfg(feature = "v2_68")] #[cfg_attr(docsrs, doc(cfg(feature = "v2_68")))] @@ -4883,10 +5336,10 @@ extern "C" { pub fn g_strv_builder_ref(builder: *mut GStrvBuilder) -> *mut GStrvBuilder; #[cfg(feature = "v2_68")] #[cfg_attr(docsrs, doc(cfg(feature = "v2_68")))] - pub fn g_strv_builder_unref(builder: *mut GStrvBuilder); + pub fn g_strv_builder_take(builder: *mut GStrvBuilder, value: *mut c_char); #[cfg(feature = "v2_68")] #[cfg_attr(docsrs, doc(cfg(feature = "v2_68")))] - pub fn g_strv_builder_new() -> *mut GStrvBuilder; + pub fn g_strv_builder_unref(builder: *mut GStrvBuilder); //========================================================================= // GTestCase @@ -4930,9 +5383,29 @@ extern "C" { ) -> *mut GThread; pub fn g_thread_join(thread: *mut GThread) -> gpointer; pub fn g_thread_ref(thread: *mut GThread) -> *mut GThread; + pub fn g_thread_set_priority(thread: *mut GThread, priority: GThreadPriority); pub fn g_thread_unref(thread: *mut GThread); + pub fn g_thread_create( + func: GThreadFunc, + data: gpointer, + joinable: gboolean, + error: *mut *mut GError, + ) -> *mut GThread; + pub fn g_thread_create_full( + func: GThreadFunc, + data: gpointer, + stack_size: c_ulong, + joinable: gboolean, + bound: gboolean, + priority: GThreadPriority, + error: *mut *mut GError, + ) -> *mut GThread; pub fn g_thread_error_quark() -> GQuark; pub fn g_thread_exit(retval: gpointer); + pub fn g_thread_foreach(thread_func: GFunc, user_data: gpointer); + pub fn g_thread_get_initialized() -> gboolean; + pub fn g_thread_init(vtable: gpointer); + pub fn g_thread_init_with_errorcheck_mutexes(vtable: gpointer); pub fn g_thread_self() -> *mut GThread; pub fn g_thread_yield(); @@ -5130,6 +5603,12 @@ extern "C" { #[cfg_attr(docsrs, doc(cfg(feature = "v2_68")))] pub fn g_tree_node_value(node: *mut GTreeNode) -> gpointer; + //========================================================================= + // GTuples + //========================================================================= + pub fn g_tuples_destroy(tuples: *mut GTuples); + pub fn g_tuples_index(tuples: *mut GTuples, index_: c_int, field: c_int) -> gpointer; + //========================================================================= // GUri //========================================================================= @@ -5644,7 +6123,7 @@ extern "C" { pub fn g_variant_type_next(type_: *const GVariantType) -> *const GVariantType; pub fn g_variant_type_peek_string(type_: *const GVariantType) -> *const c_char; pub fn g_variant_type_value(type_: *const GVariantType) -> *const GVariantType; - pub fn g_variant_type_checked_(arg0: *const c_char) -> *const GVariantType; + pub fn g_variant_type_checked_(type_string: *const c_char) -> *const GVariantType; pub fn g_variant_type_string_get_depth_(type_string: *const c_char) -> size_t; pub fn g_variant_type_string_is_valid(type_string: *const c_char) -> gboolean; pub fn g_variant_type_string_scan( @@ -5795,8 +6274,8 @@ extern "C" { pub fn g_atomic_int_or(atomic: *mut c_uint, val: c_uint) -> c_uint; pub fn g_atomic_int_set(atomic: *mut c_int, newval: c_int); pub fn g_atomic_int_xor(atomic: *mut c_uint, val: c_uint) -> c_uint; - pub fn g_atomic_pointer_add(atomic: *mut c_void, val: ssize_t) -> ssize_t; - pub fn g_atomic_pointer_and(atomic: *mut c_void, val: size_t) -> size_t; + pub fn g_atomic_pointer_add(atomic: *mut c_void, val: ssize_t) -> intptr_t; + pub fn g_atomic_pointer_and(atomic: *mut c_void, val: size_t) -> uintptr_t; pub fn g_atomic_pointer_compare_and_exchange( atomic: *mut c_void, oldval: gpointer, @@ -5814,9 +6293,9 @@ extern "C" { #[cfg_attr(docsrs, doc(cfg(feature = "v2_74")))] pub fn g_atomic_pointer_exchange(atomic: *mut c_void, newval: gpointer) -> gpointer; pub fn g_atomic_pointer_get(atomic: *mut c_void) -> gpointer; - pub fn g_atomic_pointer_or(atomic: *mut c_void, val: size_t) -> size_t; + pub fn g_atomic_pointer_or(atomic: *mut c_void, val: size_t) -> uintptr_t; pub fn g_atomic_pointer_set(atomic: *mut c_void, newval: gpointer); - pub fn g_atomic_pointer_xor(atomic: *mut c_void, val: size_t) -> size_t; + pub fn g_atomic_pointer_xor(atomic: *mut c_void, val: size_t) -> uintptr_t; #[cfg(feature = "v2_58")] #[cfg_attr(docsrs, doc(cfg(feature = "v2_58")))] pub fn g_atomic_rc_box_acquire(mem_block: gpointer) -> gpointer; @@ -5881,6 +6360,7 @@ extern "C" { pub fn g_bit_storage(number: c_ulong) -> c_uint; pub fn g_bit_trylock(address: *mut c_int, lock_bit: c_int) -> gboolean; pub fn g_bit_unlock(address: *mut c_int, lock_bit: c_int); + pub fn g_blow_chunks(); pub fn g_build_filename(first_element: *const c_char, ...) -> *mut c_char; //pub fn g_build_filename_valist(first_element: *const c_char, args: /*Unimplemented*/*mut va_list) -> *mut c_char; pub fn g_build_filenamev(args: *mut *mut c_char) -> *mut c_char; @@ -5908,6 +6388,7 @@ extern "C" { notify: GDestroyNotify, ) -> c_uint; pub fn g_child_watch_source_new(pid: GPid) -> *mut GSource; + pub fn g_chmod(filename: *const c_char, mode: c_int) -> c_int; pub fn g_clear_error(error: *mut *mut GError); pub fn g_clear_handle_id(tag_ptr: *mut c_uint, clear_func: GClearHandleFunc); #[cfg(feature = "v2_64")] @@ -5979,6 +6460,7 @@ extern "C" { bytes_written: *mut size_t, error: *mut *mut GError, ) -> *mut u8; + pub fn g_creat(filename: *const c_char, mode: c_int) -> c_int; pub fn g_datalist_clear(datalist: *mut *mut GData); pub fn g_datalist_foreach( datalist: *mut *mut GData, @@ -6128,6 +6610,7 @@ extern "C" { error: *mut *mut GError, ) -> *mut c_char; pub fn g_find_program_in_path(program: *const c_char) -> *mut c_char; + pub fn g_fopen(filename: *const c_char, mode: *const c_char) -> *mut FILE; pub fn g_format_size(size: u64) -> *mut c_char; pub fn g_format_size_for_display(size: i64) -> *mut c_char; pub fn g_format_size_full(size: u64, flags: GFormatSizeFlags) -> *mut c_char; @@ -6136,6 +6619,10 @@ extern "C" { #[cfg(feature = "v2_76")] #[cfg_attr(docsrs, doc(cfg(feature = "v2_76")))] pub fn g_free_sized(mem: gpointer, size: size_t); + pub fn g_freopen(filename: *const c_char, mode: *const c_char, stream: *mut FILE) -> *mut FILE; + #[cfg(feature = "v2_64")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_64")))] + pub fn g_fsync(fd: c_int) -> c_int; pub fn g_get_application_name() -> *const c_char; pub fn g_get_charset(charset: *mut *const c_char) -> gboolean; pub fn g_get_codeset() -> *mut c_char; @@ -6299,6 +6786,9 @@ extern "C" { n_fields: size_t, user_data: gpointer, ) -> GLogWriterOutput; + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + pub fn g_log_writer_default_set_debug_domains(domains: *const *const c_char); #[cfg(feature = "v2_68")] #[cfg_attr(docsrs, doc(cfg(feature = "v2_68")))] pub fn g_log_writer_default_set_use_stderr(use_stderr: gboolean); @@ -6328,7 +6818,16 @@ extern "C" { user_data: gpointer, ) -> GLogWriterOutput; pub fn g_log_writer_supports_color(output_fd: c_int) -> gboolean; + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + pub fn g_log_writer_syslog( + log_level: GLogLevelFlags, + fields: *const GLogField, + n_fields: size_t, + user_data: gpointer, + ) -> GLogWriterOutput; //pub fn g_logv(log_domain: *const c_char, log_level: GLogLevelFlags, format: *const c_char, args: /*Unimplemented*/va_list); + pub fn g_lstat(filename: *const c_char, buf: *mut GStatBuf) -> c_int; pub fn g_main_current_source() -> *mut GSource; pub fn g_main_depth() -> c_int; pub fn g_malloc(n_bytes: size_t) -> gpointer; @@ -6355,6 +6854,7 @@ extern "C" { #[cfg(feature = "v2_68")] #[cfg_attr(docsrs, doc(cfg(feature = "v2_68")))] pub fn g_memdup2(mem: gconstpointer, byte_size: size_t) -> gpointer; + pub fn g_mkdir(filename: *const c_char, mode: c_int) -> c_int; pub fn g_mkdir_with_parents(pathname: *const c_char, mode: c_int) -> c_int; pub fn g_mkdtemp(tmpl: *mut c_char) -> *mut c_char; pub fn g_mkdtemp_full(tmpl: *mut c_char, mode: c_int) -> *mut c_char; @@ -6364,6 +6864,7 @@ extern "C" { pub fn g_number_parser_error_quark() -> GQuark; pub fn g_on_error_query(prg_name: *const c_char); pub fn g_on_error_stack_trace(prg_name: *const c_char); + pub fn g_open(filename: *const c_char, flags: c_int, mode: c_int) -> c_int; pub fn g_option_error_quark() -> GQuark; pub fn g_parse_debug_string( string: *const c_char, @@ -6383,8 +6884,28 @@ extern "C" { pub fn g_pattern_match_simple(pattern: *const c_char, string: *const c_char) -> gboolean; pub fn g_pattern_match_string(pspec: *mut GPatternSpec, string: *const c_char) -> gboolean; pub fn g_pointer_bit_lock(address: *mut c_void, lock_bit: c_int); + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + pub fn g_pointer_bit_lock_and_get(address: gpointer, lock_bit: c_uint, out_ptr: *mut uintptr_t); + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + pub fn g_pointer_bit_lock_mask_ptr( + ptr: gpointer, + lock_bit: c_uint, + set: gboolean, + preserve_mask: uintptr_t, + preserve_ptr: gpointer, + ) -> gpointer; pub fn g_pointer_bit_trylock(address: *mut c_void, lock_bit: c_int) -> gboolean; pub fn g_pointer_bit_unlock(address: *mut c_void, lock_bit: c_int); + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + pub fn g_pointer_bit_unlock_and_set( + address: *mut c_void, + lock_bit: c_uint, + ptr: gpointer, + preserve_mask: uintptr_t, + ); pub fn g_poll(fds: *mut GPollFD, nfds: c_uint, timeout: c_int) -> c_int; pub fn g_prefix_error(err: *mut *mut GError, format: *const c_char, ...); #[cfg(feature = "v2_70")] @@ -6471,6 +6992,8 @@ extern "C" { #[cfg_attr(docsrs, doc(cfg(feature = "v2_58")))] pub fn g_ref_string_release(str: *mut c_char); pub fn g_reload_user_special_dirs_cache(); + pub fn g_remove(filename: *const c_char) -> c_int; + pub fn g_rename(oldfilename: *const c_char, newfilename: *const c_char) -> c_int; pub fn g_return_if_fail_warning( log_domain: *const c_char, pretty_function: *const c_char, @@ -6492,8 +7015,10 @@ extern "C" { message: *const c_char, ); pub fn g_set_prgname(prgname: *const c_char); + pub fn g_set_prgname_once(prgname: *const c_char) -> gboolean; pub fn g_set_print_handler(func: GPrintFunc) -> GPrintFunc; pub fn g_set_printerr_handler(func: GPrintFunc) -> GPrintFunc; + pub fn g_set_user_dirs(first_dir_type: *const c_char, ...); pub fn g_setenv(variable: *const c_char, value: *const c_char, overwrite: gboolean) -> gboolean; pub fn g_shell_error_quark() -> GQuark; @@ -6508,6 +7033,7 @@ extern "C" { pub fn g_slice_alloc(block_size: size_t) -> gpointer; pub fn g_slice_alloc0(block_size: size_t) -> gpointer; pub fn g_slice_copy(block_size: size_t, mem_block: gconstpointer) -> gpointer; + pub fn g_slice_debug_tree_statistics(); pub fn g_slice_free1(block_size: size_t, mem_block: gpointer); pub fn g_slice_free_chain_with_offset( block_size: size_t, @@ -6613,6 +7139,7 @@ extern "C" { error: *mut *mut GError, ) -> gboolean; pub fn g_sprintf(string: *mut c_char, format: *const c_char, ...) -> c_int; + pub fn g_stat(filename: *const c_char, buf: *mut GStatBuf) -> c_int; pub fn g_stpcpy(dest: *mut c_char, src: *const c_char) -> *mut c_char; pub fn g_str_equal(v1: gconstpointer, v2: gconstpointer) -> gboolean; pub fn g_str_has_prefix(str: *const c_char, prefix: *const c_char) -> gboolean; @@ -6804,6 +7331,14 @@ extern "C" { usec_timeout: u64, test_flags: GTestSubprocessFlags, ); + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] + pub fn g_test_trap_subprocess_with_envp( + test_path: *const c_char, + envp: *const *const c_char, + usec_timeout: u64, + test_flags: GTestSubprocessFlags, + ); pub fn g_timeout_add(interval: c_uint, function: GSourceFunc, data: gpointer) -> c_uint; pub fn g_timeout_add_full( priority: c_int, @@ -6837,6 +7372,20 @@ extern "C" { ) -> c_uint; pub fn g_timeout_source_new(interval: c_uint) -> *mut GSource; pub fn g_timeout_source_new_seconds(interval: c_uint) -> *mut GSource; + pub fn g_trace_define_int64_counter( + group: *const c_char, + name: *const c_char, + description: *const c_char, + ) -> c_uint; + pub fn g_trace_mark( + begin_time_nsec: i64, + duration_nsec: i64, + group: *const c_char, + name: *const c_char, + message_format: *const c_char, + ... + ); + pub fn g_trace_set_int64_counter(id: c_uint, value: i64); pub fn g_try_malloc(n_bytes: size_t) -> gpointer; pub fn g_try_malloc0(n_bytes: size_t) -> gpointer; pub fn g_try_malloc0_n(n_blocks: size_t, n_block_bytes: size_t) -> gpointer; @@ -6896,8 +7445,6 @@ extern "C" { pub fn g_unichar_xdigit_value(c: u32) -> c_int; pub fn g_unicode_canonical_decomposition(ch: u32, result_len: *mut size_t) -> *mut u32; pub fn g_unicode_canonical_ordering(string: *mut u32, len: size_t); - pub fn g_unicode_script_from_iso15924(iso15924: u32) -> GUnicodeScript; - pub fn g_unicode_script_to_iso15924(script: GUnicodeScript) -> u32; pub fn g_unix_error_quark() -> GQuark; pub fn g_unix_fd_add( fd: c_int, @@ -7009,6 +7556,7 @@ extern "C" { max_len: size_t, end: *mut *const c_char, ) -> gboolean; + pub fn g_utime(filename: *const c_char, utb: *mut utimbuf) -> c_int; pub fn g_uuid_string_is_valid(str: *const c_char) -> gboolean; pub fn g_uuid_string_random() -> *mut c_char; pub fn g_variant_get_gtype() -> GType; @@ -7024,5 +7572,27 @@ extern "C" { func: *const c_char, warnexpr: *const c_char, ); + pub fn g_win32_check_windows_version( + major: c_int, + minor: c_int, + spver: c_int, + os_type: GWin32OSType, + ) -> gboolean; + pub fn g_win32_error_message(error: c_int) -> *mut c_char; + pub fn g_win32_ftruncate(f: c_int, size: c_uint) -> c_int; + pub fn g_win32_get_command_line() -> *mut *mut c_char; + pub fn g_win32_get_package_installation_directory( + package: *const c_char, + dll_name: *const c_char, + ) -> *mut c_char; + pub fn g_win32_get_package_installation_directory_of_module(hmodule: gpointer) -> *mut c_char; + pub fn g_win32_get_package_installation_subdirectory( + package: *const c_char, + dll_name: *const c_char, + subdir: *const c_char, + ) -> *mut c_char; + pub fn g_win32_get_windows_version() -> c_uint; + pub fn g_win32_getlocale() -> *mut c_char; + pub fn g_win32_locale_filename_from_utf8(utf8filename: *const c_char) -> *mut c_char; } diff --git a/glib/sys/tests/abi.rs b/glib/sys/tests/abi.rs index a33ffcb849fe..281cf6f742bf 100644 --- a/glib/sys/tests/abi.rs +++ b/glib/sys/tests/abi.rs @@ -236,6 +236,13 @@ const RUST_LAYOUTS: &[(&str, Layout)] = &[ alignment: align_of::(), }, ), + ( + "GCompletion", + Layout { + size: size_of::(), + alignment: align_of::(), + }, + ), ( "GCond", Layout { @@ -726,6 +733,34 @@ const RUST_LAYOUTS: &[(&str, Layout)] = &[ alignment: align_of::(), }, ), + ( + "GStaticMutex", + Layout { + size: size_of::(), + alignment: align_of::(), + }, + ), + ( + "GStaticPrivate", + Layout { + size: size_of::(), + alignment: align_of::(), + }, + ), + ( + "GStaticRWLock", + Layout { + size: size_of::(), + alignment: align_of::(), + }, + ), + ( + "GStaticRecMutex", + Layout { + size: size_of::(), + alignment: align_of::(), + }, + ), ( "GString", Layout { @@ -789,6 +824,13 @@ const RUST_LAYOUTS: &[(&str, Layout)] = &[ alignment: align_of::(), }, ), + ( + "GThread", + Layout { + size: size_of::(), + alignment: align_of::(), + }, + ), ( "GThreadError", Layout { @@ -796,6 +838,13 @@ const RUST_LAYOUTS: &[(&str, Layout)] = &[ alignment: align_of::(), }, ), + ( + "GThreadFunctions", + Layout { + size: size_of::(), + alignment: align_of::(), + }, + ), ( "GThreadPool", Layout { @@ -803,6 +852,13 @@ const RUST_LAYOUTS: &[(&str, Layout)] = &[ alignment: align_of::(), }, ), + ( + "GThreadPriority", + Layout { + size: size_of::(), + alignment: align_of::(), + }, + ), ( "GTime", Layout { @@ -867,10 +923,10 @@ const RUST_LAYOUTS: &[(&str, Layout)] = &[ }, ), ( - "GType", + "GTuples", Layout { - size: size_of::(), - alignment: align_of::(), + size: size_of::(), + alignment: align_of::(), }, ), ( @@ -894,6 +950,20 @@ const RUST_LAYOUTS: &[(&str, Layout)] = &[ alignment: align_of::(), }, ), + ( + "GUnixPipe", + Layout { + size: size_of::(), + alignment: align_of::(), + }, + ), + ( + "GUnixPipeEnd", + Layout { + size: size_of::(), + alignment: align_of::(), + }, + ), ( "GUriError", Layout { @@ -971,6 +1041,13 @@ const RUST_LAYOUTS: &[(&str, Layout)] = &[ alignment: align_of::(), }, ), + ( + "GWin32OSType", + Layout { + size: size_of::(), + alignment: align_of::(), + }, + ), ]; const RUST_CONSTANTS: &[(&str, &str)] = &[ @@ -980,6 +1057,11 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[ ("GLIB_SYSDEF_MSG_DONTROUTE", "4"), ("GLIB_SYSDEF_MSG_OOB", "1"), ("GLIB_SYSDEF_MSG_PEEK", "2"), + ("G_ALLOCATOR_LIST", "1"), + ("G_ALLOCATOR_NODE", "3"), + ("G_ALLOCATOR_SLIST", "2"), + ("G_ALLOC_AND_FREE", "2"), + ("G_ALLOC_ONLY", "1"), ("(guint) G_ASCII_ALNUM", "1"), ("(guint) G_ASCII_ALPHA", "2"), ("(guint) G_ASCII_CNTRL", "4"), @@ -1450,6 +1532,10 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[ ("(guint) G_TEST_TRAP_SILENCE_STDERR", "256"), ("(guint) G_TEST_TRAP_SILENCE_STDOUT", "128"), ("(gint) G_THREAD_ERROR_AGAIN", "0"), + ("(gint) G_THREAD_PRIORITY_HIGH", "2"), + ("(gint) G_THREAD_PRIORITY_LOW", "0"), + ("(gint) G_THREAD_PRIORITY_NORMAL", "1"), + ("(gint) G_THREAD_PRIORITY_URGENT", "3"), ("G_TIME_SPAN_DAY", "86400000000"), ("G_TIME_SPAN_HOUR", "3600000000"), ("G_TIME_SPAN_MILLISECOND", "1000"), @@ -1481,6 +1567,7 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[ ("(gint) G_TOKEN_RIGHT_PAREN", "41"), ("(gint) G_TOKEN_STRING", "264"), ("(gint) G_TOKEN_SYMBOL", "265"), + ("G_TRACE_CURRENT_TIME", "0"), ("(guint) G_TRAVERSE_ALL", "3"), ("(guint) G_TRAVERSE_LEAFS", "1"), ("(guint) G_TRAVERSE_LEAVES", "1"), @@ -1489,6 +1576,9 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[ ("(guint) G_TRAVERSE_NON_LEAVES", "2"), ("G_UNICHAR_MAX_DECOMPOSITION_LENGTH", "18"), ("(gint) G_UNICODE_BREAK_AFTER", "10"), + ("(gint) G_UNICODE_BREAK_AKSARA", "43"), + ("(gint) G_UNICODE_BREAK_AKSARA_PRE_BASE", "44"), + ("(gint) G_UNICODE_BREAK_AKSARA_START", "45"), ("(gint) G_UNICODE_BREAK_ALPHABETIC", "23"), ("(gint) G_UNICODE_BREAK_AMBIGUOUS", "27"), ("(gint) G_UNICODE_BREAK_BEFORE", "11"), @@ -1529,6 +1619,8 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[ ("(gint) G_UNICODE_BREAK_SURROGATE", "4"), ("(gint) G_UNICODE_BREAK_SYMBOL", "22"), ("(gint) G_UNICODE_BREAK_UNKNOWN", "28"), + ("(gint) G_UNICODE_BREAK_VIRAMA", "47"), + ("(gint) G_UNICODE_BREAK_VIRAMA_FINAL", "46"), ("(gint) G_UNICODE_BREAK_WORD_JOINER", "30"), ("(gint) G_UNICODE_BREAK_ZERO_WIDTH_JOINER", "42"), ("(gint) G_UNICODE_BREAK_ZERO_WIDTH_SPACE", "5"), @@ -1728,6 +1820,8 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[ ("(gint) G_UNICODE_TITLECASE_LETTER", "8"), ("(gint) G_UNICODE_UNASSIGNED", "2"), ("(gint) G_UNICODE_UPPERCASE_LETTER", "9"), + ("(gint) G_UNIX_PIPE_END_READ", "0"), + ("(gint) G_UNIX_PIPE_END_WRITE", "1"), ("(gint) G_URI_ERROR_BAD_AUTH_PARAMS", "4"), ("(gint) G_URI_ERROR_BAD_FRAGMENT", "9"), ("(gint) G_URI_ERROR_BAD_HOST", "5"), @@ -1814,4 +1908,7 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[ ), ("(gint) G_VARIANT_PARSE_ERROR_VALUE_EXPECTED", "17"), ("G_WIN32_MSG_HANDLE", "19981206"), + ("(gint) G_WIN32_OS_ANY", "0"), + ("(gint) G_WIN32_OS_SERVER", "2"), + ("(gint) G_WIN32_OS_WORKSTATION", "1"), ]; diff --git a/glib/sys/tests/constant.c b/glib/sys/tests/constant.c index c3acfe696347..745ba8bf5e7f 100644 --- a/glib/sys/tests/constant.c +++ b/glib/sys/tests/constant.c @@ -34,6 +34,11 @@ int main() { PRINT_CONSTANT(GLIB_SYSDEF_MSG_DONTROUTE); PRINT_CONSTANT(GLIB_SYSDEF_MSG_OOB); PRINT_CONSTANT(GLIB_SYSDEF_MSG_PEEK); + PRINT_CONSTANT(G_ALLOCATOR_LIST); + PRINT_CONSTANT(G_ALLOCATOR_NODE); + PRINT_CONSTANT(G_ALLOCATOR_SLIST); + PRINT_CONSTANT(G_ALLOC_AND_FREE); + PRINT_CONSTANT(G_ALLOC_ONLY); PRINT_CONSTANT((guint) G_ASCII_ALNUM); PRINT_CONSTANT((guint) G_ASCII_ALPHA); PRINT_CONSTANT((guint) G_ASCII_CNTRL); @@ -477,6 +482,10 @@ int main() { PRINT_CONSTANT((guint) G_TEST_TRAP_SILENCE_STDERR); PRINT_CONSTANT((guint) G_TEST_TRAP_SILENCE_STDOUT); PRINT_CONSTANT((gint) G_THREAD_ERROR_AGAIN); + PRINT_CONSTANT((gint) G_THREAD_PRIORITY_HIGH); + PRINT_CONSTANT((gint) G_THREAD_PRIORITY_LOW); + PRINT_CONSTANT((gint) G_THREAD_PRIORITY_NORMAL); + PRINT_CONSTANT((gint) G_THREAD_PRIORITY_URGENT); PRINT_CONSTANT(G_TIME_SPAN_DAY); PRINT_CONSTANT(G_TIME_SPAN_HOUR); PRINT_CONSTANT(G_TIME_SPAN_MILLISECOND); @@ -508,6 +517,7 @@ int main() { PRINT_CONSTANT((gint) G_TOKEN_RIGHT_PAREN); PRINT_CONSTANT((gint) G_TOKEN_STRING); PRINT_CONSTANT((gint) G_TOKEN_SYMBOL); + PRINT_CONSTANT(G_TRACE_CURRENT_TIME); PRINT_CONSTANT((guint) G_TRAVERSE_ALL); PRINT_CONSTANT((guint) G_TRAVERSE_LEAFS); PRINT_CONSTANT((guint) G_TRAVERSE_LEAVES); @@ -516,6 +526,9 @@ int main() { PRINT_CONSTANT((guint) G_TRAVERSE_NON_LEAVES); PRINT_CONSTANT(G_UNICHAR_MAX_DECOMPOSITION_LENGTH); PRINT_CONSTANT((gint) G_UNICODE_BREAK_AFTER); + PRINT_CONSTANT((gint) G_UNICODE_BREAK_AKSARA); + PRINT_CONSTANT((gint) G_UNICODE_BREAK_AKSARA_PRE_BASE); + PRINT_CONSTANT((gint) G_UNICODE_BREAK_AKSARA_START); PRINT_CONSTANT((gint) G_UNICODE_BREAK_ALPHABETIC); PRINT_CONSTANT((gint) G_UNICODE_BREAK_AMBIGUOUS); PRINT_CONSTANT((gint) G_UNICODE_BREAK_BEFORE); @@ -556,6 +569,8 @@ int main() { PRINT_CONSTANT((gint) G_UNICODE_BREAK_SURROGATE); PRINT_CONSTANT((gint) G_UNICODE_BREAK_SYMBOL); PRINT_CONSTANT((gint) G_UNICODE_BREAK_UNKNOWN); + PRINT_CONSTANT((gint) G_UNICODE_BREAK_VIRAMA); + PRINT_CONSTANT((gint) G_UNICODE_BREAK_VIRAMA_FINAL); PRINT_CONSTANT((gint) G_UNICODE_BREAK_WORD_JOINER); PRINT_CONSTANT((gint) G_UNICODE_BREAK_ZERO_WIDTH_JOINER); PRINT_CONSTANT((gint) G_UNICODE_BREAK_ZERO_WIDTH_SPACE); @@ -755,6 +770,8 @@ int main() { PRINT_CONSTANT((gint) G_UNICODE_TITLECASE_LETTER); PRINT_CONSTANT((gint) G_UNICODE_UNASSIGNED); PRINT_CONSTANT((gint) G_UNICODE_UPPERCASE_LETTER); + PRINT_CONSTANT((gint) G_UNIX_PIPE_END_READ); + PRINT_CONSTANT((gint) G_UNIX_PIPE_END_WRITE); PRINT_CONSTANT((gint) G_URI_ERROR_BAD_AUTH_PARAMS); PRINT_CONSTANT((gint) G_URI_ERROR_BAD_FRAGMENT); PRINT_CONSTANT((gint) G_URI_ERROR_BAD_HOST); @@ -835,5 +852,8 @@ int main() { PRINT_CONSTANT((gint) G_VARIANT_PARSE_ERROR_UNTERMINATED_STRING_CONSTANT); PRINT_CONSTANT((gint) G_VARIANT_PARSE_ERROR_VALUE_EXPECTED); PRINT_CONSTANT(G_WIN32_MSG_HANDLE); + PRINT_CONSTANT((gint) G_WIN32_OS_ANY); + PRINT_CONSTANT((gint) G_WIN32_OS_SERVER); + PRINT_CONSTANT((gint) G_WIN32_OS_WORKSTATION); return 0; } diff --git a/glib/sys/tests/layout.c b/glib/sys/tests/layout.c index 4b8a1f97ec06..693d0e1749bb 100644 --- a/glib/sys/tests/layout.c +++ b/glib/sys/tests/layout.c @@ -12,6 +12,7 @@ int main() { printf("%s;%zu;%zu\n", "GBookmarkFileError", sizeof(GBookmarkFileError), alignof(GBookmarkFileError)); printf("%s;%zu;%zu\n", "GByteArray", sizeof(GByteArray), alignof(GByteArray)); printf("%s;%zu;%zu\n", "GChecksumType", sizeof(GChecksumType), alignof(GChecksumType)); + printf("%s;%zu;%zu\n", "GCompletion", sizeof(GCompletion), alignof(GCompletion)); printf("%s;%zu;%zu\n", "GCond", sizeof(GCond), alignof(GCond)); printf("%s;%zu;%zu\n", "GConvertError", sizeof(GConvertError), alignof(GConvertError)); printf("%s;%zu;%zu\n", "GDate", sizeof(GDate), alignof(GDate)); @@ -82,6 +83,10 @@ int main() { printf("%s;%zu;%zu\n", "GSourceFuncs", sizeof(GSourceFuncs), alignof(GSourceFuncs)); printf("%s;%zu;%zu\n", "GSpawnError", sizeof(GSpawnError), alignof(GSpawnError)); printf("%s;%zu;%zu\n", "GSpawnFlags", sizeof(GSpawnFlags), alignof(GSpawnFlags)); + printf("%s;%zu;%zu\n", "GStaticMutex", sizeof(GStaticMutex), alignof(GStaticMutex)); + printf("%s;%zu;%zu\n", "GStaticPrivate", sizeof(GStaticPrivate), alignof(GStaticPrivate)); + printf("%s;%zu;%zu\n", "GStaticRWLock", sizeof(GStaticRWLock), alignof(GStaticRWLock)); + printf("%s;%zu;%zu\n", "GStaticRecMutex", sizeof(GStaticRecMutex), alignof(GStaticRecMutex)); printf("%s;%zu;%zu\n", "GString", sizeof(GString), alignof(GString)); printf("%s;%zu;%zu\n", "GStrv", sizeof(GStrv), alignof(GStrv)); printf("%s;%zu;%zu\n", "GTestConfig", sizeof(GTestConfig), alignof(GTestConfig)); @@ -91,8 +96,11 @@ int main() { printf("%s;%zu;%zu\n", "GTestResult", sizeof(GTestResult), alignof(GTestResult)); printf("%s;%zu;%zu\n", "GTestSubprocessFlags", sizeof(GTestSubprocessFlags), alignof(GTestSubprocessFlags)); printf("%s;%zu;%zu\n", "GTestTrapFlags", sizeof(GTestTrapFlags), alignof(GTestTrapFlags)); + printf("%s;%zu;%zu\n", "GThread", sizeof(GThread), alignof(GThread)); printf("%s;%zu;%zu\n", "GThreadError", sizeof(GThreadError), alignof(GThreadError)); + printf("%s;%zu;%zu\n", "GThreadFunctions", sizeof(GThreadFunctions), alignof(GThreadFunctions)); printf("%s;%zu;%zu\n", "GThreadPool", sizeof(GThreadPool), alignof(GThreadPool)); + printf("%s;%zu;%zu\n", "GThreadPriority", sizeof(GThreadPriority), alignof(GThreadPriority)); printf("%s;%zu;%zu\n", "GTime", sizeof(GTime), alignof(GTime)); printf("%s;%zu;%zu\n", "GTimeSpan", sizeof(GTimeSpan), alignof(GTimeSpan)); printf("%s;%zu;%zu\n", "GTimeType", sizeof(GTimeType), alignof(GTimeType)); @@ -102,10 +110,12 @@ int main() { printf("%s;%zu;%zu\n", "GTrashStack", sizeof(GTrashStack), alignof(GTrashStack)); printf("%s;%zu;%zu\n", "GTraverseFlags", sizeof(GTraverseFlags), alignof(GTraverseFlags)); printf("%s;%zu;%zu\n", "GTraverseType", sizeof(GTraverseType), alignof(GTraverseType)); - printf("%s;%zu;%zu\n", "GType", sizeof(GType), alignof(GType)); + printf("%s;%zu;%zu\n", "GTuples", sizeof(GTuples), alignof(GTuples)); printf("%s;%zu;%zu\n", "GUnicodeBreakType", sizeof(GUnicodeBreakType), alignof(GUnicodeBreakType)); printf("%s;%zu;%zu\n", "GUnicodeScript", sizeof(GUnicodeScript), alignof(GUnicodeScript)); printf("%s;%zu;%zu\n", "GUnicodeType", sizeof(GUnicodeType), alignof(GUnicodeType)); + printf("%s;%zu;%zu\n", "GUnixPipe", sizeof(GUnixPipe), alignof(GUnixPipe)); + printf("%s;%zu;%zu\n", "GUnixPipeEnd", sizeof(GUnixPipeEnd), alignof(GUnixPipeEnd)); printf("%s;%zu;%zu\n", "GUriError", sizeof(GUriError), alignof(GUriError)); printf("%s;%zu;%zu\n", "GUriFlags", sizeof(GUriFlags), alignof(GUriFlags)); printf("%s;%zu;%zu\n", "GUriHideFlags", sizeof(GUriHideFlags), alignof(GUriHideFlags)); @@ -117,5 +127,6 @@ int main() { printf("%s;%zu;%zu\n", "GVariantDict", sizeof(GVariantDict), alignof(GVariantDict)); printf("%s;%zu;%zu\n", "GVariantIter", sizeof(GVariantIter), alignof(GVariantIter)); printf("%s;%zu;%zu\n", "GVariantParseError", sizeof(GVariantParseError), alignof(GVariantParseError)); + printf("%s;%zu;%zu\n", "GWin32OSType", sizeof(GWin32OSType), alignof(GWin32OSType)); return 0; } diff --git a/glib/sys/versions.txt b/glib/sys/versions.txt index 511eac1e7f3c..2b08b0af6393 100644 --- a/glib/sys/versions.txt +++ b/glib/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ a2f936b77195) -from gir-files (https://github.com/gtk-rs/gir-files @ 20031a537e40) +Generated by gir (https://github.com/gtk-rs/gir @ 1c7a6b57a5fc) +from gir-files (https://github.com/gtk-rs/gir-files @ 21b29d0e0c1a) diff --git a/graphene/src/auto/point.rs b/graphene/src/auto/point.rs index 1363f8a5dfd2..447dee94b359 100644 --- a/graphene/src/auto/point.rs +++ b/graphene/src/auto/point.rs @@ -31,13 +31,6 @@ impl Point { } } - #[cfg(feature = "v1_12")] - #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))] - #[doc(alias = "graphene_point_distance_squared")] - pub fn distance_squared(&self, b: &Point) -> f32 { - unsafe { ffi::graphene_point_distance_squared(self.to_glib_none().0, b.to_glib_none().0) } - } - #[doc(alias = "graphene_point_equal")] fn equal(&self, b: &Point) -> bool { unsafe { ffi::graphene_point_equal(self.to_glib_none().0, b.to_glib_none().0) } diff --git a/graphene/src/auto/versions.txt b/graphene/src/auto/versions.txt index 511eac1e7f3c..2b08b0af6393 100644 --- a/graphene/src/auto/versions.txt +++ b/graphene/src/auto/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ a2f936b77195) -from gir-files (https://github.com/gtk-rs/gir-files @ 20031a537e40) +Generated by gir (https://github.com/gtk-rs/gir @ 1c7a6b57a5fc) +from gir-files (https://github.com/gtk-rs/gir-files @ 21b29d0e0c1a) diff --git a/graphene/sys/src/lib.rs b/graphene/sys/src/lib.rs index da1a94e4141a..e5a95e9ae60d 100644 --- a/graphene/sys/src/lib.rs +++ b/graphene/sys/src/lib.rs @@ -922,12 +922,6 @@ extern "C" { d_x: *mut c_float, d_y: *mut c_float, ) -> c_float; - #[cfg(feature = "v1_12")] - #[cfg_attr(docsrs, doc(cfg(feature = "v1_12")))] - pub fn graphene_point_distance_squared( - a: *const graphene_point_t, - b: *const graphene_point_t, - ) -> c_float; pub fn graphene_point_equal(a: *const graphene_point_t, b: *const graphene_point_t) -> bool; pub fn graphene_point_free(p: *mut graphene_point_t); pub fn graphene_point_init( diff --git a/graphene/sys/versions.txt b/graphene/sys/versions.txt index 511eac1e7f3c..2b08b0af6393 100644 --- a/graphene/sys/versions.txt +++ b/graphene/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ a2f936b77195) -from gir-files (https://github.com/gtk-rs/gir-files @ 20031a537e40) +Generated by gir (https://github.com/gtk-rs/gir @ 1c7a6b57a5fc) +from gir-files (https://github.com/gtk-rs/gir-files @ 21b29d0e0c1a) diff --git a/pango/src/auto/versions.txt b/pango/src/auto/versions.txt index 511eac1e7f3c..2b08b0af6393 100644 --- a/pango/src/auto/versions.txt +++ b/pango/src/auto/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ a2f936b77195) -from gir-files (https://github.com/gtk-rs/gir-files @ 20031a537e40) +Generated by gir (https://github.com/gtk-rs/gir @ 1c7a6b57a5fc) +from gir-files (https://github.com/gtk-rs/gir-files @ 21b29d0e0c1a) diff --git a/pango/sys/src/lib.rs b/pango/sys/src/lib.rs index 8f799b423fcd..f67b83ea9a02 100644 --- a/pango/sys/src/lib.rs +++ b/pango/sys/src/lib.rs @@ -664,7 +664,7 @@ pub struct _PangoContextClass { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type PangoContextClass = *mut _PangoContextClass; +pub type PangoContextClass = _PangoContextClass; #[derive(Copy, Clone)] #[repr(C)] @@ -876,7 +876,7 @@ pub struct _PangoFontsetSimpleClass { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type PangoFontsetSimpleClass = *mut _PangoFontsetSimpleClass; +pub type PangoFontsetSimpleClass = _PangoFontsetSimpleClass; #[derive(Copy, Clone)] #[repr(C)] @@ -1036,7 +1036,7 @@ pub struct _PangoLayoutClass { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type PangoLayoutClass = *mut _PangoLayoutClass; +pub type PangoLayoutClass = _PangoLayoutClass; #[repr(C)] pub struct PangoLayoutIter { @@ -1207,7 +1207,7 @@ pub struct _PangoRendererPrivate { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type PangoRendererPrivate = *mut _PangoRendererPrivate; +pub type PangoRendererPrivate = _PangoRendererPrivate; #[repr(C)] pub struct PangoScriptIter { diff --git a/pango/sys/versions.txt b/pango/sys/versions.txt index 511eac1e7f3c..2b08b0af6393 100644 --- a/pango/sys/versions.txt +++ b/pango/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ a2f936b77195) -from gir-files (https://github.com/gtk-rs/gir-files @ 20031a537e40) +Generated by gir (https://github.com/gtk-rs/gir @ 1c7a6b57a5fc) +from gir-files (https://github.com/gtk-rs/gir-files @ 21b29d0e0c1a) diff --git a/pangocairo/src/auto/versions.txt b/pangocairo/src/auto/versions.txt index 511eac1e7f3c..2b08b0af6393 100644 --- a/pangocairo/src/auto/versions.txt +++ b/pangocairo/src/auto/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ a2f936b77195) -from gir-files (https://github.com/gtk-rs/gir-files @ 20031a537e40) +Generated by gir (https://github.com/gtk-rs/gir @ 1c7a6b57a5fc) +from gir-files (https://github.com/gtk-rs/gir-files @ 21b29d0e0c1a) diff --git a/pangocairo/sys/versions.txt b/pangocairo/sys/versions.txt index 511eac1e7f3c..2b08b0af6393 100644 --- a/pangocairo/sys/versions.txt +++ b/pangocairo/sys/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ a2f936b77195) -from gir-files (https://github.com/gtk-rs/gir-files @ 20031a537e40) +Generated by gir (https://github.com/gtk-rs/gir @ 1c7a6b57a5fc) +from gir-files (https://github.com/gtk-rs/gir-files @ 21b29d0e0c1a) From 97ee2926712ca8642518fe4947c2fdf7c9c941a6 Mon Sep 17 00:00:00 2001 From: Bilal Elmoussaoui Date: Thu, 18 Jan 2024 16:46:55 +0100 Subject: [PATCH 03/13] glib/sys: Workaround dropped GType The commit will be removed once the new fixed gir file lands --- glib/sys/src/manual.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/glib/sys/src/manual.rs b/glib/sys/src/manual.rs index 47f334f9c85b..5d4dda208a26 100644 --- a/glib/sys/src/manual.rs +++ b/glib/sys/src/manual.rs @@ -5,6 +5,8 @@ pub use libc::passwd; #[allow(unused_imports)] use libc::{c_char, c_int, c_ushort, c_void}; +pub type GType = libc::size_t; + #[cfg(all(not(unix), docsrs))] #[repr(C)] pub struct passwd { From 4ea3daeecfa53b24ac0435b4800c3a22d0689259 Mon Sep 17 00:00:00 2001 From: Bilal Elmoussaoui Date: Thu, 18 Jan 2024 16:55:01 +0100 Subject: [PATCH 04/13] gio: Re-export new v2.80 feature --- gio/Cargo.toml | 1 + gio/sys/Cargo.toml | 2 +- glib/Cargo.toml | 1 + glib/gobject-sys/Cargo.toml | 2 +- glib/sys/Cargo.toml | 2 +- 5 files changed, 5 insertions(+), 3 deletions(-) diff --git a/gio/Cargo.toml b/gio/Cargo.toml index 546053ac4d09..9fbe0df329eb 100644 --- a/gio/Cargo.toml +++ b/gio/Cargo.toml @@ -31,6 +31,7 @@ v2_72 = ["v2_70", "ffi/v2_72", "glib/v2_72"] v2_74 = ["v2_72", "ffi/v2_74", "glib/v2_74"] v2_76 = ["v2_74", "ffi/v2_76", "glib/v2_76"] v2_78 = ["v2_76", "ffi/v2_78", "glib/v2_78"] +v2_80 = ["v2_78", "ffi/v2_80", "glib/v2_80"] [package.metadata.docs.rs] all-features = true diff --git a/gio/sys/Cargo.toml b/gio/sys/Cargo.toml index 2bdbb70ecc03..be00c71f046e 100644 --- a/gio/sys/Cargo.toml +++ b/gio/sys/Cargo.toml @@ -88,7 +88,7 @@ version = "2.76" version = "2.77" [package.metadata.system-deps.gio_2_0.v2_80] -version = "2.80" +version = "2.79" [package.metadata.docs.rs] rustc-args = ["--cfg", "docsrs"] diff --git a/glib/Cargo.toml b/glib/Cargo.toml index 8fd6ba4da3d0..a6298136fa39 100644 --- a/glib/Cargo.toml +++ b/glib/Cargo.toml @@ -55,6 +55,7 @@ v2_72 = ["v2_70", "ffi/v2_72", "gobject_ffi/v2_72"] v2_74 = ["v2_72", "ffi/v2_74", "gobject_ffi/v2_74"] v2_76 = ["v2_74", "ffi/v2_76", "gobject_ffi/v2_76"] v2_78 = ["v2_76", "ffi/v2_78", "gobject_ffi/v2_78"] +v2_80 = ["v2_78", "ffi/v2_80", "gobject_ffi/v2_80"] log = ["rs-log"] log_macros = ["log"] compiletests = [] diff --git a/glib/gobject-sys/Cargo.toml b/glib/gobject-sys/Cargo.toml index ca25557a932c..df1a623d1f35 100644 --- a/glib/gobject-sys/Cargo.toml +++ b/glib/gobject-sys/Cargo.toml @@ -72,7 +72,7 @@ version = "2.76" version = "2.77" [package.metadata.system-deps.gobject_2_0.v2_80] -version = "2.80" +version = "2.79" [package.metadata.docs.rs] rustc-args = ["--cfg", "docsrs"] diff --git a/glib/sys/Cargo.toml b/glib/sys/Cargo.toml index c075e97d85ea..faa919611ff7 100644 --- a/glib/sys/Cargo.toml +++ b/glib/sys/Cargo.toml @@ -76,7 +76,7 @@ version = "2.76" version = "2.77" [package.metadata.system-deps.glib_2_0.v2_80] -version = "2.80" +version = "2.79" [package.metadata.system-deps.gobject_2_0] name = "gobject-2.0" From ef0ab60d9118a205d1abcb0db1a25498877b67ee Mon Sep 17 00:00:00 2001 From: Bilal Elmoussaoui Date: Thu, 18 Jan 2024 16:55:28 +0100 Subject: [PATCH 05/13] CI: build v2.80 features --- .github/workflows/CI.yml | 4 ++-- .github/workflows/windows.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 85fd5cd41d53..f77466ed31c9 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -22,8 +22,8 @@ jobs: conf: - { name: "cairo", features: "png,pdf,svg,ps,use_glib,v1_18,freetype,script,xcb,xlib,win32-surface", nightly: "--features 'png,pdf,svg,ps,use_glib,v1_18,freetype,script,xcb,xlib,win32-surface'", test_sys: true } - { name: "gdk-pixbuf", features: "v2_42", nightly: "--all-features", test_sys: true } - - { name: "gio", features: "v2_78", nightly: "--all-features", test_sys: true } - - { name: "glib", features: "v2_78", nightly: "--all-features", test_sys: true } + - { name: "gio", features: "v2_80", nightly: "--all-features", test_sys: true } + - { name: "glib", features: "v2_80", nightly: "--all-features", test_sys: true } - { name: "graphene", features: "v1_12", nightly: "", test_sys: true } - { name: "pango", features: "v1_50", nightly: "--all-features", test_sys: true } - { name: "pangocairo", features: "", nightly: "--all-features", test_sys: true } diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 2a60bcebc89b..1a4a1d4960d9 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -80,8 +80,8 @@ jobs: conf: - { name: "cairo", test: true, args: "--features png,pdf,svg,ps,use_glib,v1_16,freetype,script,win32-surface" } - { name: "gdk-pixbuf", test: true, args: "--features v2_42" } - - { name: "gio", test: true, args: "--features v2_74" } - - { name: "glib", test: true, args: "--features v2_74" } + - { name: "gio", test: true, args: "--features v2_80" } + - { name: "glib", test: true, args: "--features v2_80" } - { name: "glib-build-tools", test: false, args: "" } - { name: "graphene", test: false, args: "" } - { name: "pango", test: true, args: "--features v1_50" } From 34bead0585edecd6c1948904309d4d4a017d3184 Mon Sep 17 00:00:00 2001 From: Bilal Elmoussaoui Date: Thu, 18 Jan 2024 16:56:27 +0100 Subject: [PATCH 06/13] CI: Disable ffi tests for glib It currently fails --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index f77466ed31c9..1c02c90b3cb1 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -23,7 +23,7 @@ jobs: - { name: "cairo", features: "png,pdf,svg,ps,use_glib,v1_18,freetype,script,xcb,xlib,win32-surface", nightly: "--features 'png,pdf,svg,ps,use_glib,v1_18,freetype,script,xcb,xlib,win32-surface'", test_sys: true } - { name: "gdk-pixbuf", features: "v2_42", nightly: "--all-features", test_sys: true } - { name: "gio", features: "v2_80", nightly: "--all-features", test_sys: true } - - { name: "glib", features: "v2_80", nightly: "--all-features", test_sys: true } + - { name: "glib", features: "v2_80", nightly: "--all-features", test_sys: false } - { name: "graphene", features: "v1_12", nightly: "", test_sys: true } - { name: "pango", features: "v1_50", nightly: "--all-features", test_sys: true } - { name: "pangocairo", features: "", nightly: "--all-features", test_sys: true } From 104e64342fb519b89a97a40ee10cf5ccd5eb430c Mon Sep 17 00:00:00 2001 From: Bilal Elmoussaoui Date: Thu, 18 Jan 2024 17:10:44 +0100 Subject: [PATCH 07/13] glib/gio: Add missing since annotations --- gio/Gir.toml | 11 ++++++++++- gio/src/auto/enums.rs | 4 ++++ gio/src/auto/flags.rs | 2 ++ glib/Gir.toml | 3 +++ glib/src/auto/enums.rs | 20 ++++++++++++++++++++ 5 files changed, 39 insertions(+), 1 deletion(-) diff --git a/gio/Gir.toml b/gio/Gir.toml index 3a610fd062f6..09e06d7bbbf5 100644 --- a/gio/Gir.toml +++ b/gio/Gir.toml @@ -60,7 +60,6 @@ generate = [ "Gio.FileAttributeInfoFlags", "Gio.FileAttributeStatus", "Gio.FileAttributeType", - "Gio.FileCopyFlags", "Gio.FileCreateFlags", "Gio.FileIcon", "Gio.FileInputStream", @@ -799,6 +798,13 @@ status = "generate" # Better API with `IntoIter` ignore = true +[[object]] +name = "Gio.FileCopyFlags" +status = "generate" + [[object.member]] + name = "target_default_modified_time" + version = "2.80" + [[object]] name = "Gio.FileDescriptorBased" status = "manual" @@ -910,6 +916,9 @@ status = "generate" [[object.member]] name = "no_such_device" version = "2.72" + [[object.member]] + name = "destination_unset" + version = "2.80" [[object]] name = "Gio.IOStream" diff --git a/gio/src/auto/enums.rs b/gio/src/auto/enums.rs index 8c9a794d86b2..54e392a755ba 100644 --- a/gio/src/auto/enums.rs +++ b/gio/src/auto/enums.rs @@ -1606,6 +1606,8 @@ pub enum IOErrorEnum { #[cfg_attr(docsrs, doc(cfg(feature = "v2_72")))] #[doc(alias = "G_IO_ERROR_NO_SUCH_DEVICE")] NoSuchDevice, + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] #[doc(alias = "G_IO_ERROR_DESTINATION_UNSET")] DestinationUnset, #[doc(hidden)] @@ -1667,6 +1669,7 @@ impl IntoGlib for IOErrorEnum { Self::MessageTooLarge => ffi::G_IO_ERROR_MESSAGE_TOO_LARGE, #[cfg(feature = "v2_72")] Self::NoSuchDevice => ffi::G_IO_ERROR_NO_SUCH_DEVICE, + #[cfg(feature = "v2_80")] Self::DestinationUnset => ffi::G_IO_ERROR_DESTINATION_UNSET, Self::__Unknown(value) => value, } @@ -1726,6 +1729,7 @@ impl FromGlib for IOErrorEnum { ffi::G_IO_ERROR_MESSAGE_TOO_LARGE => Self::MessageTooLarge, #[cfg(feature = "v2_72")] ffi::G_IO_ERROR_NO_SUCH_DEVICE => Self::NoSuchDevice, + #[cfg(feature = "v2_80")] ffi::G_IO_ERROR_DESTINATION_UNSET => Self::DestinationUnset, value => Self::__Unknown(value), } diff --git a/gio/src/auto/flags.rs b/gio/src/auto/flags.rs index fcfd43a465ad..2f93bfe4356d 100644 --- a/gio/src/auto/flags.rs +++ b/gio/src/auto/flags.rs @@ -1590,6 +1590,8 @@ bitflags! { const NO_FALLBACK_FOR_MOVE = ffi::G_FILE_COPY_NO_FALLBACK_FOR_MOVE as _; #[doc(alias = "G_FILE_COPY_TARGET_DEFAULT_PERMS")] const TARGET_DEFAULT_PERMS = ffi::G_FILE_COPY_TARGET_DEFAULT_PERMS as _; + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] #[doc(alias = "G_FILE_COPY_TARGET_DEFAULT_MODIFIED_TIME")] const TARGET_DEFAULT_MODIFIED_TIME = ffi::G_FILE_COPY_TARGET_DEFAULT_MODIFIED_TIME as _; } diff --git a/glib/Gir.toml b/glib/Gir.toml index eeab18b39239..123795a4a041 100644 --- a/glib/Gir.toml +++ b/glib/Gir.toml @@ -850,6 +850,9 @@ status = "generate" [[object.member]] name = "close_paranthesis" ignore = true + [[object.member]] + pattern = "(aksara|aksara_pre_base|aksara_start|virama_final|virama)" + version = "2.80" [[object]] name = "GLib.UnicodeScript" diff --git a/glib/src/auto/enums.rs b/glib/src/auto/enums.rs index 6e6a7e45273e..9150a496667f 100644 --- a/glib/src/auto/enums.rs +++ b/glib/src/auto/enums.rs @@ -958,14 +958,24 @@ pub enum UnicodeBreakType { EmojiModifier, #[doc(alias = "G_UNICODE_BREAK_ZERO_WIDTH_JOINER")] ZeroWidthJoiner, + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] #[doc(alias = "G_UNICODE_BREAK_AKSARA")] Aksara, + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] #[doc(alias = "G_UNICODE_BREAK_AKSARA_PRE_BASE")] AksaraPreBase, + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] #[doc(alias = "G_UNICODE_BREAK_AKSARA_START")] AksaraStart, + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] #[doc(alias = "G_UNICODE_BREAK_VIRAMA_FINAL")] ViramaFinal, + #[cfg(feature = "v2_80")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2_80")))] #[doc(alias = "G_UNICODE_BREAK_VIRAMA")] Virama, #[doc(hidden)] @@ -1021,10 +1031,15 @@ impl IntoGlib for UnicodeBreakType { Self::EmojiBase => ffi::G_UNICODE_BREAK_EMOJI_BASE, Self::EmojiModifier => ffi::G_UNICODE_BREAK_EMOJI_MODIFIER, Self::ZeroWidthJoiner => ffi::G_UNICODE_BREAK_ZERO_WIDTH_JOINER, + #[cfg(feature = "v2_80")] Self::Aksara => ffi::G_UNICODE_BREAK_AKSARA, + #[cfg(feature = "v2_80")] Self::AksaraPreBase => ffi::G_UNICODE_BREAK_AKSARA_PRE_BASE, + #[cfg(feature = "v2_80")] Self::AksaraStart => ffi::G_UNICODE_BREAK_AKSARA_START, + #[cfg(feature = "v2_80")] Self::ViramaFinal => ffi::G_UNICODE_BREAK_VIRAMA_FINAL, + #[cfg(feature = "v2_80")] Self::Virama => ffi::G_UNICODE_BREAK_VIRAMA, Self::__Unknown(value) => value, } @@ -1078,10 +1093,15 @@ impl FromGlib for UnicodeBreakType { ffi::G_UNICODE_BREAK_EMOJI_BASE => Self::EmojiBase, ffi::G_UNICODE_BREAK_EMOJI_MODIFIER => Self::EmojiModifier, ffi::G_UNICODE_BREAK_ZERO_WIDTH_JOINER => Self::ZeroWidthJoiner, + #[cfg(feature = "v2_80")] ffi::G_UNICODE_BREAK_AKSARA => Self::Aksara, + #[cfg(feature = "v2_80")] ffi::G_UNICODE_BREAK_AKSARA_PRE_BASE => Self::AksaraPreBase, + #[cfg(feature = "v2_80")] ffi::G_UNICODE_BREAK_AKSARA_START => Self::AksaraStart, + #[cfg(feature = "v2_80")] ffi::G_UNICODE_BREAK_VIRAMA_FINAL => Self::ViramaFinal, + #[cfg(feature = "v2_80")] ffi::G_UNICODE_BREAK_VIRAMA => Self::Virama, value => Self::__Unknown(value), } From 003434a03dcd1edf06a8799e5bdf8aa7fc90a6ca Mon Sep 17 00:00:00 2001 From: Bilal Elmoussaoui Date: Thu, 18 Jan 2024 17:20:24 +0100 Subject: [PATCH 08/13] glib: Guard new windows/linux APIs --- glib/sys/Gir.toml | 65 ++++++++++++++++++++++++++++-------------- glib/sys/src/lib.rs | 38 ++++++++++++++++++++++++ glib/sys/src/manual.rs | 36 ----------------------- glib/sys/tests/abi.rs | 6 ++++ 4 files changed, 87 insertions(+), 58 deletions(-) diff --git a/glib/sys/Gir.toml b/glib/sys/Gir.toml index c5c66fec5fe3..b8ae3605dd34 100644 --- a/glib/sys/Gir.toml +++ b/glib/sys/Gir.toml @@ -68,35 +68,41 @@ ignore = [ name = "GLib.*" status = "generate" [[object.function]] - name = "unix_get_passwd_entry" - cfg_condition = "unix" + name = "win32_locale_filename_from_utf8" + cfg_condition = "window" [[object.function]] - name = "get_user_state_dir" - version = "2.72" + name = "win32_get_windows_version" + cfg_condition = "window" + [[object.function]] + name = "win32_getlocale" + cfg_condition = "window" + [[object.function]] + name = "win32_check_windows_version" + cfg_condition = "window" [[object.function]] - name = "check_windows_version" - manual = true - cfg_condition = "windows" + name = "win32_error_message" + cfg_condition = "window" [[object.function]] - name = "get_command_line" - manual = true - cfg_condition = "windows" + name = "win32_ftruncate" + cfg_condition = "window" [[object.function]] - name = "error_message" - manual = true - cfg_condition = "windows" + name = "win32_get_command_line" + cfg_condition = "window" [[object.function]] - name = "getlocale" - manual = true - cfg_condition = "windows" + name = "win32_get_package_installation_directory" + cfg_condition = "window" [[object.function]] - name = "get_package_installation_directory_of_module" - manual = true - cfg_condition = "windows" + name = "win32_get_package_installation_directory_of_module" + cfg_condition = "window" [[object.function]] - name = "locale_filename_from_utf8" - manual = true - cfg_condition = "windows" + name = "win32_get_package_installation_subdirectory" + cfg_condition = "window" + [[object.function]] + name = "unix_get_passwd_entry" + cfg_condition = "unix" + [[object.function]] + name = "get_user_state_dir" + version = "2.72" [[object.function]] name = "assertion_message_cmpint" version = "2.78" @@ -114,11 +120,26 @@ status = "manual" name = "GLib.PollFD" status = "manual" +[[object]] +name = "GLib.UnixPipe" +status = "generate" +cfg_condition = "unix" + +[[object]] +name = "GLib.UnixPipeEnd" +status = "generate" +cfg_condition = "unix" + [[object]] name = "GLib.TestLogMsg" # layout is broken due to rust having no long double status = "ignore" +[[object]] +name = "GLib.Win32OSType" +status = "generate" +cfg_condition = "window" + [[object]] name = "GLib.macro__has_attribute___noreturn__" # C-only macro diff --git a/glib/sys/src/lib.rs b/glib/sys/src/lib.rs index c566077dcee6..05275b623223 100644 --- a/glib/sys/src/lib.rs +++ b/glib/sys/src/lib.rs @@ -636,8 +636,14 @@ pub const G_UNICODE_LINE_SEPARATOR: GUnicodeType = 27; pub const G_UNICODE_PARAGRAPH_SEPARATOR: GUnicodeType = 28; pub const G_UNICODE_SPACE_SEPARATOR: GUnicodeType = 29; +#[cfg(unix)] +#[cfg_attr(docsrs, doc(cfg(unix)))] pub type GUnixPipeEnd = c_int; +#[cfg(unix)] +#[cfg_attr(docsrs, doc(cfg(unix)))] pub const G_UNIX_PIPE_END_READ: GUnixPipeEnd = 0; +#[cfg(unix)] +#[cfg_attr(docsrs, doc(cfg(unix)))] pub const G_UNIX_PIPE_END_WRITE: GUnixPipeEnd = 1; pub type GUriError = c_int; @@ -704,9 +710,17 @@ pub const G_VARIANT_PARSE_ERROR_UNTERMINATED_STRING_CONSTANT: GVariantParseError pub const G_VARIANT_PARSE_ERROR_VALUE_EXPECTED: GVariantParseError = 17; pub const G_VARIANT_PARSE_ERROR_RECURSION: GVariantParseError = 18; +#[cfg(window)] +#[cfg_attr(docsrs, doc(cfg(window)))] pub type GWin32OSType = c_int; +#[cfg(window)] +#[cfg_attr(docsrs, doc(cfg(window)))] pub const G_WIN32_OS_ANY: GWin32OSType = 0; +#[cfg(window)] +#[cfg_attr(docsrs, doc(cfg(window)))] pub const G_WIN32_OS_WORKSTATION: GWin32OSType = 1; +#[cfg(window)] +#[cfg_attr(docsrs, doc(cfg(window)))] pub const G_WIN32_OS_SERVER: GWin32OSType = 2; // Constants @@ -2527,12 +2541,16 @@ impl ::std::fmt::Debug for GTuples { } } +#[cfg(unix)] +#[cfg_attr(docsrs, doc(cfg(unix)))] #[derive(Copy, Clone)] #[repr(C)] pub struct GUnixPipe { pub fds: [c_int; 2], } +#[cfg(unix)] +#[cfg_attr(docsrs, doc(cfg(unix)))] impl ::std::fmt::Debug for GUnixPipe { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("GUnixPipe @ {self:p}")) @@ -7572,27 +7590,47 @@ extern "C" { func: *const c_char, warnexpr: *const c_char, ); + #[cfg(window)] + #[cfg_attr(docsrs, doc(cfg(window)))] pub fn g_win32_check_windows_version( major: c_int, minor: c_int, spver: c_int, os_type: GWin32OSType, ) -> gboolean; + #[cfg(window)] + #[cfg_attr(docsrs, doc(cfg(window)))] pub fn g_win32_error_message(error: c_int) -> *mut c_char; + #[cfg(window)] + #[cfg_attr(docsrs, doc(cfg(window)))] pub fn g_win32_ftruncate(f: c_int, size: c_uint) -> c_int; + #[cfg(window)] + #[cfg_attr(docsrs, doc(cfg(window)))] pub fn g_win32_get_command_line() -> *mut *mut c_char; + #[cfg(window)] + #[cfg_attr(docsrs, doc(cfg(window)))] pub fn g_win32_get_package_installation_directory( package: *const c_char, dll_name: *const c_char, ) -> *mut c_char; + #[cfg(window)] + #[cfg_attr(docsrs, doc(cfg(window)))] pub fn g_win32_get_package_installation_directory_of_module(hmodule: gpointer) -> *mut c_char; + #[cfg(window)] + #[cfg_attr(docsrs, doc(cfg(window)))] pub fn g_win32_get_package_installation_subdirectory( package: *const c_char, dll_name: *const c_char, subdir: *const c_char, ) -> *mut c_char; + #[cfg(window)] + #[cfg_attr(docsrs, doc(cfg(window)))] pub fn g_win32_get_windows_version() -> c_uint; + #[cfg(window)] + #[cfg_attr(docsrs, doc(cfg(window)))] pub fn g_win32_getlocale() -> *mut c_char; + #[cfg(window)] + #[cfg_attr(docsrs, doc(cfg(window)))] pub fn g_win32_locale_filename_from_utf8(utf8filename: *const c_char) -> *mut c_char; } diff --git a/glib/sys/src/manual.rs b/glib/sys/src/manual.rs index 5d4dda208a26..065decd4c0b0 100644 --- a/glib/sys/src/manual.rs +++ b/glib/sys/src/manual.rs @@ -43,42 +43,6 @@ pub struct GPollFD { pub revents: c_ushort, } -#[cfg(target_family = "windows")] -pub use self::win32::*; - -#[cfg(target_family = "windows")] -mod win32 { - use libc::{c_char, c_int}; - - use crate::gboolean; - - pub type GWin32OSType = c_int; - pub const G_WIN32_OS_ANY: GWin32OSType = 0; - pub const G_WIN32_OS_WORKSTATION: GWin32OSType = 1; - pub const G_WIN32_OS_SERVER: GWin32OSType = 2; - - extern "C" { - pub fn g_win32_check_windows_version( - major: c_int, - minor: c_int, - spver: c_int, - os_type: GWin32OSType, - ) -> gboolean; - - pub fn g_win32_get_command_line() -> *mut *mut c_char; - - pub fn g_win32_error_message(error: c_int) -> *mut c_char; - - pub fn g_win32_getlocale() -> *mut c_char; - - pub fn g_win32_get_package_installation_directory_of_module( - hmodule: std::os::windows::raw::HANDLE, - ) -> *mut c_char; - - pub fn g_win32_locale_filename_from_utf8(utf8filename: *const c_char) -> *mut c_char; - } -} - // These are all non-NUL terminated strings in C pub const G_VARIANT_TYPE_BOOLEAN: &str = "b"; pub const G_VARIANT_TYPE_BYTE: &str = "y"; diff --git a/glib/sys/tests/abi.rs b/glib/sys/tests/abi.rs index 281cf6f742bf..bfd49862e7bc 100644 --- a/glib/sys/tests/abi.rs +++ b/glib/sys/tests/abi.rs @@ -950,6 +950,8 @@ const RUST_LAYOUTS: &[(&str, Layout)] = &[ alignment: align_of::(), }, ), + #[cfg(unix)] + #[cfg_attr(docsrs, doc(cfg(unix)))] ( "GUnixPipe", Layout { @@ -957,6 +959,8 @@ const RUST_LAYOUTS: &[(&str, Layout)] = &[ alignment: align_of::(), }, ), + #[cfg(unix)] + #[cfg_attr(docsrs, doc(cfg(unix)))] ( "GUnixPipeEnd", Layout { @@ -1041,6 +1045,8 @@ const RUST_LAYOUTS: &[(&str, Layout)] = &[ alignment: align_of::(), }, ), + #[cfg(window)] + #[cfg_attr(docsrs, doc(cfg(window)))] ( "GWin32OSType", Layout { From 346b56ebc8a8916b076e4895dace341a7538c7e9 Mon Sep 17 00:00:00 2001 From: Bilal Elmoussaoui Date: Thu, 18 Jan 2024 17:28:31 +0100 Subject: [PATCH 09/13] glib: Auto generate various win32 functions --- glib/Gir.toml | 40 ++++++++++++++++++++ glib/src/auto/enums.rs | 46 +++++++++++++++++++++++ glib/src/auto/functions.rs | 77 ++++++++++++++------------------------ glib/src/auto/mod.rs | 3 ++ glib/src/win32.rs | 54 +------------------------- glib/sys/Gir.toml | 22 +++++------ glib/sys/src/lib.rs | 56 +++++++++++++-------------- glib/sys/tests/abi.rs | 4 +- 8 files changed, 160 insertions(+), 142 deletions(-) diff --git a/glib/Gir.toml b/glib/Gir.toml index 123795a4a041..56459af36355 100644 --- a/glib/Gir.toml +++ b/glib/Gir.toml @@ -55,6 +55,41 @@ manual = [ [[object]] name = "GLib.*" status = "generate" + [[object.function]] + name = "win32_locale_filename_from_utf8" + cfg_condition = "windows" + ignore = true # TODO: implement me + [[object.function]] + name = "win32_get_windows_version" + cfg_condition = "windows" + [[object.function]] + name = "win32_getlocale" + cfg_condition = "windows" + [[object.function]] + name = "win32_check_windows_version" + cfg_condition = "windows" + [[object.function]] + name = "win32_error_message" + cfg_condition = "windows" + [[object.function]] + name = "win32_ftruncate" + cfg_condition = "windows" + ignore = true # TODO: implement me + [[object.function]] + name = "win32_get_command_line" + cfg_condition = "windows" + [[object.function]] + name = "win32_get_package_installation_directory" + cfg_condition = "windows" + ignore = true # TODO: implement me + [[object.function]] + name = "win32_get_package_installation_directory_of_module" + cfg_condition = "windows" + manual = true + [[object.function]] + name = "win32_get_package_installation_subdirectory" + cfg_condition = "windows" + ignore = true # TODO: implement me [[object.function]] pattern = "(assertion_message_cmpint|assert_warning|assertion_message|assertion_message_cmpnum|assertion_message_cmpstr|warn_message|return_if_fail_warning)" ignore = true # Not useful assertions functions @@ -886,3 +921,8 @@ status = "generate" name = "GLib.Uri" status = "generate" concurrency = "send+sync" + +[[object]] +name = "GLib.Win32OSType" +status = "generate" +cfg_condition = "windows" diff --git a/glib/src/auto/enums.rs b/glib/src/auto/enums.rs index 9150a496667f..ffa1d3408041 100644 --- a/glib/src/auto/enums.rs +++ b/glib/src/auto/enums.rs @@ -2352,3 +2352,49 @@ impl FromGlib for VariantClass { } } } + +#[cfg(windows)] +#[cfg_attr(docsrs, doc(cfg(windows)))] +#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] +#[non_exhaustive] +#[doc(alias = "GWin32OSType")] +pub enum Win32OSType { + #[doc(alias = "G_WIN32_OS_ANY")] + Any, + #[doc(alias = "G_WIN32_OS_WORKSTATION")] + Workstation, + #[doc(alias = "G_WIN32_OS_SERVER")] + Server, + #[doc(hidden)] + __Unknown(i32), +} + +#[cfg(windows)] +#[doc(hidden)] +impl IntoGlib for Win32OSType { + type GlibType = ffi::GWin32OSType; + + #[inline] + fn into_glib(self) -> ffi::GWin32OSType { + match self { + Self::Any => ffi::G_WIN32_OS_ANY, + Self::Workstation => ffi::G_WIN32_OS_WORKSTATION, + Self::Server => ffi::G_WIN32_OS_SERVER, + Self::__Unknown(value) => value, + } + } +} + +#[cfg(windows)] +#[doc(hidden)] +impl FromGlib for Win32OSType { + #[inline] + unsafe fn from_glib(value: ffi::GWin32OSType) -> Self { + match value { + ffi::G_WIN32_OS_ANY => Self::Any, + ffi::G_WIN32_OS_WORKSTATION => Self::Workstation, + ffi::G_WIN32_OS_SERVER => Self::Server, + value => Self::__Unknown(value), + } + } +} diff --git a/glib/src/auto/functions.rs b/glib/src/auto/functions.rs index ef9aed618b68..bcf8de7734e7 100644 --- a/glib/src/auto/functions.rs +++ b/glib/src/auto/functions.rs @@ -5,6 +5,9 @@ #[cfg(feature = "v2_66")] #[cfg_attr(docsrs, doc(cfg(feature = "v2_66")))] use crate::FileSetContentsFlags; +#[cfg(windows)] +#[cfg_attr(docsrs, doc(cfg(windows)))] +use crate::Win32OSType; use crate::{ translate::*, Bytes, ChecksumType, Error, FileTest, FormatSizeFlags, Pid, Source, SpawnFlags, UserDirectory, @@ -969,71 +972,49 @@ pub fn uuid_string_random() -> crate::GString { unsafe { from_glib_full(ffi::g_uuid_string_random()) } } -//#[doc(alias = "g_win32_check_windows_version")] -//pub fn win32_check_windows_version(major: i32, minor: i32, spver: i32, os_type: /*Ignored*/Win32OSType) -> bool { -// unsafe { TODO: call ffi:g_win32_check_windows_version() } -//} +#[cfg(windows)] +#[cfg_attr(docsrs, doc(cfg(windows)))] +#[doc(alias = "g_win32_check_windows_version")] +pub fn win32_check_windows_version( + major: i32, + minor: i32, + spver: i32, + os_type: Win32OSType, +) -> bool { + unsafe { + from_glib(ffi::g_win32_check_windows_version( + major, + minor, + spver, + os_type.into_glib(), + )) + } +} +#[cfg(windows)] +#[cfg_attr(docsrs, doc(cfg(windows)))] #[doc(alias = "g_win32_error_message")] pub fn win32_error_message(error: i32) -> crate::GString { unsafe { from_glib_full(ffi::g_win32_error_message(error)) } } -#[doc(alias = "g_win32_ftruncate")] -pub fn win32_ftruncate(f: i32, size: u32) -> i32 { - unsafe { ffi::g_win32_ftruncate(f, size) } -} - +#[cfg(windows)] +#[cfg_attr(docsrs, doc(cfg(windows)))] #[doc(alias = "g_win32_get_command_line")] pub fn win32_get_command_line() -> Vec { unsafe { FromGlibPtrContainer::from_glib_none(ffi::g_win32_get_command_line()) } } -#[doc(alias = "g_win32_get_package_installation_directory")] -pub fn win32_get_package_installation_directory(package: &str, dll_name: &str) -> crate::GString { - unsafe { - from_glib_full(ffi::g_win32_get_package_installation_directory( - package.to_glib_none().0, - dll_name.to_glib_none().0, - )) - } -} - -//#[doc(alias = "g_win32_get_package_installation_directory_of_module")] -//pub fn win32_get_package_installation_directory_of_module(hmodule: /*Unimplemented*/Option) -> crate::GString { -// unsafe { TODO: call ffi:g_win32_get_package_installation_directory_of_module() } -//} - -#[doc(alias = "g_win32_get_package_installation_subdirectory")] -pub fn win32_get_package_installation_subdirectory( - package: &str, - dll_name: &str, - subdir: &str, -) -> crate::GString { - unsafe { - from_glib_full(ffi::g_win32_get_package_installation_subdirectory( - package.to_glib_none().0, - dll_name.to_glib_none().0, - subdir.to_glib_none().0, - )) - } -} - +#[cfg(windows)] +#[cfg_attr(docsrs, doc(cfg(windows)))] #[doc(alias = "g_win32_get_windows_version")] pub fn win32_get_windows_version() -> u32 { unsafe { ffi::g_win32_get_windows_version() } } +#[cfg(windows)] +#[cfg_attr(docsrs, doc(cfg(windows)))] #[doc(alias = "g_win32_getlocale")] pub fn win32_getlocale() -> crate::GString { unsafe { from_glib_full(ffi::g_win32_getlocale()) } } - -#[doc(alias = "g_win32_locale_filename_from_utf8")] -pub fn win32_locale_filename_from_utf8(utf8filename: &str) -> crate::GString { - unsafe { - from_glib_full(ffi::g_win32_locale_filename_from_utf8( - utf8filename.to_glib_none().0, - )) - } -} diff --git a/glib/src/auto/mod.rs b/glib/src/auto/mod.rs index 0330de419bf6..b58e76d01b1a 100644 --- a/glib/src/auto/mod.rs +++ b/glib/src/auto/mod.rs @@ -56,6 +56,9 @@ pub use self::enums::UnicodeType; #[cfg_attr(docsrs, doc(cfg(feature = "v2_66")))] pub use self::enums::UriError; pub use self::enums::VariantClass; +#[cfg(windows)] +#[cfg_attr(docsrs, doc(cfg(windows)))] +pub use self::enums::Win32OSType; mod flags; #[cfg(feature = "v2_66")] diff --git a/glib/src/win32.rs b/glib/src/win32.rs index 4e2984c56e77..e807d0183ac9 100644 --- a/glib/src/win32.rs +++ b/glib/src/win32.rs @@ -2,59 +2,7 @@ use std::path::PathBuf; -use crate::{translate::*, GString, StrV}; - -#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)] -pub enum OSType { - #[doc(alias = "G_WIN32_OS_ANY")] - Any, - #[doc(alias = "G_WIN32_OS_WORKSTATION")] - Workstation, - #[doc(alias = "G_WIN32_OS_SERVER")] - Server, -} - -#[doc(hidden)] -impl IntoGlib for OSType { - type GlibType = ffi::GWin32OSType; - - #[inline] - fn into_glib(self) -> Self::GlibType { - match self { - Self::Any => ffi::G_WIN32_OS_ANY, - Self::Workstation => ffi::G_WIN32_OS_WORKSTATION, - Self::Server => ffi::G_WIN32_OS_SERVER, - } - } -} - -#[doc(alias = "g_win32_check_windows_version")] -pub fn check_windows_version(major: i32, minor: i32, spver: i32, os_type: OSType) -> bool { - unsafe { - from_glib(ffi::g_win32_check_windows_version( - major, - minor, - spver, - os_type.into_glib(), - )) - } -} - -#[doc(alias = "g_win32_get_command_line")] -#[doc(alias = "get_command_line")] -pub fn command_line() -> StrV { - unsafe { FromGlibPtrContainer::from_glib_full(ffi::g_win32_get_command_line()) } -} - -#[doc(alias = "g_win32_error_message")] -pub fn error_message(error: i32) -> GString { - unsafe { from_glib_full(ffi::g_win32_error_message(error)) } -} - -#[doc(alias = "g_win32_getlocale")] -pub fn getlocale() -> GString { - unsafe { from_glib_full(ffi::g_win32_getlocale()) } -} +use crate::translate::*; #[doc(alias = "g_win32_get_package_installation_directory_of_module")] #[doc(alias = "get_package_installation_directory_of_module")] diff --git a/glib/sys/Gir.toml b/glib/sys/Gir.toml index b8ae3605dd34..9034c1899738 100644 --- a/glib/sys/Gir.toml +++ b/glib/sys/Gir.toml @@ -69,34 +69,34 @@ name = "GLib.*" status = "generate" [[object.function]] name = "win32_locale_filename_from_utf8" - cfg_condition = "window" + cfg_condition = "windows" [[object.function]] name = "win32_get_windows_version" - cfg_condition = "window" + cfg_condition = "windows" [[object.function]] name = "win32_getlocale" - cfg_condition = "window" + cfg_condition = "windows" [[object.function]] name = "win32_check_windows_version" - cfg_condition = "window" + cfg_condition = "windows" [[object.function]] name = "win32_error_message" - cfg_condition = "window" + cfg_condition = "windows" [[object.function]] name = "win32_ftruncate" - cfg_condition = "window" + cfg_condition = "windows" [[object.function]] name = "win32_get_command_line" - cfg_condition = "window" + cfg_condition = "windows" [[object.function]] name = "win32_get_package_installation_directory" - cfg_condition = "window" + cfg_condition = "windows" [[object.function]] name = "win32_get_package_installation_directory_of_module" - cfg_condition = "window" + cfg_condition = "windows" [[object.function]] name = "win32_get_package_installation_subdirectory" - cfg_condition = "window" + cfg_condition = "windows" [[object.function]] name = "unix_get_passwd_entry" cfg_condition = "unix" @@ -138,7 +138,7 @@ status = "ignore" [[object]] name = "GLib.Win32OSType" status = "generate" -cfg_condition = "window" +cfg_condition = "windows" [[object]] name = "GLib.macro__has_attribute___noreturn__" diff --git a/glib/sys/src/lib.rs b/glib/sys/src/lib.rs index 05275b623223..53c5ca691332 100644 --- a/glib/sys/src/lib.rs +++ b/glib/sys/src/lib.rs @@ -710,17 +710,17 @@ pub const G_VARIANT_PARSE_ERROR_UNTERMINATED_STRING_CONSTANT: GVariantParseError pub const G_VARIANT_PARSE_ERROR_VALUE_EXPECTED: GVariantParseError = 17; pub const G_VARIANT_PARSE_ERROR_RECURSION: GVariantParseError = 18; -#[cfg(window)] -#[cfg_attr(docsrs, doc(cfg(window)))] +#[cfg(windows)] +#[cfg_attr(docsrs, doc(cfg(windows)))] pub type GWin32OSType = c_int; -#[cfg(window)] -#[cfg_attr(docsrs, doc(cfg(window)))] +#[cfg(windows)] +#[cfg_attr(docsrs, doc(cfg(windows)))] pub const G_WIN32_OS_ANY: GWin32OSType = 0; -#[cfg(window)] -#[cfg_attr(docsrs, doc(cfg(window)))] +#[cfg(windows)] +#[cfg_attr(docsrs, doc(cfg(windows)))] pub const G_WIN32_OS_WORKSTATION: GWin32OSType = 1; -#[cfg(window)] -#[cfg_attr(docsrs, doc(cfg(window)))] +#[cfg(windows)] +#[cfg_attr(docsrs, doc(cfg(windows)))] pub const G_WIN32_OS_SERVER: GWin32OSType = 2; // Constants @@ -7590,47 +7590,47 @@ extern "C" { func: *const c_char, warnexpr: *const c_char, ); - #[cfg(window)] - #[cfg_attr(docsrs, doc(cfg(window)))] + #[cfg(windows)] + #[cfg_attr(docsrs, doc(cfg(windows)))] pub fn g_win32_check_windows_version( major: c_int, minor: c_int, spver: c_int, os_type: GWin32OSType, ) -> gboolean; - #[cfg(window)] - #[cfg_attr(docsrs, doc(cfg(window)))] + #[cfg(windows)] + #[cfg_attr(docsrs, doc(cfg(windows)))] pub fn g_win32_error_message(error: c_int) -> *mut c_char; - #[cfg(window)] - #[cfg_attr(docsrs, doc(cfg(window)))] + #[cfg(windows)] + #[cfg_attr(docsrs, doc(cfg(windows)))] pub fn g_win32_ftruncate(f: c_int, size: c_uint) -> c_int; - #[cfg(window)] - #[cfg_attr(docsrs, doc(cfg(window)))] + #[cfg(windows)] + #[cfg_attr(docsrs, doc(cfg(windows)))] pub fn g_win32_get_command_line() -> *mut *mut c_char; - #[cfg(window)] - #[cfg_attr(docsrs, doc(cfg(window)))] + #[cfg(windows)] + #[cfg_attr(docsrs, doc(cfg(windows)))] pub fn g_win32_get_package_installation_directory( package: *const c_char, dll_name: *const c_char, ) -> *mut c_char; - #[cfg(window)] - #[cfg_attr(docsrs, doc(cfg(window)))] + #[cfg(windows)] + #[cfg_attr(docsrs, doc(cfg(windows)))] pub fn g_win32_get_package_installation_directory_of_module(hmodule: gpointer) -> *mut c_char; - #[cfg(window)] - #[cfg_attr(docsrs, doc(cfg(window)))] + #[cfg(windows)] + #[cfg_attr(docsrs, doc(cfg(windows)))] pub fn g_win32_get_package_installation_subdirectory( package: *const c_char, dll_name: *const c_char, subdir: *const c_char, ) -> *mut c_char; - #[cfg(window)] - #[cfg_attr(docsrs, doc(cfg(window)))] + #[cfg(windows)] + #[cfg_attr(docsrs, doc(cfg(windows)))] pub fn g_win32_get_windows_version() -> c_uint; - #[cfg(window)] - #[cfg_attr(docsrs, doc(cfg(window)))] + #[cfg(windows)] + #[cfg_attr(docsrs, doc(cfg(windows)))] pub fn g_win32_getlocale() -> *mut c_char; - #[cfg(window)] - #[cfg_attr(docsrs, doc(cfg(window)))] + #[cfg(windows)] + #[cfg_attr(docsrs, doc(cfg(windows)))] pub fn g_win32_locale_filename_from_utf8(utf8filename: *const c_char) -> *mut c_char; } diff --git a/glib/sys/tests/abi.rs b/glib/sys/tests/abi.rs index bfd49862e7bc..dd0c95c68f81 100644 --- a/glib/sys/tests/abi.rs +++ b/glib/sys/tests/abi.rs @@ -1045,8 +1045,8 @@ const RUST_LAYOUTS: &[(&str, Layout)] = &[ alignment: align_of::(), }, ), - #[cfg(window)] - #[cfg_attr(docsrs, doc(cfg(window)))] + #[cfg(windows)] + #[cfg_attr(docsrs, doc(cfg(windows)))] ( "GWin32OSType", Layout { From 40b5afb4c8c8d79afb88261e9b49646ac825a143 Mon Sep 17 00:00:00 2001 From: Bilal Elmoussaoui Date: Thu, 18 Jan 2024 18:00:14 +0100 Subject: [PATCH 10/13] Use gi-docgen for all the bindings except cairo/graphene --- gio/Gir.toml | 1 + glib/Gir.toml | 1 + pangocairo/Gir.toml | 1 + 3 files changed, 3 insertions(+) diff --git a/gio/Gir.toml b/gio/Gir.toml index 09e06d7bbbf5..bc0bfd713edb 100644 --- a/gio/Gir.toml +++ b/gio/Gir.toml @@ -3,6 +3,7 @@ girs_directories = ["../gir-files"] library = "Gio" version = "2.0" min_cfg_version = "2.56" +use_gi_docgen = true target_path = "." work_mode = "normal" single_version_file = true diff --git a/glib/Gir.toml b/glib/Gir.toml index 56459af36355..1170b01ceb28 100644 --- a/glib/Gir.toml +++ b/glib/Gir.toml @@ -3,6 +3,7 @@ girs_directories = ["../gir-files"] library = "GLib" version = "2.0" min_cfg_version = "2.56" +use_gi_docgen = true target_path = "." work_mode = "normal" single_version_file = true diff --git a/pangocairo/Gir.toml b/pangocairo/Gir.toml index cd36ae5cdd00..20769fefad93 100644 --- a/pangocairo/Gir.toml +++ b/pangocairo/Gir.toml @@ -2,6 +2,7 @@ girs_directories = ["../gir-files"] library = "PangoCairo" version = "1.0" +use_gi_docgen = true target_path = "." work_mode = "normal" generate_safety_asserts = false From 52f61efb1bb71d37e6f2350afac15c4c0973f580 Mon Sep 17 00:00:00 2001 From: Paolo Borelli Date: Sat, 20 Jan 2024 12:07:26 +0100 Subject: [PATCH 11/13] Bump gvsbuild to a temporary branch using glib from git --- .github/workflows/windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 1a4a1d4960d9..d6c91894aa22 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -14,7 +14,7 @@ jobs: env: # git revision of gvsbuild we use for to build GLib and the other dependencies - gvsbuildref: 1b3c28a3aa2312e7796f5f91b0a897a7a38b9292 + gvsbuildref: de70bfe8f540249aafbf8247ac6886019262917f # bump this number if you want to force a rebuild of gvsbuild with the same revision gvsbuildupdate: 1 From 521bdf036061981e6030d8ba039e0f8797c0e696 Mon Sep 17 00:00:00 2001 From: Bilal Elmoussaoui Date: Sat, 20 Jan 2024 15:02:57 +0100 Subject: [PATCH 12/13] Ignore various functions Those appeared recently and are not part of a new release so it causes various issues --- gio/Gir.toml | 18 ++++++- gio/src/auto/enums.rs | 7 --- gio/src/auto/resolver.rs | 5 -- gio/sys/Gir.toml | 14 +++++ gio/sys/src/lib.rs | 9 ---- glib/Gir.toml | 6 +++ glib/src/auto/functions.rs | 107 ------------------------------------- glib/sys/Gir.toml | 8 +++ glib/sys/src/lib.rs | 30 ----------- 9 files changed, 44 insertions(+), 160 deletions(-) diff --git a/gio/Gir.toml b/gio/Gir.toml index bc0bfd713edb..a79f38da404c 100644 --- a/gio/Gir.toml +++ b/gio/Gir.toml @@ -98,10 +98,8 @@ generate = [ "Gio.Proxy", "Gio.ProxyResolver", "Gio.RemoteActionGroup", - "Gio.Resolver", "Gio.ResolverError", "Gio.ResolverNameLookupFlags", - "Gio.ResolverRecordType", "Gio.ResourceError", "Gio.ResourceLookupFlags", "Gio.Seekable", @@ -1139,6 +1137,22 @@ name = "Gio.ProxyAddress" status = "generate" concurrency = "send+sync" +[[object]] +name = "Gio.Resolver" +status = "generate" + [[object.function]] + # see https://gitlab.gnome.org/GNOME/glib/-/issues/3231 + name = "records_from_res_query" + ignore = true + +[[object]] +name = "Gio.ResolverRecordType" +status = "generate" + [[object.function]] + # see https://gitlab.gnome.org/GNOME/glib/-/issues/3231 + name = "to_rrtype" + ignore = true + [[object]] name = "Gio.Resource" status = "generate" diff --git a/gio/src/auto/enums.rs b/gio/src/auto/enums.rs index 54e392a755ba..2ad826ab27f9 100644 --- a/gio/src/auto/enums.rs +++ b/gio/src/auto/enums.rs @@ -2565,13 +2565,6 @@ pub enum ResolverRecordType { __Unknown(i32), } -impl ResolverRecordType { - #[doc(alias = "g_resolver_record_type_to_rrtype")] - pub fn to_rrtype(self) -> i32 { - unsafe { ffi::g_resolver_record_type_to_rrtype(self.into_glib()) } - } -} - #[doc(hidden)] impl IntoGlib for ResolverRecordType { type GlibType = ffi::GResolverRecordType; diff --git a/gio/src/auto/resolver.rs b/gio/src/auto/resolver.rs index b8e4af0178e5..67840652d6e7 100644 --- a/gio/src/auto/resolver.rs +++ b/gio/src/auto/resolver.rs @@ -41,11 +41,6 @@ impl Resolver { pub fn default() -> Resolver { unsafe { from_glib_full(ffi::g_resolver_get_default()) } } - - //#[doc(alias = "g_resolver_records_from_res_query")] - //pub fn records_from_res_query(rrname: &str, rrtype: i32, answer: u8, len: isize, herr: i32) -> Result, glib::Error> { - // unsafe { TODO: call ffi:g_resolver_records_from_res_query() } - //} } mod sealed { diff --git a/gio/sys/Gir.toml b/gio/sys/Gir.toml index a729f47271f6..7e3603308f52 100644 --- a/gio/sys/Gir.toml +++ b/gio/sys/Gir.toml @@ -44,3 +44,17 @@ status = "generate" [[object.function]] name = "close" cfg_condition = "unix" + +[[object]] +name = "Gio.Resolver" +status = "generate" + [[object.function]] + name = "records_from_res_query" + ignore = true + +[[object]] +name = "Gio.ResolverRecordType" +status = "generate" + [[object.function]] + name = "to_rrtype" + ignore = true diff --git a/gio/sys/src/lib.rs b/gio/sys/src/lib.rs index 985cc3ae7a24..fe0292f2e9c3 100644 --- a/gio/sys/src/lib.rs +++ b/gio/sys/src/lib.rs @@ -9379,7 +9379,6 @@ extern "C" { // GResolverRecordType //========================================================================= pub fn g_resolver_record_type_get_type() -> GType; - pub fn g_resolver_record_type_to_rrtype(type_: GResolverRecordType) -> c_int; //========================================================================= // GResourceError @@ -12852,14 +12851,6 @@ extern "C" { pub fn g_resolver_free_addresses(addresses: *mut glib::GList); pub fn g_resolver_free_targets(targets: *mut glib::GList); pub fn g_resolver_get_default() -> *mut GResolver; - pub fn g_resolver_records_from_res_query( - rrname: *const c_char, - rrtype: c_int, - answer: *const u8, - len: ssize_t, - herr: c_int, - error: *mut *mut glib::GError, - ) -> *mut glib::GList; #[cfg(feature = "v2_78")] #[cfg_attr(docsrs, doc(cfg(feature = "v2_78")))] pub fn g_resolver_get_timeout(resolver: *mut GResolver) -> c_uint; diff --git a/glib/Gir.toml b/glib/Gir.toml index 1170b01ceb28..379cc8c80f59 100644 --- a/glib/Gir.toml +++ b/glib/Gir.toml @@ -134,6 +134,12 @@ status = "generate" pattern = "(idle_remove_by_data|qsort_with_data)" ignore = true # Unsafe functions [[object.function]] + pattern = "trace_(define_int64_counter|set_int64_counter|mark)" + ignore = true # not useful + [[object.function]] + pattern = "(fopen|creat|chmod|blow_chunks|utime|slice_debug_tree_statistics|rename|remove|open|mkdir|lstat|fsync|freopen|set_prgname_once)" + ignore = true # see https://gitlab.gnome.org/GNOME/glib/-/issues/3231 + [[object.function]] pattern = "iconv" doc_struct_name = "IConv" manual = true diff --git a/glib/src/auto/functions.rs b/glib/src/auto/functions.rs index bcf8de7734e7..fd6d1555671b 100644 --- a/glib/src/auto/functions.rs +++ b/glib/src/auto/functions.rs @@ -57,13 +57,6 @@ pub fn base64_encode(data: &[u8]) -> crate::GString { // unsafe { TODO: call ffi:g_base64_encode_step() } //} -#[doc(alias = "g_blow_chunks")] -pub fn blow_chunks() { - unsafe { - ffi::g_blow_chunks(); - } -} - #[doc(alias = "glib_check_version")] pub fn check_version( required_major: u32, @@ -79,11 +72,6 @@ pub fn check_version( } } -#[doc(alias = "g_chmod")] -pub fn chmod(filename: impl AsRef, mode: i32) -> i32 { - unsafe { ffi::g_chmod(filename.as_ref().to_glib_none().0, mode) } -} - #[doc(alias = "g_compute_checksum_for_bytes")] pub fn compute_checksum_for_bytes( checksum_type: ChecksumType, @@ -142,11 +130,6 @@ pub fn compute_hmac_for_data(digest_type: ChecksumType, key: &[u8], data: &[u8]) } } -#[doc(alias = "g_creat")] -pub fn creat(filename: impl AsRef, mode: i32) -> i32 { - unsafe { ffi::g_creat(filename.as_ref().to_glib_none().0, mode) } -} - #[doc(alias = "g_dcgettext")] pub fn dcgettext(domain: Option<&str>, msgid: &str, category: i32) -> crate::GString { unsafe { @@ -333,11 +316,6 @@ pub fn find_program_in_path(program: impl AsRef) -> Option, mode: &str) -> /*Unimplemented*/Option { -// unsafe { TODO: call ffi:g_fopen() } -//} - #[doc(alias = "g_format_size")] pub fn format_size(size: u64) -> crate::GString { unsafe { from_glib_full(ffi::g_format_size(size)) } @@ -348,18 +326,6 @@ pub fn format_size_full(size: u64, flags: FormatSizeFlags) -> crate::GString { unsafe { from_glib_full(ffi::g_format_size_full(size, flags.into_glib())) } } -//#[doc(alias = "g_freopen")] -//pub fn freopen(filename: impl AsRef, mode: &str, stream: /*Unimplemented*/Option) -> /*Unimplemented*/Option { -// unsafe { TODO: call ffi:g_freopen() } -//} - -#[cfg(feature = "v2_64")] -#[cfg_attr(docsrs, doc(cfg(feature = "v2_64")))] -#[doc(alias = "g_fsync")] -pub fn fsync(fd: i32) -> i32 { - unsafe { ffi::g_fsync(fd) } -} - #[doc(alias = "g_get_application_name")] #[doc(alias = "get_application_name")] pub fn application_name() -> Option { @@ -567,11 +533,6 @@ pub fn listenv() -> Vec { unsafe { FromGlibPtrContainer::from_glib_full(ffi::g_listenv()) } } -//#[doc(alias = "g_lstat")] -//pub fn lstat(filename: impl AsRef, buf: /*Ignored*/&mut StatBuf) -> i32 { -// unsafe { TODO: call ffi:g_lstat() } -//} - #[doc(alias = "g_main_current_source")] pub fn main_current_source() -> Option { unsafe { from_glib_none(ffi::g_main_current_source()) } @@ -588,11 +549,6 @@ pub fn markup_escape_text(text: &str) -> crate::GString { unsafe { from_glib_full(ffi::g_markup_escape_text(text.to_glib_none().0, length)) } } -#[doc(alias = "g_mkdir")] -pub fn mkdir(filename: impl AsRef, mode: i32) -> i32 { - unsafe { ffi::g_mkdir(filename.as_ref().to_glib_none().0, mode) } -} - #[doc(alias = "g_mkdir_with_parents")] pub fn mkdir_with_parents(pathname: impl AsRef, mode: i32) -> i32 { unsafe { ffi::g_mkdir_with_parents(pathname.as_ref().to_glib_none().0, mode) } @@ -612,11 +568,6 @@ pub fn on_error_stack_trace(prg_name: &str) { } } -#[doc(alias = "g_open")] -pub fn open(filename: impl AsRef, flags: i32, mode: i32) -> i32 { - unsafe { ffi::g_open(filename.as_ref().to_glib_none().0, flags, mode) } -} - #[doc(alias = "g_path_get_basename")] #[allow(dead_code)] pub(crate) fn path_get_basename(file_name: impl AsRef) -> std::path::PathBuf { @@ -672,24 +623,6 @@ pub fn reload_user_special_dirs_cache() { } } -#[doc(alias = "g_remove")] -pub fn remove(filename: impl AsRef) -> i32 { - unsafe { ffi::g_remove(filename.as_ref().to_glib_none().0) } -} - -#[doc(alias = "g_rename")] -pub fn rename( - oldfilename: impl AsRef, - newfilename: impl AsRef, -) -> i32 { - unsafe { - ffi::g_rename( - oldfilename.as_ref().to_glib_none().0, - newfilename.as_ref().to_glib_none().0, - ) - } -} - #[doc(alias = "g_set_application_name")] pub fn set_application_name(application_name: &str) { unsafe { @@ -697,11 +630,6 @@ pub fn set_application_name(application_name: &str) { } } -#[doc(alias = "g_set_prgname_once")] -pub fn set_prgname_once(prgname: &str) -> bool { - unsafe { from_glib(ffi::g_set_prgname_once(prgname.to_glib_none().0)) } -} - //#[doc(alias = "g_set_user_dirs")] //pub fn set_user_dirs(first_dir_type: &str, : /*Unknown conversion*//*Unimplemented*/Basic: VarArgs) { // unsafe { TODO: call ffi:g_set_user_dirs() } @@ -775,13 +703,6 @@ pub fn shell_unquote( } } -#[doc(alias = "g_slice_debug_tree_statistics")] -pub fn slice_debug_tree_statistics() { - unsafe { - ffi::g_slice_debug_tree_statistics(); - } -} - #[doc(alias = "g_spaced_primes_closest")] pub fn spaced_primes_closest(num: u32) -> u32 { unsafe { ffi::g_spaced_primes_closest(num) } @@ -906,29 +827,6 @@ pub fn spawn_command_line_async( // unsafe { TODO: call ffi:g_stat() } //} -#[doc(alias = "g_trace_define_int64_counter")] -pub fn trace_define_int64_counter(group: &str, name: &str, description: &str) -> u32 { - unsafe { - ffi::g_trace_define_int64_counter( - group.to_glib_none().0, - name.to_glib_none().0, - description.to_glib_none().0, - ) - } -} - -//#[doc(alias = "g_trace_mark")] -//pub fn trace_mark(begin_time_nsec: i64, duration_nsec: i64, group: &str, name: &str, message_format: &str, : /*Unknown conversion*//*Unimplemented*/Basic: VarArgs) { -// unsafe { TODO: call ffi:g_trace_mark() } -//} - -#[doc(alias = "g_trace_set_int64_counter")] -pub fn trace_set_int64_counter(id: u32, value: i64) { - unsafe { - ffi::g_trace_set_int64_counter(id, value); - } -} - //#[cfg(unix)] //#[cfg_attr(docsrs, doc(cfg(unix)))] //#[cfg(feature = "v2_64")] @@ -957,11 +855,6 @@ pub fn usleep(microseconds: libc::c_ulong) { } } -//#[doc(alias = "g_utime")] -//pub fn utime(filename: impl AsRef, utb: /*Unimplemented*/Option) -> i32 { -// unsafe { TODO: call ffi:g_utime() } -//} - #[doc(alias = "g_uuid_string_is_valid")] pub fn uuid_string_is_valid(str: &str) -> bool { unsafe { from_glib(ffi::g_uuid_string_is_valid(str.to_glib_none().0)) } diff --git a/glib/sys/Gir.toml b/glib/sys/Gir.toml index 9034c1899738..1e5f31209400 100644 --- a/glib/sys/Gir.toml +++ b/glib/sys/Gir.toml @@ -67,6 +67,14 @@ ignore = [ [[object]] name = "GLib.*" status = "generate" + [[object.function]] + pattern = "trace_(define_int64_counter|set_int64_counter|mark)" + # see https://gitlab.gnome.org/GNOME/glib/-/issues/3231 + ignore = true + [[object.function]] + pattern = "(fopen|creat|chmod|blow_chunks|utime|slice_debug_tree_statistics|rename|remove|open|mkdir|lstat|fsync|freopen|set_prgname_once)" + # see https://gitlab.gnome.org/GNOME/glib/-/issues/3231 + majority of those are available through std + ignore = true [[object.function]] name = "win32_locale_filename_from_utf8" cfg_condition = "windows" diff --git a/glib/sys/src/lib.rs b/glib/sys/src/lib.rs index 53c5ca691332..a57bcf7f18ce 100644 --- a/glib/sys/src/lib.rs +++ b/glib/sys/src/lib.rs @@ -6378,7 +6378,6 @@ extern "C" { pub fn g_bit_storage(number: c_ulong) -> c_uint; pub fn g_bit_trylock(address: *mut c_int, lock_bit: c_int) -> gboolean; pub fn g_bit_unlock(address: *mut c_int, lock_bit: c_int); - pub fn g_blow_chunks(); pub fn g_build_filename(first_element: *const c_char, ...) -> *mut c_char; //pub fn g_build_filename_valist(first_element: *const c_char, args: /*Unimplemented*/*mut va_list) -> *mut c_char; pub fn g_build_filenamev(args: *mut *mut c_char) -> *mut c_char; @@ -6406,7 +6405,6 @@ extern "C" { notify: GDestroyNotify, ) -> c_uint; pub fn g_child_watch_source_new(pid: GPid) -> *mut GSource; - pub fn g_chmod(filename: *const c_char, mode: c_int) -> c_int; pub fn g_clear_error(error: *mut *mut GError); pub fn g_clear_handle_id(tag_ptr: *mut c_uint, clear_func: GClearHandleFunc); #[cfg(feature = "v2_64")] @@ -6478,7 +6476,6 @@ extern "C" { bytes_written: *mut size_t, error: *mut *mut GError, ) -> *mut u8; - pub fn g_creat(filename: *const c_char, mode: c_int) -> c_int; pub fn g_datalist_clear(datalist: *mut *mut GData); pub fn g_datalist_foreach( datalist: *mut *mut GData, @@ -6628,7 +6625,6 @@ extern "C" { error: *mut *mut GError, ) -> *mut c_char; pub fn g_find_program_in_path(program: *const c_char) -> *mut c_char; - pub fn g_fopen(filename: *const c_char, mode: *const c_char) -> *mut FILE; pub fn g_format_size(size: u64) -> *mut c_char; pub fn g_format_size_for_display(size: i64) -> *mut c_char; pub fn g_format_size_full(size: u64, flags: GFormatSizeFlags) -> *mut c_char; @@ -6637,10 +6633,6 @@ extern "C" { #[cfg(feature = "v2_76")] #[cfg_attr(docsrs, doc(cfg(feature = "v2_76")))] pub fn g_free_sized(mem: gpointer, size: size_t); - pub fn g_freopen(filename: *const c_char, mode: *const c_char, stream: *mut FILE) -> *mut FILE; - #[cfg(feature = "v2_64")] - #[cfg_attr(docsrs, doc(cfg(feature = "v2_64")))] - pub fn g_fsync(fd: c_int) -> c_int; pub fn g_get_application_name() -> *const c_char; pub fn g_get_charset(charset: *mut *const c_char) -> gboolean; pub fn g_get_codeset() -> *mut c_char; @@ -6845,7 +6837,6 @@ extern "C" { user_data: gpointer, ) -> GLogWriterOutput; //pub fn g_logv(log_domain: *const c_char, log_level: GLogLevelFlags, format: *const c_char, args: /*Unimplemented*/va_list); - pub fn g_lstat(filename: *const c_char, buf: *mut GStatBuf) -> c_int; pub fn g_main_current_source() -> *mut GSource; pub fn g_main_depth() -> c_int; pub fn g_malloc(n_bytes: size_t) -> gpointer; @@ -6872,7 +6863,6 @@ extern "C" { #[cfg(feature = "v2_68")] #[cfg_attr(docsrs, doc(cfg(feature = "v2_68")))] pub fn g_memdup2(mem: gconstpointer, byte_size: size_t) -> gpointer; - pub fn g_mkdir(filename: *const c_char, mode: c_int) -> c_int; pub fn g_mkdir_with_parents(pathname: *const c_char, mode: c_int) -> c_int; pub fn g_mkdtemp(tmpl: *mut c_char) -> *mut c_char; pub fn g_mkdtemp_full(tmpl: *mut c_char, mode: c_int) -> *mut c_char; @@ -6882,7 +6872,6 @@ extern "C" { pub fn g_number_parser_error_quark() -> GQuark; pub fn g_on_error_query(prg_name: *const c_char); pub fn g_on_error_stack_trace(prg_name: *const c_char); - pub fn g_open(filename: *const c_char, flags: c_int, mode: c_int) -> c_int; pub fn g_option_error_quark() -> GQuark; pub fn g_parse_debug_string( string: *const c_char, @@ -7010,8 +6999,6 @@ extern "C" { #[cfg_attr(docsrs, doc(cfg(feature = "v2_58")))] pub fn g_ref_string_release(str: *mut c_char); pub fn g_reload_user_special_dirs_cache(); - pub fn g_remove(filename: *const c_char) -> c_int; - pub fn g_rename(oldfilename: *const c_char, newfilename: *const c_char) -> c_int; pub fn g_return_if_fail_warning( log_domain: *const c_char, pretty_function: *const c_char, @@ -7033,7 +7020,6 @@ extern "C" { message: *const c_char, ); pub fn g_set_prgname(prgname: *const c_char); - pub fn g_set_prgname_once(prgname: *const c_char) -> gboolean; pub fn g_set_print_handler(func: GPrintFunc) -> GPrintFunc; pub fn g_set_printerr_handler(func: GPrintFunc) -> GPrintFunc; pub fn g_set_user_dirs(first_dir_type: *const c_char, ...); @@ -7051,7 +7037,6 @@ extern "C" { pub fn g_slice_alloc(block_size: size_t) -> gpointer; pub fn g_slice_alloc0(block_size: size_t) -> gpointer; pub fn g_slice_copy(block_size: size_t, mem_block: gconstpointer) -> gpointer; - pub fn g_slice_debug_tree_statistics(); pub fn g_slice_free1(block_size: size_t, mem_block: gpointer); pub fn g_slice_free_chain_with_offset( block_size: size_t, @@ -7390,20 +7375,6 @@ extern "C" { ) -> c_uint; pub fn g_timeout_source_new(interval: c_uint) -> *mut GSource; pub fn g_timeout_source_new_seconds(interval: c_uint) -> *mut GSource; - pub fn g_trace_define_int64_counter( - group: *const c_char, - name: *const c_char, - description: *const c_char, - ) -> c_uint; - pub fn g_trace_mark( - begin_time_nsec: i64, - duration_nsec: i64, - group: *const c_char, - name: *const c_char, - message_format: *const c_char, - ... - ); - pub fn g_trace_set_int64_counter(id: c_uint, value: i64); pub fn g_try_malloc(n_bytes: size_t) -> gpointer; pub fn g_try_malloc0(n_bytes: size_t) -> gpointer; pub fn g_try_malloc0_n(n_blocks: size_t, n_block_bytes: size_t) -> gpointer; @@ -7574,7 +7545,6 @@ extern "C" { max_len: size_t, end: *mut *const c_char, ) -> gboolean; - pub fn g_utime(filename: *const c_char, utb: *mut utimbuf) -> c_int; pub fn g_uuid_string_is_valid(str: *const c_char) -> gboolean; pub fn g_uuid_string_random() -> *mut c_char; pub fn g_variant_get_gtype() -> GType; From 17dcc90af5d22844f0ca2ceedbdb71eddaf1bce0 Mon Sep 17 00:00:00 2001 From: Bilal Elmoussaoui Date: Sat, 20 Jan 2024 15:37:57 +0100 Subject: [PATCH 13/13] gio/sys: Ignore ThreadResolver Fixes the ffi tests --- gio/sys/Gir.toml | 4 ++++ gio/sys/src/lib.rs | 14 -------------- gio/sys/tests/abi.rs | 7 ------- gio/sys/tests/layout.c | 1 - 4 files changed, 4 insertions(+), 22 deletions(-) diff --git a/gio/sys/Gir.toml b/gio/sys/Gir.toml index 7e3603308f52..9210453b4f99 100644 --- a/gio/sys/Gir.toml +++ b/gio/sys/Gir.toml @@ -11,6 +11,10 @@ external_libraries = [ "GObject", ] +ignore = [ + "Gio.ThreadedResolverClass" +] + [[object]] name = "Gio.SocketFamily" status = "manual" diff --git a/gio/sys/src/lib.rs b/gio/sys/src/lib.rs index fe0292f2e9c3..ddb0f91fc8de 100644 --- a/gio/sys/src/lib.rs +++ b/gio/sys/src/lib.rs @@ -6168,20 +6168,6 @@ pub struct _GThemedIconClass { pub type GThemedIconClass = _GThemedIconClass; -#[derive(Copy, Clone)] -#[repr(C)] -pub struct GThreadedResolverClass { - pub parent_class: GResolverClass, -} - -impl ::std::fmt::Debug for GThreadedResolverClass { - fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - f.debug_struct(&format!("GThreadedResolverClass @ {self:p}")) - .field("parent_class", &self.parent_class) - .finish() - } -} - #[derive(Copy, Clone)] #[repr(C)] pub struct GThreadedSocketServiceClass { diff --git a/gio/sys/tests/abi.rs b/gio/sys/tests/abi.rs index ae6c44559807..fd624564ba79 100644 --- a/gio/sys/tests/abi.rs +++ b/gio/sys/tests/abi.rs @@ -1895,13 +1895,6 @@ const RUST_LAYOUTS: &[(&str, Layout)] = &[ alignment: align_of::(), }, ), - ( - "GThreadedResolverClass", - Layout { - size: size_of::(), - alignment: align_of::(), - }, - ), ( "GThreadedSocketService", Layout { diff --git a/gio/sys/tests/layout.c b/gio/sys/tests/layout.c index 98ede29efacd..6f6a95ad4ced 100644 --- a/gio/sys/tests/layout.c +++ b/gio/sys/tests/layout.c @@ -249,7 +249,6 @@ int main() { printf("%s;%zu;%zu\n", "GTcpWrapperConnection", sizeof(GTcpWrapperConnection), alignof(GTcpWrapperConnection)); printf("%s;%zu;%zu\n", "GTcpWrapperConnectionClass", sizeof(GTcpWrapperConnectionClass), alignof(GTcpWrapperConnectionClass)); printf("%s;%zu;%zu\n", "GTestDBusFlags", sizeof(GTestDBusFlags), alignof(GTestDBusFlags)); - printf("%s;%zu;%zu\n", "GThreadedResolverClass", sizeof(GThreadedResolverClass), alignof(GThreadedResolverClass)); printf("%s;%zu;%zu\n", "GThreadedSocketService", sizeof(GThreadedSocketService), alignof(GThreadedSocketService)); printf("%s;%zu;%zu\n", "GThreadedSocketServiceClass", sizeof(GThreadedSocketServiceClass), alignof(GThreadedSocketServiceClass)); printf("%s;%zu;%zu\n", "GTlsAuthenticationMode", sizeof(GTlsAuthenticationMode), alignof(GTlsAuthenticationMode));