seasick 0.4.0

FFI-safe nul-terminated strings with ownership semantics
seasick-0.4.0 has been yanked.
Visit the last successful build: seasick-0.4.7

Write and transcribe C APIs.

&CStr and CString are not FFI safe.

#![deny(improper_ctypes)]
extern "C" fn concat(_: &CStr, _: &CStr) -> CString { todo!() }

&SeaStr and [SeaString] are FFI-safe equivalents.

#[deny(improper_ctypes)]
extern "C" fn concat(_: &SeaStr, _: &SeaStr) -> SeaString { todo!() }

They use the non-null niche which is filled by [Option::None].

/** may return null */
char *foo(void);
extern "C" fn foo() -> Option<SeaString> { .. }
assert_eq!(size_of::<Option<SeaString>>(), size_of::<*mut c_char>());

[SeaArray] wraps a [c_char; N] array, providing [SeaStr]-like capabilities. [SeaBox] is an additional owned pointer type, with a pluggable [Allocator]. [till_null] contains iterators for nul-terminated arrays of pointers. [TransmuteFrom] is a powerful trait and derive macro for writing wrappers to C types.