pub(crate) unsafe fn pst_parse_number(inbuf: &mut &[u8]) -> Option<PstObj> {
    let inbufend = inbuf.as_ptr().add(inbuf.len());
    let mut cur: *mut u8 = ptr::null_mut();
    errno::set_errno(errno::ZERO);
    let mut lval = strtol(
        inbuf.as_ptr() as *const i8,
        &mut cur as *mut *mut u8 as *mut libc::c_void as *mut *mut i8,
        10,
    ) as i32;
    if errno::errno() != errno::ZERO || b".eE".contains(&*cur) {
        /* real */
        errno::set_errno(errno::ZERO);
        let dval = strtod(
            inbuf.as_ptr() as *const i8,
            &mut cur as *mut *mut u8 as *mut libc::c_void as *mut *mut i8,
        );
        if errno::errno() == errno::ZERO && (cur as *const u8 == inbufend || pst_token_end(*cur)) {
            *inbuf = std::slice::from_raw_parts(cur, inbufend.offset_from(cur) as usize);
            return Some(PstObj::Real(dval));
        }
    } else if cur as *const u8 != inbuf.as_ptr()
        && (cur as *const u8 == inbufend || pst_token_end(*cur))
    {
        /* integer */
        *inbuf = std::slice::from_raw_parts(cur, inbufend.offset_from(cur) as usize);
        return Some(PstObj::Integer(lval));
    } else {
        if lval >= 2
            && lval <= 36
            && *cur as i32 == '#' as i32
            && {
                cur = cur.offset(1);
                (*cur).is_ascii_alphanumeric()
            }
            && (lval != 16
                || *cur.offset(1) as i32 != 'x' as i32 && *cur.offset(1) as i32 != 'X' as i32)
        {
            /* integer with radix */
            /* Can the base have a (plus) sign? I think yes. */
            errno::set_errno(errno::ZERO);
            lval = strtol(
                cur as *mut i8,
                &mut cur as *mut *mut u8 as *mut libc::c_void as *mut *mut i8,
                lval,
            ) as i32;
            if errno::errno() == errno::ZERO
                && (cur as *const u8 == inbufend || pst_token_end(*cur))
            {
                *inbuf = std::slice::from_raw_parts(cur, inbufend.offset_from(cur) as usize);
                return Some(PstObj::Integer(lval));
            }
        }
    }
    /* error */
    None
}
/* leading white-space is ignored */
leading white-space is ignored
leading white - space is ignored
pub(crate) unsafe fn pst_parse_number(inbuf: &mut &[u8]) -> Option<PstObj> {
    let inbufend = inbuf.as_ptr().add(inbuf.len());
    let mut cur: *mut u8 = ptr::null_mut();
    errno::set_errno(errno::ZERO);
    let mut lval = strtol(
        inbuf.as_ptr() as *const i8,
        &mut cur as *mut *mut u8 as *mut libc::c_void as *mut *mut i8,
        10,
    ) as i32;
    if errno::errno() != errno::ZERO || b".eE".contains(&*cur) {
        /* real */
        errno::set_errno(errno::ZERO);
        let dval = strtod(
            inbuf.as_ptr() as *const i8,
            &mut cur as *mut *mut u8 as *mut libc::c_void as *mut *mut i8,
        );
        if errno::errno() == errno::ZERO && (cur as *const u8 == inbufend || pst_token_end(*cur)) {
            *inbuf = std::slice::from_raw_parts(cur, inbufend.offset_from(cur) as usize);
            return Some(PstObj::Real(dval));
        }
    } else if cur as *const u8 != inbuf.as_ptr()
        && (cur as *const u8 == inbufend || pst_token_end(*cur))
    {
        /* integer */
        *inbuf = std::slice::from_raw_parts(cur, inbufend.offset_from(cur) as usize);
        return Some(PstObj::Integer(lval));
    } else {
        if lval >= 2
            && lval <= 36
            && *cur as i32 == '#' as i32
            && {
                cur = cur.offset(1);
                (*cur).is_ascii_alphanumeric()
            }
            && (lval != 16
                || *cur.offset(1) as i32 != 'x' as i32 && *cur.offset(1) as i32 != 'X' as i32)
        {
            /* integer with radix */
            /* Can the base have a (plus) sign? I think yes. */
            errno::set_errno(errno::ZERO);
            lval = strtol(
                cur as *mut i8,
                &mut cur as *mut *mut u8 as *mut libc::c_void as *mut *mut i8,
                lval,
            ) as i32;
            if errno::errno() == errno::ZERO
                && (cur as *const u8 == inbufend || pst_token_end(*cur))
            {
                *inbuf = std::slice::from_raw_parts(cur, inbufend.offset_from(cur) as usize);
                return Some(PstObj::Integer(lval));
            }
        }
    }
    /* error */
    None
}
pub ( crate ) unsafe fn pst_parse_number ( inbuf : & mut & [ u8 ] ) -> Option < PstObj > { let inbufend = inbuf . as_ptr ( ) . add ( inbuf . len ( ) ) ; let mut cur : * mut u8 = ptr :: null_mut ( ) ; errno :: set_errno ( errno :: ZERO ) ; let mut lval = strtol ( inbuf . as_ptr ( ) as * const i8 , & mut cur as * mut * mut u8 as * mut libc :: c_void as * mut * mut i8 , 10 , ) as i32 ; if errno :: errno ( ) != errno :: ZERO || b" " . contains ( & * cur ) { /* real */ errno :: set_errno ( errno :: ZERO ) ; let dval = strtod ( inbuf . as_ptr ( ) as * const i8 , & mut cur as * mut * mut u8 as * mut libc :: c_void as * mut * mut i8 , ) ; if errno :: errno ( ) == errno :: ZERO && ( cur as * const u8 == inbufend || pst_token_end ( * cur ) ) { * inbuf = std :: slice :: from_raw_parts ( cur , inbufend . offset_from ( cur ) as usize ) ; return Some ( PstObj :: Real ( dval ) ) ; } } else if cur as * const u8 != inbuf . as_ptr ( ) && ( cur as * const u8 == inbufend || pst_token_end ( * cur ) ) { /* integer */ * inbuf = std :: slice :: from_raw_parts ( cur , inbufend . offset_from ( cur ) as usize ) ; return Some ( PstObj :: Integer ( lval ) ) ; } else { if lval >= 2 && lval <= 36 && * cur as i32 == '#' as i32 && { cur = cur . offset ( 1 ) ; ( * cur ) . is_ascii_alphanumeric ( ) } && ( lval != 16 || * cur . offset ( 1 ) as i32 != 'x' as i32 && * cur . offset ( 1 ) as i32 != 'X' as i32 ) { /* integer with radix */ /* Can the base have a (plus) sign? I think yes. */ errno :: set_errno ( errno :: ZERO ) ; lval = strtol ( cur as * mut i8 , & mut cur as * mut * mut u8 as * mut libc :: c_void as * mut * mut i8 , lval , ) as i32 ; if errno :: errno ( ) == errno :: ZERO && ( cur as * const u8 == inbufend || pst_token_end ( * cur ) ) { * inbuf = std :: slice :: from_raw_parts ( cur , inbufend . offset_from ( cur ) as usize ) ; return Some ( PstObj :: Integer ( lval ) ) ; } } } /* error */ None }
leading white-space is ignored
leading white - space is ignored
inbuf
&mut &[u8]