Skip to content
Snippets Groups Projects
Commit 6cf4b3bf authored by Paul Sajna's avatar Paul Sajna
Browse files

build semaphore header

parent eea3f0ed
No related branches found
No related tags found
1 merge request!10build semaphore header
[package]
name = "semaphore"
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/semaphore.h");
}
sys_includes = []
include_guard = "_SEMAPHORE_H"
language = "C"
[enum]
prefix_with_name = true
#![no_std]
extern crate platform;
use platform::types::*;
#[repr(C)] #[repr(C)]
#[derive(Copy)] #[derive(Copy)]
pub union sem_t { pub union sem_t {
pub size: [libc::c_char; 32usize], pub size: [c_char; 32usize],
pub align: libc::c_long, pub align: c_long,
_bindgen_union_align: [u64; 4usize], _bindgen_union_align: [u64; 4usize],
} }
impl Clone for sem_t { impl Clone for sem_t {
fn clone(&self) -> Self { *self } fn clone(&self) -> Self { *self }
} }
#[no_mangle] #[no_mangle]
pub extern "C" fn sem_init(sem: *mut sem_t, pshared: libc::c_int, pub extern "C" fn sem_init(sem: *mut sem_t, pshared: c_int,
value: libc::c_uint) -> libc::c_int { value: c_uint) -> c_int {
unimplemented!(); unimplemented!();
} }
#[no_mangle] #[no_mangle]
pub extern "C" fn sem_destroy(sem: *mut sem_t) -> libc::c_int { pub extern "C" fn sem_destroy(sem: *mut sem_t) -> c_int {
unimplemented!(); unimplemented!();
} }
#[no_mangle] #[no_mangle]
pub extern "C" fn sem_open(name: *const libc::c_char, pub extern "C" fn sem_open(name: *const c_char,
oflag: libc::c_int, ...) -> *mut sem_t { oflag: c_int, ...) -> *mut sem_t {
unimplemented!(); unimplemented!();
} }
#[no_mangle] #[no_mangle]
pub extern "C" fn sem_close(sem: *mut sem_t) -> libc::c_int { pub extern "C" fn sem_close(sem: *mut sem_t) -> c_int {
unimplemented!(); unimplemented!();
} }
#[no_mangle] #[no_mangle]
pub extern "C" fn sem_unlink(name: *const libc::c_char) pub extern "C" fn sem_unlink(name: *const c_char)
-> libc::c_int { -> c_int {
unimplemented!(); unimplemented!();
} }
#[no_mangle] #[no_mangle]
pub extern "C" fn sem_wait(sem: *mut sem_t) -> libc::c_int { pub extern "C" fn sem_wait(sem: *mut sem_t) -> c_int {
unimplemented!(); unimplemented!();
} }
#[no_mangle] #[no_mangle]
pub extern "C" fn sem_timedwait(sem: *mut sem_t, abstime: *const timespec) pub extern "C" fn sem_timedwait(sem: *mut sem_t, abstime: *const timespec)
-> libc::c_int { -> c_int {
unimplemented!(); unimplemented!();
} }
#[no_mangle] #[no_mangle]
pub extern "C" fn sem_trywait(sem: *mut sem_t) -> libc::c_int { pub extern "C" fn sem_trywait(sem: *mut sem_t) -> c_int {
unimplemented!(); unimplemented!();
} }
#[no_mangle] #[no_mangle]
pub extern "C" fn sem_post(sem: *mut sem_t) -> libc::c_int { pub extern "C" fn sem_post(sem: *mut sem_t) -> c_int {
unimplemented!(); unimplemented!();
} }
#[no_mangle] #[no_mangle]
pub extern "C" fn sem_getvalue(sem: *mut sem_t, sval: *mut libc::c_int) pub extern "C" fn sem_getvalue(sem: *mut sem_t, sval: *mut c_int)
-> libc::c_int { -> c_int {
unimplemented!(); unimplemented!();
} }
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