Adding the CString wrapping functionality.

This is currently just wrapping the rust standard library. This should
later become our own implementation.
This commit is contained in:
Myrddin Dundragon 2019-06-24 19:55:35 -04:00
parent 2d6bed361e
commit d148130612
2 changed files with 25 additions and 0 deletions

View File

@ -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;

View File

@ -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};