Skip to content
Snippets Groups Projects
Unverified Commit 8028c351 authored by Jeremy Soller's avatar Jeremy Soller Committed by GitHub
Browse files

Merge pull request #65 from dlrobertson/add_more_crates

Add more crates for missing headers
parents 089b41da 3699b53b
No related branches found
No related tags found
No related merge requests found
Showing with 281 additions and 4 deletions
...@@ -96,6 +96,23 @@ dependencies = [ ...@@ -96,6 +96,23 @@ dependencies = [
"platform 0.1.0", "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]] [[package]]
name = "fuchsia-zircon" name = "fuchsia-zircon"
version = "0.3.3" version = "0.3.3"
...@@ -254,9 +271,12 @@ dependencies = [ ...@@ -254,9 +271,12 @@ dependencies = [
"ctype 0.1.0", "ctype 0.1.0",
"errno 0.1.0", "errno 0.1.0",
"fcntl 0.1.0", "fcntl 0.1.0",
"fenv 0.1.0",
"float 0.1.0",
"grp 0.1.0", "grp 0.1.0",
"mman 0.1.0", "mman 0.1.0",
"platform 0.1.0", "platform 0.1.0",
"resource 0.1.0",
"semaphore 0.1.0", "semaphore 0.1.0",
"stat 0.1.0", "stat 0.1.0",
"stdio 0.1.0", "stdio 0.1.0",
...@@ -265,6 +285,7 @@ dependencies = [ ...@@ -265,6 +285,7 @@ dependencies = [
"sys_time 0.1.0", "sys_time 0.1.0",
"time 0.1.0", "time 0.1.0",
"unistd 0.1.0", "unistd 0.1.0",
"wait 0.1.0",
"wctype 0.1.0", "wctype 0.1.0",
] ]
...@@ -277,6 +298,15 @@ dependencies = [ ...@@ -277,6 +298,15 @@ dependencies = [
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", "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]] [[package]]
name = "rustc-ap-proc_macro" name = "rustc-ap-proc_macro"
version = "40.0.0" version = "40.0.0"
...@@ -612,6 +642,15 @@ name = "vec_map" ...@@ -612,6 +642,15 @@ name = "vec_map"
version = "0.8.0" version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index" 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]] [[package]]
name = "wctype" name = "wctype"
version = "0.1.0" version = "0.1.0"
......
...@@ -12,13 +12,16 @@ members = ["src/crt0"] ...@@ -12,13 +12,16 @@ members = ["src/crt0"]
[dependencies] [dependencies]
compiler_builtins = { git = "https://github.com/rust-lang-nursery/compiler-builtins.git", default-features = false, features = ["mem"] } 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" } ctype = { path = "src/ctype" }
errno = { path = "src/errno" } errno = { path = "src/errno" }
fcntl = { path = "src/fcntl" } fcntl = { path = "src/fcntl" }
fenv = { path = "src/fenv" }
float = { path = "src/float" }
grp = { path = "src/grp" } grp = { path = "src/grp" }
semaphore = { path = "src/semaphore" } semaphore = { path = "src/semaphore" }
mman = { path = "src/mman" } mman = { path = "src/mman" }
platform = { path = "src/platform" }
resource = { path = "src/resource" }
stat = { path = "src/stat" } stat = { path = "src/stat" }
stdio = { path = "src/stdio" } stdio = { path = "src/stdio" }
stdlib = { path = "src/stdlib" } stdlib = { path = "src/stdlib" }
...@@ -26,6 +29,7 @@ string = { path = "src/string" } ...@@ -26,6 +29,7 @@ string = { path = "src/string" }
sys_time = { path = "src/sys_time" } sys_time = { path = "src/sys_time" }
time = { path = "src/time" } time = { path = "src/time" }
unistd = { path = "src/unistd" } unistd = { path = "src/unistd" }
wait = { path = "src/wait" }
wctype = { path = "src/wctype" } wctype = { path = "src/wctype" }
[profile.dev] [profile.dev]
......
#ifndef _BITS_FLOAT_H
#define _BITS_FLOAT_H
#define FLT_ROUNDS (flt_rounds())
#endif
...@@ -8,6 +8,7 @@ typedef long dev_t; ...@@ -8,6 +8,7 @@ typedef long dev_t;
typedef unsigned long ino_t; typedef unsigned long ino_t;
typedef int gid_t; typedef int gid_t;
typedef int uid_t; typedef int uid_t;
typedef int mode_t; typedef int mode_t;
...@@ -18,6 +19,8 @@ typedef long off_t; ...@@ -18,6 +19,8 @@ typedef long off_t;
typedef int pid_t; typedef int pid_t;
typedef unsigned id_t;
typedef long ssize_t; typedef long ssize_t;
typedef long time_t; typedef long time_t;
......
[package]
name = "fenv"
version = "0.1.0"
authors = ["Dan Robertson <danlrobertson89@gmail.com>"]
[build-dependencies]
cbindgen = { path = "../../cbindgen" }
[dependencies]
platform = { path = "../platform" }
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");
}
sys_includes = ["sys/types.h"]
include_guard = "_FENV_H"
language = "C"
[enum]
prefix_with_name = true
//! 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!();
}
[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" }
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");
}
sys_includes = ["sys/types.h", "bits/float.h"]
include_guard = "_FLOAT_H"
language = "C"
[enum]
prefix_with_name = true
//! 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,
}
}
...@@ -7,5 +7,5 @@ fn main() { ...@@ -7,5 +7,5 @@ fn main() {
fs::create_dir_all("../../target/include").expect("failed to create include directory"); fs::create_dir_all("../../target/include").expect("failed to create include directory");
cbindgen::generate(crate_dir) cbindgen::generate(crate_dir)
.expect("failed to generate bindings") .expect("failed to generate bindings")
.write_to_file("../../target/include/mman.h"); .write_to_file("../../target/include/sys/mman.h");
} }
sys_includes = [] sys_includes = ["sys/types.h"]
include_guard = "_MMAN_H" include_guard = "_SYS_MMAN_H"
language = "C" language = "C"
[enum] [enum]
......
...@@ -50,6 +50,7 @@ pub type off_t = i64; ...@@ -50,6 +50,7 @@ pub type off_t = i64;
pub type mode_t = u16; pub type mode_t = u16;
pub type time_t = i64; pub type time_t = i64;
pub type pid_t = usize; pub type pid_t = usize;
pub type id_t = usize;
pub type gid_t = usize; pub type gid_t = usize;
pub type uid_t = usize; pub type uid_t = usize;
pub type dev_t = usize; pub type dev_t = usize;
......
[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" }
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");
}
sys_includes = ["sys/types.h"]
include_guard = "_SYS_RESOURCE_H"
language = "C"
[enum]
prefix_with_name = true
//! 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!();
}
[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" }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment