Skip to content

Commit

Permalink
Haiku StringList api addition
Browse files Browse the repository at this point in the history
  • Loading branch information
devnexen committed Mar 11, 2023
1 parent ad7bbf4 commit 542a06e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/unix/haiku/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,12 @@ s! {
pub flag: *mut ::c_int,
pub val: ::c_int,
}

pub struct StringList {
pub sl_str: *mut *mut ::c_char,
pub sl_max: ::size_t,
pub sl_cur: ::size_t,
}
}

s_no_extra_traits! {
Expand Down Expand Up @@ -2017,6 +2023,11 @@ extern "C" {
pub fn strsep(string: *mut *mut ::c_char, delimiters: *const ::c_char) -> *mut ::c_char;
pub fn explicit_bzero(buf: *mut ::c_void, len: ::size_t);
pub fn login_tty(_fd: ::c_int) -> ::c_int;

pub fn sl_init() -> *mut StringList;
pub fn sl_add(sl: *mut StringList, n: *mut ::c_char) -> ::c_int;
pub fn sl_free(sl: *mut StringList, i: ::c_int);
pub fn sl_find(sl: *mut StringList, n: *mut ::c_char) -> *mut ::c_char;
}

cfg_if! {
Expand Down

0 comments on commit 542a06e

Please sign in to comment.