From 521bdf036061981e6030d8ba039e0f8797c0e696 Mon Sep 17 00:00:00 2001 From: Bilal Elmoussaoui Date: Sat, 20 Jan 2024 15:02:57 +0100 Subject: [PATCH] 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;