diff --git a/src/c_types.rs b/src/c_types.rs index 1345ae5..de9c837 100644 --- a/src/c_types.rs +++ b/src/c_types.rs @@ -67,3 +67,26 @@ pub enum CVoid #[doc(hidden)] _Variant2 } + + + +// String types. +/* +#[derive(PartialEq, PartialOrd, Eq, Ord, Hash, Clone)] +pub struct CString +{ + chars: Box<[u8]> +} + +#[derive(Hash)] +pub struct CStr +{ + inner: [CChar] +} +*/ +#[cfg(feature="use_std")] +pub type CStr = ::std::ffi::CStr; +#[cfg(feature="use_std")] +pub type CString = ::std::ffi::CString; +#[cfg(feature="use_std")] +pub type NullByteError = ::std::ffi::NulError; diff --git a/src/lib.rs b/src/lib.rs index 3e16e47..d44d364 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -30,4 +30,6 @@ pub use self::c_types::{CChar, CUChar}; pub use self::c_types::{CShort, CUShort, CInt, CUInt, CLong, CULong}; pub use self::c_types::{CLongLong, CULongLong, CFloat, CDouble}; pub use self::c_types::{CVoid, CReturnVoid}; +#[cfg(feature = "client")] +pub use self::c_types::{CStr, CString, NullByteError}; pub use self::raw::{AsRaw, AsRawMut, AsRawPtr, AsRawMutPtr, FromRaw, IntoRaw};