Skip to content
Snippets Groups Projects
Commit 352f4856 authored by Jeremy Soller's avatar Jeremy Soller
Browse files

Build grp header

parent a9f2e9a9
No related branches found
No related tags found
No related merge requests found
...@@ -97,6 +97,14 @@ name = "fuchsia-zircon-sys" ...@@ -97,6 +97,14 @@ name = "fuchsia-zircon-sys"
version = "0.3.3" version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "grp"
version = "0.1.0"
dependencies = [
"cbindgen 0.5.0",
"platform 0.1.0",
]
[[package]] [[package]]
name = "itoa" name = "itoa"
version = "0.3.4" version = "0.3.4"
...@@ -222,6 +230,7 @@ dependencies = [ ...@@ -222,6 +230,7 @@ dependencies = [
"compiler_builtins 0.1.0 (git+https://github.com/rust-lang-nursery/compiler-builtins.git)", "compiler_builtins 0.1.0 (git+https://github.com/rust-lang-nursery/compiler-builtins.git)",
"ctype 0.1.0", "ctype 0.1.0",
"fcntl 0.1.0", "fcntl 0.1.0",
"grp 0.1.0",
"platform 0.1.0", "platform 0.1.0",
"stdio 0.1.0", "stdio 0.1.0",
"stdlib 0.1.0", "stdlib 0.1.0",
......
...@@ -15,6 +15,7 @@ compiler_builtins = { git = "https://github.com/rust-lang-nursery/compiler-built ...@@ -15,6 +15,7 @@ compiler_builtins = { git = "https://github.com/rust-lang-nursery/compiler-built
platform = { path = "platform" } platform = { path = "platform" }
ctype = { path = "src/ctype" } ctype = { path = "src/ctype" }
fcntl = { path = "src/fcntl" } fcntl = { path = "src/fcntl" }
grp = { path = "src/grp" }
stdio = { path = "src/stdio" } stdio = { path = "src/stdio" }
stdlib = { path = "src/stdlib" } stdlib = { path = "src/stdlib" }
string = { path = "src/string" } string = { path = "src/string" }
......
[package]
name = "grp"
version = "0.1.0"
authors = ["Jeremy Soller <jackpot51@gmail.com>"]
build = "build.rs"
[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/grp.h");
}
sys_includes = []
include_guard = "_GRP_H"
language = "C"
[enum]
prefix_with_name = true
/* automatically generated by rust-bindgen */ //! grp implementation for Redox, following http://pubs.opengroup.org/onlinepubs/7908799/xsh/grp.h.html
#![no_std]
extern crate platform;
use platform::types::*;
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy)]
pub struct group { pub struct group {
pub gr_name: *mut libc::c_char, pub gr_name: *mut c_char,
pub gr_passwd: *mut libc::c_char, pub gr_passwd: *mut c_char,
pub gr_gid: gid_t, pub gr_gid: gid_t,
pub gr_mem: *mut *mut libc::c_char, pub gr_mem: *mut *mut c_char,
}
impl Clone for group {
fn clone(&self) -> Self {
*self
}
} }
#[no_mangle] #[no_mangle]
pub extern "C" fn getgrgid(gid: gid_t) -> *mut group { pub extern "C" fn getgrgid(gid: gid_t) -> *mut group {
unimplemented!(); unimplemented!();
} }
#[no_mangle] #[no_mangle]
pub extern "C" fn getgrnam(name: *const libc::c_char) -> *mut group { pub extern "C" fn getgrnam(name: *const c_char) -> *mut group {
unimplemented!(); unimplemented!();
} }
...@@ -26,21 +28,21 @@ pub extern "C" fn getgrnam(name: *const libc::c_char) -> *mut group { ...@@ -26,21 +28,21 @@ pub extern "C" fn getgrnam(name: *const libc::c_char) -> *mut group {
pub extern "C" fn getgrgid_r( pub extern "C" fn getgrgid_r(
gid: gid_t, gid: gid_t,
grp: *mut group, grp: *mut group,
buffer: *mut libc::c_char, buffer: *mut c_char,
bufsize: usize, bufsize: usize,
result: *mut *mut group, result: *mut *mut group,
) -> libc::c_int { ) -> c_int {
unimplemented!(); unimplemented!();
} }
#[no_mangle] #[no_mangle]
pub extern "C" fn getgrnam_r( pub extern "C" fn getgrnam_r(
name: *const libc::c_char, name: *const c_char,
grp: *mut group, grp: *mut group,
buffer: *mut libc::c_char, buffer: *mut c_char,
bufsize: usize, bufsize: usize,
result: *mut *mut group, result: *mut *mut group,
) -> libc::c_int { ) -> c_int {
unimplemented!(); unimplemented!();
} }
...@@ -58,3 +60,10 @@ pub extern "C" fn endgrent() { ...@@ -58,3 +60,10 @@ pub extern "C" fn endgrent() {
pub extern "C" fn setgrent() { pub extern "C" fn setgrent() {
unimplemented!(); unimplemented!();
} }
/*
#[no_mangle]
pub extern "C" fn func(args) -> c_int {
unimplemented!();
}
*/
...@@ -6,6 +6,7 @@ extern crate platform; ...@@ -6,6 +6,7 @@ extern crate platform;
extern crate ctype; extern crate ctype;
extern crate fcntl; extern crate fcntl;
extern crate grp;
extern crate stdio; extern crate stdio;
extern crate stdlib; extern crate stdlib;
extern crate string; extern crate string;
......
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