pub type CVoid = ::core::ffi::c_void;
pub type CSizeT = usize;
pub type CLongLong = ::core::ffi::c_longlong;
pub type CULongLong = ::core::ffi::c_ulonglong;
pub type CUIntMax = CULongLong;
pub type CIntMax = CLongLong;
pub type CLong = ::core::ffi::c_long;
pub type CULong = ::core::ffi::c_ulong;
pub type CInt = ::core::ffi::c_int;
pub type CUInt = ::core::ffi::c_uint;
pub type CChar = u8;
pub struct CStringIter {
ptr: *const CChar,
idx: isize,
}
impl CStringIter {
pub fn new(s: *const CChar) -> CStringIter {
CStringIter { ptr: s, idx: 0 }
}
}
impl core::iter::Iterator for CStringIter {
type Item = CChar;
fn next(&mut self) -> Option<Self::Item> {
let c = unsafe { *self.ptr.offset(self.idx) };
if c == 0 {
None
} else {
self.idx += 1;
Some(c)
}
}
}