Merge pull request #65 from dlrobertson/add_more_crates

Add more crates for missing headers
This commit is contained in:
Jeremy Soller
2018-03-10 21:52:30 -07:00
committed by GitHub
23 changed files with 341 additions and 4 deletions
Generated
+39
View File
@@ -96,6 +96,23 @@ dependencies = [
"platform 0.1.0",
]
[[package]]
name = "fenv"
version = "0.1.0"
dependencies = [
"cbindgen 0.5.0",
"platform 0.1.0",
]
[[package]]
name = "float"
version = "0.1.0"
dependencies = [
"cbindgen 0.5.0",
"fenv 0.1.0",
"platform 0.1.0",
]
[[package]]
name = "fuchsia-zircon"
version = "0.3.3"
@@ -254,9 +271,12 @@ dependencies = [
"ctype 0.1.0",
"errno 0.1.0",
"fcntl 0.1.0",
"fenv 0.1.0",
"float 0.1.0",
"grp 0.1.0",
"mman 0.1.0",
"platform 0.1.0",
"resource 0.1.0",
"semaphore 0.1.0",
"stat 0.1.0",
"stdio 0.1.0",
@@ -265,6 +285,7 @@ dependencies = [
"sys_time 0.1.0",
"time 0.1.0",
"unistd 0.1.0",
"wait 0.1.0",
"wctype 0.1.0",
]
@@ -277,6 +298,15 @@ dependencies = [
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "resource"
version = "0.1.0"
dependencies = [
"cbindgen 0.5.0",
"platform 0.1.0",
"sys_time 0.1.0",
]
[[package]]
name = "rustc-ap-proc_macro"
version = "40.0.0"
@@ -612,6 +642,15 @@ name = "vec_map"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "wait"
version = "0.1.0"
dependencies = [
"cbindgen 0.5.0",
"platform 0.1.0",
"resource 0.1.0",
]
[[package]]
name = "wctype"
version = "0.1.0"
+5 -1
View File
@@ -12,13 +12,16 @@ members = ["src/crt0"]
[dependencies]
compiler_builtins = { git = "https://github.com/rust-lang-nursery/compiler-builtins.git", default-features = false, features = ["mem"] }
platform = { path = "src/platform" }
ctype = { path = "src/ctype" }
errno = { path = "src/errno" }
fcntl = { path = "src/fcntl" }
fenv = { path = "src/fenv" }
float = { path = "src/float" }
grp = { path = "src/grp" }
semaphore = { path = "src/semaphore" }
mman = { path = "src/mman" }
platform = { path = "src/platform" }
resource = { path = "src/resource" }
stat = { path = "src/stat" }
stdio = { path = "src/stdio" }
stdlib = { path = "src/stdlib" }
@@ -26,6 +29,7 @@ string = { path = "src/string" }
sys_time = { path = "src/sys_time" }
time = { path = "src/time" }
unistd = { path = "src/unistd" }
wait = { path = "src/wait" }
wctype = { path = "src/wctype" }
[profile.dev]
+6
View File
@@ -0,0 +1,6 @@
#ifndef _BITS_FLOAT_H
#define _BITS_FLOAT_H
#define FLT_ROUNDS (flt_rounds())
#endif
+3
View File
@@ -8,6 +8,7 @@ typedef long dev_t;
typedef unsigned long ino_t;
typedef int gid_t;
typedef int uid_t;
typedef int mode_t;
@@ -18,6 +19,8 @@ typedef long off_t;
typedef int pid_t;
typedef unsigned id_t;
typedef long ssize_t;
typedef long time_t;
+10
View File
@@ -0,0 +1,10 @@
[package]
name = "fenv"
version = "0.1.0"
authors = ["Dan Robertson <danlrobertson89@gmail.com>"]
[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/fenv.h");
}
+6
View File
@@ -0,0 +1,6 @@
sys_includes = ["sys/types.h"]
include_guard = "_FENV_H"
language = "C"
[enum]
prefix_with_name = true
+62
View File
@@ -0,0 +1,62 @@
//! fenv.h implementation for Redox, following
//! http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/fenv.h.html
#![no_std]
extern crate platform;
use platform::types::*;
pub const FE_ALL_EXCEPT: c_int = 0;
pub const FE_TONEAREST: c_int = 0;
pub type fexcept_t = u64;
#[repr(C)]
pub struct fenv_t {
pub cw: u64,
}
pub unsafe extern "C" fn feclearexcept(excepts: c_int) -> c_int {
unimplemented!();
}
pub unsafe extern "C" fn fegenenv(envp: *mut fenv_t) -> c_int {
unimplemented!();
}
pub unsafe extern "C" fn fegetexceptflag(flagp: *mut fexcept_t, excepts: c_int) -> c_int {
unimplemented!();
}
pub unsafe extern "C" fn fegetround() -> c_int {
FE_TONEAREST
}
pub unsafe extern "C" fn feholdexcept(envp: *mut fenv_t) -> c_int {
unimplemented!();
}
pub unsafe extern "C" fn feraiseexcept(except: c_int) -> c_int {
unimplemented!();
}
pub unsafe extern "C" fn fesetenv(envp: *const fenv_t) -> c_int {
unimplemented!();
}
pub unsafe extern "C" fn fesetexceptflag(flagp: *const fexcept_t, excepts: c_int) -> c_int {
unimplemented!();
}
pub unsafe extern "C" fn fesetround(round: c_int) -> c_int {
unimplemented!();
}
pub unsafe extern "C" fn fetestexcept(excepts: c_int) -> c_int {
unimplemented!();
}
pub unsafe extern "C" fn feupdateenv(envp: *const fenv_t) -> c_int {
unimplemented!();
}
+11
View File
@@ -0,0 +1,11 @@
[package]
name = "float"
version = "0.1.0"
authors = ["Dan Robertson <danlrobertson89@gmail.com>"]
[build-dependencies]
cbindgen = { path = "../../cbindgen" }
[dependencies]
platform = { path = "../platform" }
fenv = { path = "../fenv" }
+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/float.h");
}
+6
View File
@@ -0,0 +1,6 @@
sys_includes = ["sys/types.h", "bits/float.h"]
include_guard = "_FLOAT_H"
language = "C"
[enum]
prefix_with_name = true
+19
View File
@@ -0,0 +1,19 @@
//! float.h implementation for Redox, following
//! http://pubs.opengroup.org/onlinepubs/7908799/xsh/float.h.html
#![no_std]
extern crate fenv;
extern crate platform;
use platform::types::*;
use fenv::{fegetround, FE_TONEAREST};
pub const FLT_RADIX: c_int = 2;
pub unsafe extern "C" fn flt_rounds() -> c_int {
match fegetround() {
FE_TONEAREST => 1,
_ => -1,
}
}
+1 -1
View File
@@ -7,5 +7,5 @@ fn main() {
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/mman.h");
.write_to_file("../../target/include/sys/mman.h");
}
+2 -2
View File
@@ -1,5 +1,5 @@
sys_includes = []
include_guard = "_MMAN_H"
sys_includes = ["sys/types.h"]
include_guard = "_SYS_MMAN_H"
language = "C"
[enum]
+1
View File
@@ -50,6 +50,7 @@ pub type off_t = i64;
pub type mode_t = u16;
pub type time_t = i64;
pub type pid_t = usize;
pub type id_t = usize;
pub type gid_t = usize;
pub type uid_t = usize;
pub type dev_t = usize;
+11
View File
@@ -0,0 +1,11 @@
[package]
name = "resource"
version = "0.1.0"
authors = ["Dan Robertson <danlrobertson89@gmail.com>"]
[build-dependencies]
cbindgen = { path = "../../cbindgen" }
[dependencies]
platform = { path = "../platform" }
sys_time = { path = "../sys_time" }
+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/sys/resource.h");
}
+6
View File
@@ -0,0 +1,6 @@
sys_includes = ["sys/types.h"]
include_guard = "_SYS_RESOURCE_H"
language = "C"
[enum]
prefix_with_name = true
+49
View File
@@ -0,0 +1,49 @@
//! sys/resource.h implementation for Redox, following
//! http://pubs.opengroup.org/onlinepubs/7908799/xsh/sysresource.h.html
#![no_std]
extern crate platform;
extern crate sys_time;
use platform::types::*;
use sys_time::timeval;
type rlim_t = u64;
#[repr(C)]
pub struct rlimit {
pub rlim_cur: rlim_t,
pub rlim_max: rlim_t,
}
#[repr(C)]
pub struct rusage {
pub ru_utime: timeval,
pub ru_stime: timeval,
}
#[no_mangle]
pub unsafe extern "C" fn getpriority(which: c_int, who: id_t) -> c_int {
unimplemented!();
}
#[no_mangle]
pub unsafe extern "C" fn getrlimit(resource: c_int, rlp: *mut rlimit) -> c_int {
unimplemented!();
}
#[no_mangle]
pub unsafe extern "C" fn getrusage(who: c_int, r_usage: *mut rusage) -> c_int {
unimplemented!();
}
#[no_mangle]
pub unsafe extern "C" fn setpriority(which: c_int, who: id_t, nice: c_int) -> c_int {
unimplemented!();
}
#[no_mangle]
pub unsafe extern "C" fn setrlimit(resource: c_int, rlp: *const rlimit) -> c_int {
unimplemented!();
}
+11
View File
@@ -0,0 +1,11 @@
[package]
name = "wait"
version = "0.1.0"
authors = ["Dan Robertson <danlrobertson89@gmail.com>"]
[build-dependencies]
cbindgen = { path = "../../cbindgen" }
[dependencies]
platform = { path = "../platform" }
resource = { path = "../resource" }
+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/sys/wait.h");
}
+6
View File
@@ -0,0 +1,6 @@
sys_includes = ["sys/types.h", "sys/resource.h"]
include_guard = "_SYS_WAIT_H"
language = "C"
[enum]
prefix_with_name = true
+43
View File
@@ -0,0 +1,43 @@
//! sys/wait.h implementation for Redox, following
//! http://pubs.opengroup.org/onlinepubs/7908799/xsh/syswait.h.html
#![no_std]
extern crate platform;
extern crate resource;
use platform::types::*;
use resource::rusage;
#[no_mangle]
pub unsafe extern "C" fn wait(stat_loc: *mut c_int) -> pid_t {
unimplemented!();
}
#[no_mangle]
pub unsafe extern "C" fn wait3(
stat_loc: *mut c_int,
options: c_int,
resource_usage: *mut rusage,
) -> pid_t {
unimplemented!();
}
/*
* TODO: implement idtype_t, id_t, and siginfo_t
*
* #[no_mangle]
* pub unsafe extern "C" fn waitid(
* idtype: idtype_t,
* id: id_t,
* infop: siginfo_t,
* options: c_int
* ) -> c_int {
* unimplemented!();
* }
*/
#[no_mangle]
pub unsafe extern "C" fn waitpid(pid: pid_t, stat_loc: *mut c_int, options: c_int) -> pid_t {
unimplemented!();
}