Create crate and stubs for wctype

Create the wctype crate and stub functions with the unimplemented macro.
This commit is contained in:
Dan Robertson
2018-03-08 16:02:56 +00:00
parent 013dff2aaf
commit a6a16cf233
8 changed files with 122 additions and 0 deletions
Generated
+9
View File
@@ -262,6 +262,7 @@ dependencies = [
"stdlib 0.1.0",
"string 0.1.0",
"unistd 0.1.0",
"wctype 0.1.0",
]
[[package]]
@@ -582,6 +583,14 @@ name = "vec_map"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "wctype"
version = "0.1.0"
dependencies = [
"cbindgen 0.5.0",
"platform 0.1.0",
]
[[package]]
name = "winapi"
version = "0.2.8"
+1
View File
@@ -23,6 +23,7 @@ stdio = { path = "src/stdio" }
stdlib = { path = "src/stdlib" }
string = { path = "src/string" }
unistd = { path = "src/unistd" }
wctype = { path = "src/wctype" }
[profile.dev]
panic = "abort"
+1
View File
@@ -14,6 +14,7 @@ extern crate stdio;
extern crate stdlib;
extern crate string;
extern crate unistd;
extern crate wctype;
#[lang = "eh_personality"]
#[no_mangle]
+1
View File
@@ -44,6 +44,7 @@ pub type c_ulong = u64;
pub type wchar_t = i16;
pub type wint_t = i32;
pub type wctype_t = i64;
pub type off_t = c_long;
pub type mode_t = u16;
+11
View File
@@ -0,0 +1,11 @@
[package]
name = "wctype"
version = "0.1.0"
authors = ["Dan Robertson <danlrobertson89@gmail.com>"]
build = "build.rs"
[build-dependencies]
cbindgen = { path = "../../cbindgen" }
[dependencies]
platform = { path = "../platform" }
+11
View File
@@ -0,0 +1,11 @@
extern crate cbindgen;
use std::{env, fs};
fn main() {
let crate_dir = env::var("CARGO_MANIFEST_DIR").expect("CARGO_MANIFEST_DIR not set");
fs::create_dir_all("../../target/include").expect("failed to create include directory");
cbindgen::generate(crate_dir)
.expect("failed to generate bindings")
.write_to_file("../../target/include/wctype.h");
}
+6
View File
@@ -0,0 +1,6 @@
sys_includes = []
include_guard = "_WCTYPE_H"
language = "C"
[enum]
prefix_with_name = true
+82
View File
@@ -0,0 +1,82 @@
//! wctype implementation for Redox, following http://pubs.opengroup.org/onlinepubs/7908799/xsh/wctype.h.html
#![no_std]
extern crate platform;
use platform::types::*;
#[no_mangle]
pub extern "C" fn iswalnum(wc: wint_t) -> c_int {
unimplemented!();
}
#[no_mangle]
pub extern "C" fn iswalpha(wc: wint_t) -> c_int {
unimplemented!();
}
#[no_mangle]
pub extern "C" fn iswcntrl(wc: wint_t) -> c_int {
unimplemented!();
}
#[no_mangle]
pub extern "C" fn iswdigit(wc: wint_t) -> c_int {
unimplemented!();
}
#[no_mangle]
pub extern "C" fn iswgraph(wc: wint_t) -> c_int {
unimplemented!();
}
#[no_mangle]
pub extern "C" fn iswlower(wc: wint_t) -> c_int {
unimplemented!();
}
#[no_mangle]
pub extern "C" fn iswprint(wc: wint_t) -> c_int {
unimplemented!();
}
#[no_mangle]
pub extern "C" fn iswpunct(wc: wint_t) -> c_int {
unimplemented!();
}
#[no_mangle]
pub extern "C" fn iswspace(wc: wint_t) -> c_int {
unimplemented!();
}
#[no_mangle]
pub extern "C" fn iswupper(wc: wint_t) -> c_int {
unimplemented!();
}
#[no_mangle]
pub extern "C" fn iswxdigit(wc: wint_t) -> c_int {
unimplemented!();
}
#[no_mangle]
pub extern "C" fn iswctype(wc: wint_t, charclass: wctype_t) -> c_int {
unimplemented!();
}
#[no_mangle]
pub extern "C" fn towlower(wc: wint_t) -> wint_t {
unimplemented!();
}
#[no_mangle]
pub extern "C" fn towupper(wc: wint_t) -> wint_t {
unimplemented!();
}
#[no_mangle]
pub extern "C" fn wctype(property: *const c_char) -> c_int {
unimplemented!();
}