WIP: stdio.h

This commit is contained in:
Jeremy Soller
2018-03-03 15:15:50 -07:00
parent 2aff4d41dd
commit e30dec7124
9 changed files with 80 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
[package]
name = "stdio"
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/stdio.h");
}
+7
View File
@@ -0,0 +1,7 @@
sys_includes = ["stdarg.h", "stddef.h"]
include_guard = "_stdio_H"
trailer = "#include <bits/stdio.h>"
language = "C"
[enum]
prefix_with_name = true
+18
View File
@@ -0,0 +1,18 @@
//! stdio implementation for Redox, following http://pubs.opengroup.org/onlinepubs/7908799/xsh/stdio.h.html
#![no_std]
extern crate platform;
use platform::types::*;
pub const BUFSIZ: c_int = 4096;
pub const FILENAME_MAX: c_int = 4096;
/*
#[no_mangle]
pub extern "C" fn func(args) -> c_int {
unimplemented!();
}
*/