2005-04-30 13:48:48 +00:00
|
|
|
#ifndef STDLIB_H
|
|
|
|
#define STDLIB_H
|
|
|
|
|
2006-04-30 11:45:38 +00:00
|
|
|
extern unsigned long strtoul ( const char *p, char **endp, int base );
|
2006-12-02 20:10:21 +00:00
|
|
|
extern void * realloc ( void *old_ptr, size_t new_size );
|
|
|
|
extern void * malloc ( size_t size );
|
|
|
|
extern void free ( void *ptr );
|
2006-12-08 01:23:11 +00:00
|
|
|
extern int system ( const char *command );
|
2006-12-22 01:44:51 +00:00
|
|
|
extern long int random ( void );
|
2006-12-02 20:10:21 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* Note that malloc() and calloc() are identical, in the interests of
|
|
|
|
* reducing code size. Callers should not, however, rely on malloc()
|
|
|
|
* clearing memory, since this behaviour may change in future.
|
|
|
|
*/
|
|
|
|
static inline void * calloc ( size_t nmemb, size_t size ) {
|
|
|
|
return malloc ( nmemb * size );
|
|
|
|
}
|
2005-04-30 13:48:48 +00:00
|
|
|
|
|
|
|
#endif /* STDLIB_H */
|