Skip to content
This repository has been archived by the owner on Jun 8, 2021. It is now read-only.

Regen #209

Merged
merged 2 commits into from
Aug 1, 2017
Merged

Regen #209

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions Gir.toml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ status = "generate"
#manual pathbuf
ignore = true
[[object.function]]
name = "filename_from_utf8"
#not in 64bit lib for Windows
ignore = true
[[object.function]]
name = "get_user_name"
#manual pathbuf is_windows_utf8
ignore = true
Expand Down Expand Up @@ -201,6 +205,25 @@ status = "generate"
# Need manual bindings to be useful
ignore = true

[[object]]
name = "GLib.Checksum"
status = "generate"
[[object.function]]
name = "get_digest"
#wrong array definition
ignore = true
[[object.function]]
name = "get_string"
#consume
ignore = true

[[object]]
name = "GLib.ChecksumType"
status = "generate"
[[object.member]]
name = "sha512"
version = "2.36"

[[object]]
name = "GLib.KeyFile"
status = "generate"
Expand Down Expand Up @@ -229,6 +252,14 @@ status = "generate"
name = "load_from_data"
#gsize
ignore = true
[[object.function]]
name = "set_double_list"
#wrong array type
ignore = true
[[object.function]]
name = "set_integer_list"
#wrong array type
ignore = true

[[object]]
name = "GLib.MainContext"
Expand Down
14 changes: 5 additions & 9 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,11 @@ environment:
install:
- IF "%BITS%" == "32" SET ARCH=i686
- IF "%BITS%" == "64" SET ARCH=x86_64
- ps: Start-FileDownload "https://static.rust-lang.org/dist/channel-rust-stable"
- ps: $env:RUST_VERSION = Get-Content channel-rust-stable | select -first 1 | %{$_.split('-')[1]}
- if NOT "%RUST%" == "stable" set RUST_VERSION=%RUST%
- SET RUST_URL=https://static.rust-lang.org/dist/rust-%RUST_VERSION%-%ARCH%-pc-windows-gnu.exe
- SET PATH=C:\Rust\bin;C:\msys64\mingw%BITS%\bin;%PATH%;C:\msys64\usr\bin
- ps: Start-FileDownload $Env:RUST_URL -FileName rust-dist.exe
- rust-dist.exe /VERYSILENT /NORESTART /COMPONENTS="Rustc,Gcc,Cargo,Std" /DIR="C:\Rust"
- rustc -V
- cargo -V
- curl -sSf -o rustup-init.exe https://win.rustup.rs
- rustup-init.exe --default-host "%ARCH%-pc-windows-gnu" --default-toolchain %RUST% -y
- SET PATH=C:\Users\appveyor\.cargo\bin;C:\msys64\mingw%BITS%\bin;%PATH%;C:\msys64\usr\bin
- rustc -Vv
- cargo -Vv
- pacman --noconfirm -S mingw-w64-%ARCH%-gtk3

build_script:
Expand Down
47 changes: 47 additions & 0 deletions src/auto/checksum.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// This file was generated by gir (f00d658) from gir-files (0bcaef9)
// DO NOT EDIT

use ChecksumType;
use ffi;
use ffi as glib_ffi;
use gobject_ffi;
use std::mem;
use std::ptr;
use translate::*;

glib_wrapper! {
pub struct Checksum(Boxed<ffi::GChecksum>);

match fn {
copy => |ptr| ffi::g_checksum_copy(mut_override(ptr)),
free => |ptr| ffi::g_checksum_free(ptr),
get_type => || ffi::g_checksum_get_type(),
}
}

impl Checksum {
pub fn new(checksum_type: ChecksumType) -> Checksum {
unsafe {
from_glib_full(ffi::g_checksum_new(checksum_type.to_glib()))
}
}

pub fn reset(&mut self) {
unsafe {
ffi::g_checksum_reset(self.to_glib_none_mut().0);
}
}

pub fn update(&mut self, data: &[u8]) {
let length = data.len() as isize;
unsafe {
ffi::g_checksum_update(self.to_glib_none_mut().0, data.to_glib_none().0, length);
}
}

pub fn type_get_length(checksum_type: ChecksumType) -> isize {
unsafe {
ffi::g_checksum_type_get_length(checksum_type.to_glib())
}
}
}
43 changes: 42 additions & 1 deletion src/auto/enums.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file was generated by gir (ac9a8da) from gir-files (0bcaef9)
// This file was generated by gir (f00d658) from gir-files (0bcaef9)
// DO NOT EDIT

use ffi;
Expand All @@ -7,6 +7,47 @@ use error::ErrorDomain;
use translate::*;
use std;

#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
pub enum ChecksumType {
Md5,
Sha1,
Sha256,
#[cfg(feature = "v2_36")]
Sha512,
#[doc(hidden)]
__Unknown(i32),
}

#[doc(hidden)]
impl ToGlib for ChecksumType {
type GlibType = ffi::GChecksumType;

fn to_glib(&self) -> ffi::GChecksumType {
match *self {
ChecksumType::Md5 => ffi::G_CHECKSUM_MD5,
ChecksumType::Sha1 => ffi::G_CHECKSUM_SHA1,
ChecksumType::Sha256 => ffi::G_CHECKSUM_SHA256,
#[cfg(feature = "v2_36")]
ChecksumType::Sha512 => ffi::G_CHECKSUM_SHA512,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's also G_CHECKSUM_SHA384 since 2.51. I think you should update your .gir files at some point in the near future :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we will update it.

ChecksumType::__Unknown(value) => unsafe{std::mem::transmute(value)}
}
}
}

#[doc(hidden)]
impl FromGlib<ffi::GChecksumType> for ChecksumType {
fn from_glib(value: ffi::GChecksumType) -> Self {
match value as i32 {
0 => ChecksumType::Md5,
1 => ChecksumType::Sha1,
2 => ChecksumType::Sha256,
#[cfg(feature = "v2_36")]
3 => ChecksumType::Sha512,
value => ChecksumType::__Unknown(value),
}
}
}

#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
pub enum KeyFileError {
UnknownEncoding,
Expand Down
2 changes: 1 addition & 1 deletion src/auto/flags.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file was generated by gir (ac9a8da) from gir-files (0bcaef9)
// This file was generated by gir (f00d658) from gir-files (0bcaef9)
// DO NOT EDIT

use ffi;
Expand Down
Loading