Skip to content

Commit

Permalink
Ignore various functions
Browse files Browse the repository at this point in the history
Those appeared recently and are not part of a new release so it causes
various issues
  • Loading branch information
bilelmoussaoui committed Jan 25, 2024
1 parent 52f61ef commit 521bdf0
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 160 deletions.
18 changes: 16 additions & 2 deletions gio/Gir.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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"
Expand Down
7 changes: 0 additions & 7 deletions gio/src/auto/enums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 0 additions & 5 deletions gio/src/auto/resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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</*Unimplemented*/Vec<Basic: Pointer>, glib::Error> {
// unsafe { TODO: call ffi:g_resolver_records_from_res_query() }
//}
}

mod sealed {
Expand Down
14 changes: 14 additions & 0 deletions gio/sys/Gir.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 0 additions & 9 deletions gio/sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down
6 changes: 6 additions & 0 deletions glib/Gir.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
107 changes: 0 additions & 107 deletions glib/src/auto/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -79,11 +72,6 @@ pub fn check_version(
}
}

#[doc(alias = "g_chmod")]
pub fn chmod(filename: impl AsRef<std::path::Path>, 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,
Expand Down Expand Up @@ -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<std::path::Path>, 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 {
Expand Down Expand Up @@ -333,11 +316,6 @@ pub fn find_program_in_path(program: impl AsRef<std::path::Path>) -> Option<std:
}
}

//#[doc(alias = "g_fopen")]
//pub fn fopen(filename: impl AsRef<std::path::Path>, mode: &str) -> /*Unimplemented*/Option<Basic: Pointer> {
// 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)) }
Expand All @@ -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<std::path::Path>, mode: &str, stream: /*Unimplemented*/Option<Basic: Pointer>) -> /*Unimplemented*/Option<Basic: Pointer> {
// 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<crate::GString> {
Expand Down Expand Up @@ -567,11 +533,6 @@ pub fn listenv() -> Vec<std::ffi::OsString> {
unsafe { FromGlibPtrContainer::from_glib_full(ffi::g_listenv()) }
}

//#[doc(alias = "g_lstat")]
//pub fn lstat(filename: impl AsRef<std::path::Path>, buf: /*Ignored*/&mut StatBuf) -> i32 {
// unsafe { TODO: call ffi:g_lstat() }
//}

#[doc(alias = "g_main_current_source")]
pub fn main_current_source() -> Option<Source> {
unsafe { from_glib_none(ffi::g_main_current_source()) }
Expand All @@ -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<std::path::Path>, 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<std::path::Path>, mode: i32) -> i32 {
unsafe { ffi::g_mkdir_with_parents(pathname.as_ref().to_glib_none().0, mode) }
Expand All @@ -612,11 +568,6 @@ pub fn on_error_stack_trace(prg_name: &str) {
}
}

#[doc(alias = "g_open")]
pub fn open(filename: impl AsRef<std::path::Path>, 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::Path>) -> std::path::PathBuf {
Expand Down Expand Up @@ -672,36 +623,13 @@ pub fn reload_user_special_dirs_cache() {
}
}

#[doc(alias = "g_remove")]
pub fn remove(filename: impl AsRef<std::path::Path>) -> i32 {
unsafe { ffi::g_remove(filename.as_ref().to_glib_none().0) }
}

#[doc(alias = "g_rename")]
pub fn rename(
oldfilename: impl AsRef<std::path::Path>,
newfilename: impl AsRef<std::path::Path>,
) -> 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 {
ffi::g_set_application_name(application_name.to_glib_none().0);
}
}

#[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() }
Expand Down Expand Up @@ -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) }
Expand Down Expand Up @@ -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")]
Expand Down Expand Up @@ -957,11 +855,6 @@ pub fn usleep(microseconds: libc::c_ulong) {
}
}

//#[doc(alias = "g_utime")]
//pub fn utime(filename: impl AsRef<std::path::Path>, utb: /*Unimplemented*/Option<Basic: Pointer>) -> 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)) }
Expand Down
8 changes: 8 additions & 0 deletions glib/sys/Gir.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading

0 comments on commit 521bdf0

Please sign in to comment.