Build ctype with header

This commit is contained in:
Jeremy Soller
2018-03-03 20:33:19 -07:00
parent 083fd72e66
commit c4b88cc1e6
8 changed files with 121 additions and 76 deletions
Generated
+9
View File
@@ -62,6 +62,14 @@ dependencies = [
"platform 0.1.0",
]
[[package]]
name = "ctype"
version = "0.1.0"
dependencies = [
"cbindgen 0.5.0",
"platform 0.1.0",
]
[[package]]
name = "dtoa"
version = "0.4.2"
@@ -212,6 +220,7 @@ name = "relibc"
version = "0.1.0"
dependencies = [
"compiler_builtins 0.1.0 (git+https://github.com/rust-lang-nursery/compiler-builtins.git)",
"ctype 0.1.0",
"fcntl 0.1.0",
"platform 0.1.0",
"stdio 0.1.0",
+1
View File
@@ -13,6 +13,7 @@ members = ["crt0"]
[dependencies]
compiler_builtins = { git = "https://github.com/rust-lang-nursery/compiler-builtins.git", default-features = false, features = ["mem"] }
platform = { path = "platform" }
ctype = { path = "src/ctype" }
fcntl = { path = "src/fcntl" }
stdio = { path = "src/stdio" }
stdlib = { path = "src/stdlib" }
+11
View File
@@ -0,0 +1,11 @@
[package]
name = "ctype"
version = "0.1.0"
authors = ["Jeremy Soller <jackpot51@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/ctype.h");
}
+6
View File
@@ -0,0 +1,6 @@
sys_includes = []
include_guard = "_CTYPE_H"
language = "C"
[enum]
prefix_with_name = true
+82
View File
@@ -0,0 +1,82 @@
//! ctype implementation for Redox, following http://pubs.opengroup.org/onlinepubs/7908799/xsh/ctype.h.html
#![no_std]
extern crate platform;
use platform::types::*;
#[no_mangle]
pub extern "C" fn isalnum(c: c_int) -> c_int {
unimplemented!();
}
#[no_mangle]
pub extern "C" fn isalpha(c: c_int) -> c_int {
unimplemented!();
}
#[no_mangle]
pub extern "C" fn isascii(c: c_int) -> c_int {
unimplemented!();
}
#[no_mangle]
pub extern "C" fn iscntrl(c: c_int) -> c_int {
unimplemented!();
}
#[no_mangle]
pub extern "C" fn isdigit(c: c_int) -> c_int {
unimplemented!();
}
#[no_mangle]
pub extern "C" fn isgraph(c: c_int) -> c_int {
unimplemented!();
}
#[no_mangle]
pub extern "C" fn islower(c: c_int) -> c_int {
unimplemented!();
}
#[no_mangle]
pub extern "C" fn isprint(c: c_int) -> c_int {
unimplemented!();
}
#[no_mangle]
pub extern "C" fn ispunct(c: c_int) -> c_int {
unimplemented!();
}
#[no_mangle]
pub extern "C" fn isspace(c: c_int) -> c_int {
unimplemented!();
}
#[no_mangle]
pub extern "C" fn isupper(c: c_int) -> c_int {
unimplemented!();
}
#[no_mangle]
pub extern "C" fn isxdigit(c: c_int) -> c_int {
unimplemented!();
}
#[no_mangle]
pub extern "C" fn toascii(c: c_int) -> c_int {
unimplemented!();
}
#[no_mangle]
pub extern "C" fn tolower(c: c_int) -> c_int {
unimplemented!();
}
#[no_mangle]
pub extern "C" fn toupper(c: c_int) -> c_int {
unimplemented!();
}
+1
View File
@@ -4,6 +4,7 @@
extern crate compiler_builtins;
extern crate platform;
extern crate ctype;
extern crate fcntl;
extern crate stdio;
extern crate stdlib;
-76
View File
@@ -1,76 +0,0 @@
/* automatically generated by rust-bindgen */
#[no_mangle]
pub extern "C" fn isalnum(c: libc::c_int) -> libc::c_int {
unimplemented!();
}
#[no_mangle]
pub extern "C" fn isalpha(c: libc::c_int) -> libc::c_int {
unimplemented!();
}
#[no_mangle]
pub extern "C" fn isascii(c: libc::c_int) -> libc::c_int {
unimplemented!();
}
#[no_mangle]
pub extern "C" fn iscntrl(c: libc::c_int) -> libc::c_int {
unimplemented!();
}
#[no_mangle]
pub extern "C" fn isdigit(c: libc::c_int) -> libc::c_int {
unimplemented!();
}
#[no_mangle]
pub extern "C" fn isgraph(c: libc::c_int) -> libc::c_int {
unimplemented!();
}
#[no_mangle]
pub extern "C" fn islower(c: libc::c_int) -> libc::c_int {
unimplemented!();
}
#[no_mangle]
pub extern "C" fn isprint(c: libc::c_int) -> libc::c_int {
unimplemented!();
}
#[no_mangle]
pub extern "C" fn ispunct(c: libc::c_int) -> libc::c_int {
unimplemented!();
}
#[no_mangle]
pub extern "C" fn isspace(c: libc::c_int) -> libc::c_int {
unimplemented!();
}
#[no_mangle]
pub extern "C" fn isupper(c: libc::c_int) -> libc::c_int {
unimplemented!();
}
#[no_mangle]
pub extern "C" fn isxdigit(c: libc::c_int) -> libc::c_int {
unimplemented!();
}
#[no_mangle]
pub extern "C" fn toascii(c: libc::c_int) -> libc::c_int {
unimplemented!();
}
#[no_mangle]
pub extern "C" fn tolower(c: libc::c_int) -> libc::c_int {
unimplemented!();
}
#[no_mangle]
pub extern "C" fn toupper(c: libc::c_int) -> libc::c_int {
unimplemented!();
}