The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/include/stdlib.h

Version: -  FREEBSD  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-2  -  FREEBSD-11-1  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-4  -  FREEBSD-10-3  -  FREEBSD-10-2  -  FREEBSD-10-1  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-3  -  FREEBSD-9-2  -  FREEBSD-9-1  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-4  -  FREEBSD-8-3  -  FREEBSD-8-2  -  FREEBSD-8-1  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-4  -  FREEBSD-7-3  -  FREEBSD-7-2  -  FREEBSD-7-1  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-4  -  FREEBSD-6-3  -  FREEBSD-6-2  -  FREEBSD-6-1  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-5  -  FREEBSD-5-4  -  FREEBSD-5-3  -  FREEBSD-5-2  -  FREEBSD-5-1  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  linux-2.6  -  linux-2.4.22  -  MK83  -  MK84  -  PLAN9  -  DFBSD  -  NETBSD  -  NETBSD5  -  NETBSD4  -  NETBSD3  -  NETBSD20  -  OPENBSD  -  xnu-517  -  xnu-792  -  xnu-792.6.70  -  xnu-1228  -  xnu-1456.1.26  -  xnu-1699.24.8  -  xnu-2050.18.24  -  OPENSOLARIS  -  minix-3-1-1 
SearchContext: -  none  -  3  -  10 

    1 /* The <stdlib.h> header defines certain common macros, types, and functions.*/
    2 
    3 #ifndef _STDLIB_H
    4 #define _STDLIB_H
    5 
    6 #ifndef _ANSI_H
    7 #include <ansi.h>
    8 #endif
    9 
   10 /* The macros are NULL, EXIT_FAILURE, EXIT_SUCCESS, RAND_MAX, and MB_CUR_MAX.*/
   11 #define NULL    ((void *)0)
   12 
   13 #define EXIT_FAILURE       1    /* standard error return using exit() */
   14 #define EXIT_SUCCESS       0    /* successful return using exit() */
   15 #define RAND_MAX       32767    /* largest value generated by rand() */
   16 #define MB_CUR_MAX         1    /* max value of multibyte character in MINIX */
   17 
   18 typedef struct { int quot, rem; } div_t;
   19 typedef struct { long quot, rem; } ldiv_t;
   20 
   21 /* The types are size_t, wchar_t, div_t, and ldiv_t. */
   22 #ifndef _SIZE_T
   23 #define _SIZE_T
   24 typedef unsigned int size_t;    /* type returned by sizeof */
   25 #endif
   26 
   27 #ifndef _WCHAR_T
   28 #define _WCHAR_T
   29 typedef char wchar_t;           /* type expanded character set */
   30 #endif
   31 
   32 /* Function Prototypes. */
   33 _PROTOTYPE( void abort, (void)                                          );
   34 _PROTOTYPE( int abs, (int _j)                                           );
   35 _PROTOTYPE( int atexit, (void (*_func)(void))                           );
   36 _PROTOTYPE( double atof, (const char *_nptr)                            );
   37 _PROTOTYPE( int atoi, (const char *_nptr)                               );
   38 _PROTOTYPE( long atol, (const char *_nptr)                              );
   39 _PROTOTYPE( void *calloc, (size_t _nmemb, size_t _size)                 );
   40 _PROTOTYPE( div_t div, (int _numer, int _denom)                         );
   41 _PROTOTYPE( void exit, (int _status)                                    );
   42 _PROTOTYPE( void free, (void *_ptr)                                     );
   43 _PROTOTYPE( char *getenv, (const char *_name)                           );
   44 _PROTOTYPE( long labs, (long _j)                                        );
   45 _PROTOTYPE( ldiv_t ldiv, (long _numer, long _denom)                     );
   46 _PROTOTYPE( void *malloc, (size_t _size)                                );
   47 _PROTOTYPE( int mblen, (const char *_s, size_t _n)                      );
   48 _PROTOTYPE( size_t mbstowcs, (wchar_t *_pwcs, const char *_s, size_t _n));
   49 _PROTOTYPE( int mbtowc, (wchar_t *_pwc, const char *_s, size_t _n)      );
   50 _PROTOTYPE( int rand, (void)                                            );
   51 _PROTOTYPE( void *realloc, (void *_ptr, size_t _size)                   );
   52 _PROTOTYPE( void srand, (unsigned int _seed)                            );
   53 _PROTOTYPE( double strtod, (const char *_nptr, char **_endptr)          );
   54 _PROTOTYPE( long strtol, (const char *_nptr, char **_endptr, int _base) );
   55 _PROTOTYPE( int system, (const char *_string)                           );
   56 _PROTOTYPE( size_t wcstombs, (char *_s, const wchar_t *_pwcs, size_t _n));
   57 _PROTOTYPE( int wctomb, (char *_s, wchar_t _wchar)                      );
   58 _PROTOTYPE( void *bsearch, (const void *_key, const void *_base, 
   59         size_t _nmemb, size_t _size, 
   60         int (*compar) (const void *, const void *))                     );
   61 _PROTOTYPE( void qsort, (void *_base, size_t _nmemb, size_t _size,
   62         int (*compar) (const void *, const void *))                     );
   63 _PROTOTYPE( unsigned long int strtoul,
   64                         (const char *_nptr, char **_endptr, int _base)  );
   65 
   66 #ifdef _POSIX_SOURCE
   67 /* Open Group Base Specifications Issue 6 */
   68 _PROTOTYPE( int mkstemp, (char *_fmt)                                   );
   69 _PROTOTYPE( char *initstate, (unsigned _seed, char *_state,
   70                                                         size_t _size)   );
   71 _PROTOTYPE( long random, (void)                                         );
   72 _PROTOTYPE( char *setstate, (const char *state)                         );
   73 _PROTOTYPE( void srandom, (unsigned seed)                               );
   74 #endif
   75 
   76 #ifdef _MINIX
   77 _PROTOTYPE( int putenv, (const char *_name)                             );
   78 
   79 /* According to POSIX, getopt should be in unistd.h. What do we do with
   80  * this?
   81  */
   82 _PROTOTYPE(int getopt, (int _argc, char **_argv, char *_opts));
   83 extern char *optarg;
   84 extern int optind, opterr, optopt;
   85 #endif /* _MINIX */
   86 
   87 #endif /* STDLIB_H */

Cache object: 60d970be7d43d5624c85fa6526175e26


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.