Skip to content

Commit 9828bd9

Browse files
committed
Split out getline and strcasestr to supported platforms
1 parent 7eed4d0 commit 9828bd9

File tree

4 files changed

+6
-2
lines changed

4 files changed

+6
-2
lines changed

src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,6 @@ extern "C" {
227227
pub fn fputs(s: *const c_char, stream: *mut FILE) -> c_int;
228228
pub fn puts(s: *const c_char) -> c_int;
229229
pub fn ungetc(c: c_int, stream: *mut FILE) -> c_int;
230-
pub fn getline (lineptr: *mut *mut c_char, n: *mut size_t, stream: *mut FILE) -> ssize_t;
231230
pub fn fread(ptr: *mut c_void, size: size_t, nobj: size_t, stream: *mut FILE) -> size_t;
232231
#[cfg_attr(
233232
all(target_os = "macos", target_arch = "x86"),
@@ -281,7 +280,6 @@ extern "C" {
281280
pub fn strdup(cs: *const c_char) -> *mut c_char;
282281
pub fn strpbrk(cs: *const c_char, ct: *const c_char) -> *mut c_char;
283282
pub fn strstr(cs: *const c_char, ct: *const c_char) -> *mut c_char;
284-
pub fn strcasestr(cs: *const c_char, ct: *const c_char) -> *mut c_char;
285283
pub fn strcasecmp(s1: *const c_char, s2: *const c_char) -> c_int;
286284
pub fn strncasecmp(s1: *const c_char, s2: *const c_char, n: size_t) -> c_int;
287285
pub fn strlen(cs: *const c_char) -> size_t;

src/unix/bsd/apple/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2585,6 +2585,8 @@ extern {
25852585
fd: ::c_int,
25862586
newfd: ::c_int,
25872587
) -> ::c_int;
2588+
2589+
pub fn getline (lineptr: *mut *mut c_char, n: *mut size_t, stream: *mut FILE) -> ssize_t;
25882590
}
25892591

25902592
cfg_if! {

src/unix/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -947,6 +947,8 @@ extern {
947947
pub fn posix_openpt(flags: ::c_int) -> ::c_int;
948948
pub fn ptsname(fd: ::c_int) -> *mut ::c_char;
949949
pub fn unlockpt(fd: ::c_int) -> ::c_int;
950+
951+
pub fn strcasestr(cs: *const c_char, ct: *const c_char) -> *mut c_char;
950952
}
951953

952954
cfg_if! {

src/unix/notbsd/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1229,6 +1229,8 @@ extern {
12291229
flags: ::c_int) -> ::ssize_t;
12301230
pub fn recvmsg(fd: ::c_int, msg: *mut ::msghdr, flags: ::c_int)
12311231
-> ::ssize_t;
1232+
1233+
pub fn getline (lineptr: *mut *mut c_char, n: *mut size_t, stream: *mut FILE) -> ssize_t;
12321234
}
12331235

12341236
cfg_if! {

0 commit comments

Comments
 (0)