stdlib.h revision a734c64bff58bda2fa48c2795453e092167b0ff7
#ifndef STDLIB_H
#define STDLIB_H
#include <stdint.h>
#include <assert.h>
/*****************************************************************************
*
* Numeric parsing
*
****************************************************************************
*/
{
const char *p = *pp;
if ( base == 0 ) {
base = 10;
if ( *p == '0' ) {
p++;
base = 8;
if ( ( *p | 0x20 ) == 'x' ) {
p++;
base = 16;
}
}
}
*pp = p;
return base;
}
static inline unsigned int strtoul_charval ( unsigned int charval )
{
if ( charval >= 'a' ) {
} else if ( charval >= 'A' ) {
} else if ( charval <= '9' ) {
}
return charval;
}
/*****************************************************************************
*
* Memory allocation
*
****************************************************************************
*/
/**
* Allocate cleared memory
*
* @v nmemb Number of members
* @v size Size of each member
* @ret ptr Allocated memory
*
* Allocate memory as per malloc(), and zero it.
*
* This is implemented as a static inline, with the body of the
* function in zalloc(), since in most cases @c nmemb will be 1 and
* doing the multiply is just wasteful.
*/
}
/*****************************************************************************
*
* Random number generation
*
****************************************************************************
*/
extern long int random ( void );
static inline int rand ( void ) {
return random();
}
}
/*****************************************************************************
*
* Miscellaneous
*
****************************************************************************
*/
#endif /* STDLIB_H */