diff --git a/string/cbindgen.toml b/string/cbindgen.toml index b7762a3faa288497fd2c964fbdbdb65954f68db3..33100dc2741217ff537ea809f9fda7b506b2105f 100644 --- a/string/cbindgen.toml +++ b/string/cbindgen.toml @@ -1,4 +1,4 @@ -sys_includes = ["stddef.h"] +sys_includes = ["stddef.h", "stdint.h"] include_guard = "_STRING_H" language = "C" diff --git a/string/lib.rs b/string/lib.rs deleted file mode 100644 index 7e6362b80f00a2b9ad95825250451909e401f26d..0000000000000000000000000000000000000000 --- a/string/lib.rs +++ /dev/null @@ -1,177 +0,0 @@ -/* automatically generated by rust-bindgen */ - -#[no_mangle] -pub extern "C" fn memccpy( - s1: *mut libc::c_void, - s2: *const libc::c_void, - c: libc::c_int, - n: usize, -) -> *mut libc::c_void { - unimplemented!(); -} - -#[no_mangle] -pub extern "C" fn memchr( - s: *const libc::c_void, - c: libc::c_int, - n: usize, -) -> *mut libc::c_void { - unimplemented!(); -} - -#[no_mangle] -pub extern "C" fn memcmp( - s1: *const libc::c_void, - s2: *const libc::c_void, - n: usize, -) -> libc::c_int { - unimplemented!(); -} - -#[no_mangle] -pub extern "C" fn memcpy( - s1: *mut libc::c_void, - s2: *const libc::c_void, - n: usize, -) -> *mut libc::c_void { - unimplemented!(); -} - -#[no_mangle] -pub extern "C" fn memmove( - s1: *mut libc::c_void, - s2: *const libc::c_void, - n: usize, -) -> *mut libc::c_void { - unimplemented!(); -} - -#[no_mangle] -pub extern "C" fn memset( - s: *mut libc::c_void, - c: libc::c_int, - n: usize, -) -> *mut libc::c_void { - unimplemented!(); -} - -#[no_mangle] -pub extern "C" fn strcat(s1: *mut libc::c_char, s2: *const libc::c_char) -> *mut libc::c_char { - unimplemented!(); -} - -#[no_mangle] -pub extern "C" fn strchr(s: *const libc::c_char, c: libc::c_int) -> *mut libc::c_char { - unimplemented!(); -} - -#[no_mangle] -pub extern "C" fn strcmp(s1: *const libc::c_char, s2: *const libc::c_char) -> libc::c_int { - unimplemented!(); -} - -#[no_mangle] -pub extern "C" fn strcoll(s1: *const libc::c_char, s2: *const libc::c_char) -> libc::c_int { - unimplemented!(); -} - -#[no_mangle] -pub extern "C" fn strcpy(s1: *mut libc::c_char, s2: *const libc::c_char) -> *mut libc::c_char { - unimplemented!(); -} - -#[no_mangle] -pub extern "C" fn strcspn(s1: *const libc::c_char, s2: *const libc::c_char) -> libc::c_ulong { - unimplemented!(); -} - -#[no_mangle] -pub extern "C" fn strdup(s1: *const libc::c_char) -> *mut libc::c_char { - unimplemented!(); -} - -#[no_mangle] -pub extern "C" fn strerror(errnum: libc::c_int) -> *mut libc::c_char { - unimplemented!(); -} - -#[no_mangle] -pub extern "C" fn strlen(s: *const libc::c_char) -> libc::c_ulong { - unimplemented!(); -} - -#[no_mangle] -pub extern "C" fn strncat( - s1: *mut libc::c_char, - s2: *const libc::c_char, - n: usize, -) -> *mut libc::c_char { - unimplemented!(); -} - -#[no_mangle] -pub extern "C" fn strncmp( - s1: *const libc::c_char, - s2: *const libc::c_char, - n: usize, -) -> libc::c_int { - unimplemented!(); -} - -#[no_mangle] -pub extern "C" fn strncpy( - s1: *mut libc::c_char, - s2: *const libc::c_char, - n: usize, -) -> *mut libc::c_char { - unimplemented!(); -} - -#[no_mangle] -pub extern "C" fn strpbrk( - s1: *const libc::c_char, - s2: *const libc::c_char, -) -> *mut libc::c_char { - unimplemented!(); -} - -#[no_mangle] -pub extern "C" fn strrchr(s: *const libc::c_char, c: libc::c_int) -> *mut libc::c_char { - unimplemented!(); -} - -#[no_mangle] -pub extern "C" fn strspn(s1: *const libc::c_char, s2: *const libc::c_char) -> libc::c_ulong { - unimplemented!(); -} - -#[no_mangle] -pub extern "C" fn strstr( - s1: *const libc::c_char, - s2: *const libc::c_char, -) -> *mut libc::c_char { - unimplemented!(); -} - -#[no_mangle] -pub extern "C" fn strtok(s1: *mut libc::c_char, s2: *const libc::c_char) -> *mut libc::c_char { - unimplemented!(); -} - -#[no_mangle] -pub extern "C" fn strtok_r( - s: *mut libc::c_char, - sep: *const libc::c_char, - lasts: *mut *mut libc::c_char, -) -> *mut libc::c_char { - unimplemented!(); -} - -#[no_mangle] -pub extern "C" fn strxfrm( - s1: *mut libc::c_char, - s2: *const libc::c_char, - n: usize, -) -> libc::c_ulong { - unimplemented!(); -} diff --git a/string/src/lib.rs b/string/src/lib.rs index 12b4ea3dbc03a320fc7be349ad1ea6fe76055f50..eb98911358dda695825aee8bda1e8b910010e226 100644 --- a/string/src/lib.rs +++ b/string/src/lib.rs @@ -6,6 +6,102 @@ extern crate platform; use platform::types::*; + +#[no_mangle] +pub extern "C" fn memccpy( + s1: *mut c_void, + s2: *const c_void, + c: c_int, + n: usize, +) -> *mut c_void { + unimplemented!(); +} + +#[no_mangle] +pub extern "C" fn memchr( + s: *const c_void, + c: c_int, + n: usize, +) -> *mut c_void { + unimplemented!(); +} + +// #[no_mangle] +// pub extern "C" fn memcmp( +// s1: *const c_void, +// s2: *const c_void, +// n: usize, +// ) -> c_int { +// unimplemented!(); +// } + +// #[no_mangle] +// pub extern "C" fn memcpy( +// s1: *mut c_void, +// s2: *const c_void, +// n: usize, +// ) -> *mut c_void { +// unimplemented!(); +// } + +// #[no_mangle] +// pub extern "C" fn memmove( +// s1: *mut c_void, +// s2: *const c_void, +// n: usize, +// ) -> *mut c_void { +// unimplemented!(); +// } + +// #[no_mangle] +// pub extern "C" fn memset( +// s: *mut c_void, +// c: c_int, +// n: usize, +// ) -> *mut c_void { +// unimplemented!(); +// } + +#[no_mangle] +pub extern "C" fn strcat(s1: *mut c_char, s2: *const c_char) -> *mut c_char { + unimplemented!(); +} + +#[no_mangle] +pub extern "C" fn strchr(s: *const c_char, c: c_int) -> *mut c_char { + unimplemented!(); +} + +#[no_mangle] +pub extern "C" fn strcmp(s1: *const c_char, s2: *const c_char) -> c_int { + unimplemented!(); +} + +#[no_mangle] +pub extern "C" fn strcoll(s1: *const c_char, s2: *const c_char) -> c_int { + unimplemented!(); +} + +#[no_mangle] +pub extern "C" fn strcpy(s1: *mut c_char, s2: *const c_char) -> *mut c_char { + unimplemented!(); +} + +#[no_mangle] +pub extern "C" fn strcspn(s1: *const c_char, s2: *const c_char) -> c_ulong { + unimplemented!(); +} + +#[no_mangle] +pub extern "C" fn strdup(s1: *const c_char) -> *mut c_char { + unimplemented!(); +} + +#[no_mangle] +pub extern "C" fn strerror(errnum: c_int) -> *mut c_char { + unimplemented!(); +} + #[no_mangle] pub unsafe extern "C" fn strlen(s: *const c_char) -> size_t { let mut size = 0; @@ -20,6 +116,82 @@ pub unsafe extern "C" fn strlen(s: *const c_char) -> size_t { size as size_t } +#[no_mangle] +pub extern "C" fn strncat( + s1: *mut c_char, + s2: *const c_char, + n: usize, +) -> *mut c_char { + unimplemented!(); +} + +#[no_mangle] +pub extern "C" fn strncmp( + s1: *const c_char, + s2: *const c_char, + n: usize, +) -> c_int { + unimplemented!(); +} + +#[no_mangle] +pub extern "C" fn strncpy( + s1: *mut c_char, + s2: *const c_char, + n: usize, +) -> *mut c_char { + unimplemented!(); +} + +#[no_mangle] +pub extern "C" fn strpbrk( + s1: *const c_char, + s2: *const c_char, +) -> *mut c_char { + unimplemented!(); +} + +#[no_mangle] +pub extern "C" fn strrchr(s: *const c_char, c: c_int) -> *mut c_char { + unimplemented!(); +} + +#[no_mangle] +pub extern "C" fn strspn(s1: *const c_char, s2: *const c_char) -> c_ulong { + unimplemented!(); +} + +#[no_mangle] +pub extern "C" fn strstr( + s1: *const c_char, + s2: *const c_char, +) -> *mut c_char { + unimplemented!(); +} + +#[no_mangle] +pub extern "C" fn strtok(s1: *mut c_char, s2: *const c_char) -> *mut c_char { + unimplemented!(); +} + +#[no_mangle] +pub extern "C" fn strtok_r( + s: *mut c_char, + sep: *const c_char, + lasts: *mut *mut c_char, +) -> *mut c_char { + unimplemented!(); +} + +#[no_mangle] +pub extern "C" fn strxfrm( + s1: *mut c_char, + s2: *const c_char, + n: usize, +) -> c_ulong { + unimplemented!(); +} + /* #[no_mangle] pub extern "C" fn func(args) -> c_int {