<commit_before>// This file is part of Grust, GObject introspection bindings for Rust
//
// Copyright (C) 2013, 2014  <NAME> <<EMAIL>>
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA

#![crate_name = "grust-Gio-2_0"]

#![crate_type = "lib"]

extern crate grust;
extern crate "grust-GLib-2_0" as glib;
extern crate "grust-GObject-2_0" as gobject;
extern crate libc;

use grust::gtype::GType;
use grust::marker;
use grust::object;
use grust::refcount;
use grust::types;
use grust::utf8;

use cast::AsyncResult as _cast_AsyncResult;
use cast::Cancellable as _cast_Cancellable;

#[repr(C)]
pub struct AsyncResult {
    marker: marker::ObjectMarker
}

#[repr(C)]
pub struct File {
    marker: marker::ObjectMarker
}

#[repr(C)]
pub struct Cancellable {
    parent_instance: gobject::Object,
    _priv: types::gpointer
}

#[repr(C)]
pub struct InputStream {
    parent_instance: gobject::Object,
    _priv: types::gpointer
}

#[repr(C)]
pub struct FileInputStream {
    parent_instance: InputStream,
    _priv: types::gpointer
}

pub mod enums {

    pub mod io_error {

        use grust::error;
        use grust::quark;
        use std::fmt;
        use std::sync::atomic;

        #[deriving(FromPrimitive,PartialEq,Eq)]
        #[repr(C)]
        pub enum IOErrorEnum {
            Failed = 0,
            NotFound = 1,
            Exists = 2,
            // ...
        }

        impl fmt::Show for IOErrorEnum {
            fn fmt(&self, format: &mut fmt::Formatter) -> fmt::Result {
                let s: &'static str = match *self {
                    IOErrorEnum::Failed   => "failed",
                    IOErrorEnum::NotFound => "not-found",
                    IOErrorEnum::Exists   => "exists",
                    // ...
                };
                s.fmt(format)
            }
        }

        static mut ERROR_QUARK: atomic::AtomicUint = atomic::INIT_ATOMIC_UINT;

        impl error::ErrorDomain for IOErrorEnum {
            fn error_domain(_: Option<IOErrorEnum>) -> quark::Quark {
                unsafe {
                    let mut d = ERROR_QUARK.load(atomic::Relaxed)
                                as quark::Quark;
                    if d == 0 {
                        d = quark::from_static_string("g-io-error-quark\0");
                        ERROR_QUARK.store(d as uint, atomic::Relaxed);
                    }
                    d
                }
            }
        }

        impl ToPrimitive for IOErrorEnum {
            fn to_int(&self) -> Option<int> { Some(*self as int) }
            fn to_i64(&self) -> Option<i64> { Some(*self as i64) }
            fn to_u64(&self) -> Option<u64> { Some(*self as u64) }
        }
    }
}

#[allow(improper_ctypes)]
pub mod raw {
    use grust::types::{gchar,gint,gpointer};
    use grust::gtype::GType;
    use grust::error::raw::GError;
    use gobject;
    use libc;

    pub type GAsyncResult = super::AsyncResult;
    pub type GFile = super::File;
    pub type GCancellable = super::Cancellable;
    pub type GInputStream = super::InputStream;
    pub type GFileInputStream = super::FileInputStream;<commit_msg>Bring the generated enum to crate's top-level namespace<commit_after>// This file is part of Grust, GObject introspection bindings for Rust
//
// Copyright (C) 2013, 2014  <NAME> <<EMAIL>>
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA

#![crate_name = "grust-Gio-2_0"]

#![crate_type = "lib"]

extern crate grust;
extern crate "grust-GLib-2_0" as glib;
extern crate "grust-GObject-2_0" as gobject;
extern crate libc;

use grust::error;
use grust::gtype::GType;
use grust::marker;
use grust::object;
use grust::quark;
use grust::refcount;
use grust::types;
use grust::utf8;

use cast::AsyncResult as _cast_AsyncResult;
use cast::Cancellable as _cast_Cancellable;

use std::fmt;
use std::sync::atomic;

#[repr(C)]
pub struct AsyncResult {
    marker: marker::ObjectMarker
}

#[repr(C)]
pub struct File {
    marker: marker::ObjectMarker
}

#[repr(C)]
pub struct Cancellable {
    parent_instance: gobject::Object,
    _priv: types::gpointer
}

#[repr(C)]
pub struct InputStream {
    parent_instance: gobject::Object,
    _priv: types::gpointer
}

#[repr(C)]
pub struct FileInputStream {
    parent_instance: InputStream,
    _priv: types::gpointer
}

#[deriving(FromPrimitive,PartialEq,Eq)]
#[repr(C)]
pub enum IOErrorEnum {
    Failed = 0,
    NotFound = 1,
    Exists = 2,
    // ...
}

impl fmt::Show for IOErrorEnum {
    fn fmt(&self, format: &mut fmt::Formatter) -> fmt::Result {
        let s: &'static str = match *self {
            IOErrorEnum::Failed   => "failed",
            IOErrorEnum::NotFound => "not-found",
            IOErrorEnum::Exists   => "exists",
            // ...
        };
        s.fmt(format)
    }
}

static mut ERROR_QUARK: atomic::AtomicUint = atomic::INIT_ATOMIC_UINT;

impl error::ErrorDomain for IOErrorEnum {
    fn error_domain(_: Option<IOErrorEnum>) -> quark::Quark {
        unsafe {
            let mut d = ERROR_QUARK.load(atomic::Relaxed)
                        as quark::Quark;
            if d == 0 {
                d = quark::from_static_string("g-io-error-quark\0");
                ERROR_QUARK.store(d as uint, atomic::Relaxed);
            }
            d
        }
    }
}

impl ToPrimitive for IOErrorEnum {
    fn to_int(&self) -> Option<int> { Some(*self as int) }
    fn to_i64(&self) -> Option<i64> { Some(*self as i64) }
    fn to_u64(&self) -> Option<u64> { Some(*self as u64) }
}

#[allow(improper_ctypes)]
pub mod raw {
    use grust::types::{gchar,gint,gpointer};
    use grust::gtype::GType;
    use grust::error::raw::GError;
    use gobject;
    use libc;

    pub type GAsyncResult = super::AsyncResult;
    pub type GFile = super::File;
    pub type GCancellable = super::Cancellable;
    pub type GInputStream = super::InputStream;
    pub type GFileInputStream = super::FileInputStream;
{'fraction_non_alphanumeric': 0.1166092350103377, 'fraction_numerical': 0.012405237767057202, 'mean_word_length': 2.622566150773839, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1722598', 'n_tokens_mistral': 2305, 'n_tokens_neox': 2213, 'n_words': 688}