X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=includes%2Fstdlib.h;h=15f07b026c2d4da7a723249f22803135e2a2f234;hb=b41576197133c1211d6ec353faf93f505f573b8a;hp=1bf1fc26872df4cbec70405f5aac9e3e95b8dc9a;hpb=d02f38605b53cdff5460cc6b9e1b2a80c3a2ba4c;p=pdclib diff --git a/includes/stdlib.h b/includes/stdlib.h index 1bf1fc2..15f07b0 100644 --- a/includes/stdlib.h +++ b/includes/stdlib.h @@ -1,8 +1,6 @@ /* $Id$ */ -/* Release $Name$ */ - -/* General utilities +/* 7.20 General utilities This file is part of the Public Domain C Library (PDCLib). Permission is granted to use, modify, and / or redistribute at will. @@ -10,11 +8,8 @@ #ifndef _PDCLIB_STDLIB_H #define _PDCLIB_STDLIB_H _PDCLIB_STDLIB_H - -#ifndef _PDCLIB_INT_H -#define _PDCLIB_INT_H _PDCLIB_INT_H #include <_PDCLIB_int.h> -#endif +_PDCLIB_BEGIN_EXTERN_C #ifndef _PDCLIB_SIZE_T_DEFINED #define _PDCLIB_SIZE_T_DEFINED _PDCLIB_SIZE_T_DEFINED @@ -54,6 +49,9 @@ long double strtold( const char * _PDCLIB_restrict nptr, char * * _PDCLIB_restri LLONG_MIN, LLONG_MAX, or ULLONG_MAX respectively, depending on the sign of the integer representation and the return type, and errno is set to ERANGE. */ +/* There is strtoimax() and strtoumax() in operating on intmax_t / + uintmax_t, if the long long versions do not suit your needs. +*/ long int strtol( const char * _PDCLIB_restrict nptr, char * * _PDCLIB_restrict endptr, int base ); long long int strtoll( const char * _PDCLIB_restrict nptr, char * * _PDCLIB_restrict endptr, int base ); unsigned long int strtoul( const char * _PDCLIB_restrict nptr, char * * _PDCLIB_restrict endptr, int base ); @@ -140,11 +138,11 @@ void * realloc( void * ptr, size_t size ); temporary files before exiting with EXIT_FAILURE. abort() does not return. */ -void abort( void ); +_PDCLIB_noreturn void abort( void ); -/* Register a function that will be called on exit(), _Exit(), or when main() - returns. At least 32 functions can be registered this way, and will be - called in reverse order of registration (last-in, first-out). +/* Register a function that will be called on exit(), or when main() returns. + At least 32 functions can be registered this way, and will be called in + reverse order of registration (last-in, first-out). Returns zero if registration is successfull, nonzero if it failed. */ int atexit( void (*func)( void ) ); @@ -155,7 +153,7 @@ int atexit( void (*func)( void ) ); and EXIT_FAILURE above.) exit() does not return. */ -void exit( int status ); +_PDCLIB_noreturn void exit( int status ); /* Normal process termination. Functions registered by atexit() (see above) are NOT CALLED. This implementation DOES flush streams, close files and removes @@ -163,7 +161,7 @@ void exit( int status ); comment for EXIT_SUCCESS and EXIT_FAILURE above.) _Exit() does not return. */ -void _Exit( int status ); +_PDCLIB_noreturn void _Exit( int status ); /* Search an environment-provided key-value map for the given key name, and return a pointer to the associated value string (or NULL if key name cannot @@ -243,4 +241,5 @@ size_t mbstowcs( wchar_t * _PDCLIB_restrict pwcs, const char * _PDCLIB_restrict size_t wcstombs( char * _PDCLIB_restrict s, const wchar_t * _PDCLIB_restrict pwcs, size_t n ); */ +_PDCLIB_END_EXTERN_C #endif