Convert-Binary-C
view release on metacpan or search on metacpan
tests/include/pdclib/include/stdlib.h view on Meta::CPAN
/* If string is a NULL pointer, system() returns nonzero if a command processor
is available, and zero otherwise. If string is not a NULL pointer, it is
passed to the command processor. If system() returns, it does so with a
value that is determined by the hosting OS and its glue function.
*/
_PDCLIB_PUBLIC int system( const char * string );
/* Searching and sorting */
/* Do a binary search for a given key in the array with a given base pointer,
which consists of nmemb elements that are of the given size each. To compare
the given key with an element from the array, the given function compar is
called (with key as first parameter and a pointer to the array member as
second parameter); the function should return a value less than, equal to,
or greater than 0 if the key is considered to be less than, equal to, or
greater than the array element, respectively.
The function returns a pointer to a matching element found, or NULL if no
match is found.
*/
_PDCLIB_PUBLIC void * bsearch( const void * key, const void * base, size_t nmemb, size_t size, int ( *compar )( const void *, const void * ) );
/* Do a quicksort on an array with a given base pointer, which consists of
nmemb elements that are of the given size each. To compare two elements from
the array, the given function compar is called, which should return a value
less than, equal to, or greater than 0 if the first argument is considered
to be less than, equal to, or greater than the second argument, respectively.
If two elements are compared equal, their order in the sorted array is not
specified.
*/
_PDCLIB_PUBLIC void qsort( void * base, size_t nmemb, size_t size, int ( *compar )( const void *, const void * ) );
/* Integer arithmetic functions */
/* Return the absolute value of the argument. Note that on machines using two-
complement's notation (most modern CPUs), the largest negative value cannot
be represented as positive value. In this case, behaviour is unspecified.
*/
_PDCLIB_PUBLIC int abs( int j );
_PDCLIB_PUBLIC long int labs( long int j );
_PDCLIB_PUBLIC long long int llabs( long long int j );
/* These structures each have a member quot and a member rem, of type int (for
div_t), long int (for ldiv_t) and long long it (for lldiv_t) respectively.
The order of the members is platform-defined to allow the div() functions
below to be implemented efficiently.
*/
typedef struct _PDCLIB_div_t div_t;
typedef struct _PDCLIB_ldiv_t ldiv_t;
typedef struct _PDCLIB_lldiv_t lldiv_t;
/* Return quotient (quot) and remainder (rem) of an integer division in one of
the structs above.
*/
_PDCLIB_PUBLIC div_t div( int numer, int denom );
_PDCLIB_PUBLIC ldiv_t ldiv( long int numer, long int denom );
_PDCLIB_PUBLIC lldiv_t lldiv( long long int numer, long long int denom );
/* TODO: Multibyte / wide character conversion functions */
/* TODO: Macro MB_CUR_MAX */
/*
_PDCLIB_PUBLIC int mblen( const char * s, size_t n );
_PDCLIB_PUBLIC int mbtowc( wchar_t * _PDCLIB_restrict pwc, const char * _PDCLIB_restrict s, size_t n );
_PDCLIB_PUBLIC int wctomb( char * s, wchar_t wc );
_PDCLIB_PUBLIC size_t mbstowcs( wchar_t * _PDCLIB_restrict pwcs, const char * _PDCLIB_restrict s, size_t n );
_PDCLIB_PUBLIC size_t wcstombs( char * _PDCLIB_restrict s, const wchar_t * _PDCLIB_restrict pwcs, size_t n );
*/
/* Annex K -- Bounds-checking interfaces */
#if ( __STDC_WANT_LIB_EXT1__ + 0 ) != 0
#ifndef _PDCLIB_ERRNO_T_DEFINED
#define _PDCLIB_ERRNO_T_DEFINED _PDCLIB_ERRNO_T_DEFINED
typedef int errno_t;
#endif
#ifndef _PDCLIB_RSIZE_T_DEFINED
#define _PDCLIB_RSIZE_T_DEFINED _PDCLIB_RSIZE_T_DEFINED
typedef size_t rsize_t;
#endif
/* A function type that can serve as a constraint handler (see below). The
first parameter is an error message on the constraint violation, the
second parameter a pointer to an implementation-defined object, the
third an error code related to the constraint violation.
If the function calling the constraint handler is defined to return
errno_t, the third parameter will be identical to the return value of
that function.
This implementation sets the second parameter of the constraint handler
call to NULL.
*/
typedef void ( *constraint_handler_t )( const char * _PDCLIB_restrict msg, void * _PDCLIB_restrict ptr, errno_t error );
/* The currently active constraint violation handler. This implementation
sets abort_handler_s as the default constraint violation handler.
*/
extern constraint_handler_t _PDCLIB_constraint_handler;
/* Set the given function as the new constraint violation handler. */
_PDCLIB_PUBLIC constraint_handler_t set_constraint_handler_s( constraint_handler_t handler );
/* One of two predefined constraint violation handlers. When called, it will
print an error message (including the message passed as the first
parameter to the handler function) and call abort().
*/
_PDCLIB_PUBLIC void abort_handler_s( const char * _PDCLIB_restrict msg, void * _PDCLIB_restrict ptr, errno_t error );
/* One of two predefined constraint violation handlers. Simply returns,
ignoring the constraint violation.
*/
_PDCLIB_PUBLIC void ignore_handler_s( const char * _PDCLIB_restrict msg, void * _PDCLIB_restrict ptr, errno_t error );
/* Search an environment-provided key-value map for the given key name.
If the name is found,
- if len is not NULL, the length of the associated value string is stored
in that location.
- if len < maxsize, the value string is copied to the indicated location.
If the name is not found,
( run in 0.493 second using v1.01-cache-2.11-cpan-39bf76dae61 )