summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Parker-Shemilt <palfrey@tevp.net>2018-11-20 23:43:54 +0000
committerTom Parker-Shemilt <palfrey@tevp.net>2018-11-20 23:43:54 +0000
commit9828bd999ee799b5275d8b986a4f0c40ffa23f70 (patch)
treeacf25be0b2136bb4c546cec88c9e452469e6e8fc
parent7eed4d05a2e08d93cd069f72c88f0d0c28ccf9e5 (diff)
downloadrust-libc-9828bd999ee799b5275d8b986a4f0c40ffa23f70.tar.gz
Split out getline and strcasestr to supported platforms
-rw-r--r--src/lib.rs2
-rw-r--r--src/unix/bsd/apple/mod.rs2
-rw-r--r--src/unix/mod.rs2
-rw-r--r--src/unix/notbsd/mod.rs2
4 files changed, 6 insertions, 2 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 82c0385ea2..c0a28fcbdc 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -227,7 +227,6 @@ extern "C" {
pub fn fputs(s: *const c_char, stream: *mut FILE) -> c_int;
pub fn puts(s: *const c_char) -> c_int;
pub fn ungetc(c: c_int, stream: *mut FILE) -> c_int;
- pub fn getline (lineptr: *mut *mut c_char, n: *mut size_t, stream: *mut FILE) -> ssize_t;
pub fn fread(ptr: *mut c_void, size: size_t, nobj: size_t, stream: *mut FILE) -> size_t;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
@@ -281,7 +280,6 @@ extern "C" {
pub fn strdup(cs: *const c_char) -> *mut c_char;
pub fn strpbrk(cs: *const c_char, ct: *const c_char) -> *mut c_char;
pub fn strstr(cs: *const c_char, ct: *const c_char) -> *mut c_char;
- pub fn strcasestr(cs: *const c_char, ct: *const c_char) -> *mut c_char;
pub fn strcasecmp(s1: *const c_char, s2: *const c_char) -> c_int;
pub fn strncasecmp(s1: *const c_char, s2: *const c_char, n: size_t) -> c_int;
pub fn strlen(cs: *const c_char) -> size_t;
diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs
index ee8108de92..50bc57f47a 100644
--- a/src/unix/bsd/apple/mod.rs
+++ b/src/unix/bsd/apple/mod.rs
@@ -2585,6 +2585,8 @@ extern {
fd: ::c_int,
newfd: ::c_int,
) -> ::c_int;
+
+ pub fn getline (lineptr: *mut *mut c_char, n: *mut size_t, stream: *mut FILE) -> ssize_t;
}
cfg_if! {
diff --git a/src/unix/mod.rs b/src/unix/mod.rs
index 06275a6994..84c31ce78e 100644
--- a/src/unix/mod.rs
+++ b/src/unix/mod.rs
@@ -947,6 +947,8 @@ extern {
pub fn posix_openpt(flags: ::c_int) -> ::c_int;
pub fn ptsname(fd: ::c_int) -> *mut ::c_char;
pub fn unlockpt(fd: ::c_int) -> ::c_int;
+
+ pub fn strcasestr(cs: *const c_char, ct: *const c_char) -> *mut c_char;
}
cfg_if! {
diff --git a/src/unix/notbsd/mod.rs b/src/unix/notbsd/mod.rs
index 6e4500684e..d3d7924462 100644
--- a/src/unix/notbsd/mod.rs
+++ b/src/unix/notbsd/mod.rs
@@ -1229,6 +1229,8 @@ extern {
flags: ::c_int) -> ::ssize_t;
pub fn recvmsg(fd: ::c_int, msg: *mut ::msghdr, flags: ::c_int)
-> ::ssize_t;
+
+ pub fn getline (lineptr: *mut *mut c_char, n: *mut size_t, stream: *mut FILE) -> ssize_t;
}
cfg_if! {