source: src/libcfa/stdlib @ b72bad4f

ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsctordeferred_resndemanglerenumforall-pointer-decaygc_noraiijacob/cs343-translationjenkins-sandboxmemorynew-astnew-ast-unique-exprnew-envno_listpersistent-indexerpthread-emulationqualifiedEnumresolv-newwith_gc
Last change on this file since b72bad4f was b72bad4f, checked in by Peter A. Buhr <pabuhr@…>, 8 years ago

add math library to user manual, fix sepDisable bug in iostream

  • Property mode set to 100644
File size: 4.2 KB
RevLine 
[bd85400]1//
2// Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
3//
4// The contents of this file are covered under the licence agreement in the
5// file "LICENCE" distributed with Cforall.
6//
7// stdlib --
8//
9// Author           : Peter A. Buhr
10// Created On       : Thu Jan 28 17:12:35 2016
11// Last Modified By : Peter A. Buhr
[b72bad4f]12// Last Modified On : Wed Apr 27 22:03:29 2016
13// Update Count     : 96
[bd85400]14//
15
16//---------------------------------------
17
18extern "C" {
19#include <stddef.h>                                                                             // size_t
20} // extern "C"
21
[45161b4d]22//---------------------------------------
23
[3849857]24extern "C" {
[45161b4d]25#ifndef EXIT_FAILURE
26#define EXIT_FAILURE    1                                                               // failing exit status
27#define EXIT_SUCCESS    0                                                               // successful exit status
28#endif // ! EXIT_FAILURE
29void exit( int rc );
[6b6597c]30void abort( void );
[3849857]31} // extern "C"
[45161b4d]32
33//---------------------------------------
34
[6e991d6]35extern "C" { void * malloc( size_t ); }                                 // use default C routine for void *
[45161b4d]36forall( otype T ) T * malloc( void );
[4040425]37forall( otype T ) T * malloc( char fill );
38forall( otype T ) T * malloc( T * ptr, size_t size );
39forall( otype T ) T * malloc( T * ptr, size_t size, unsigned char fill );
[6e991d6]40extern "C" { void * calloc( size_t nmemb, size_t size ); } // use default C routine for void *
[45161b4d]41forall( otype T ) T * calloc( size_t nmemb );
[6e991d6]42extern "C" { void * realloc( void * ptr, size_t size ); } // use default C routine for void *
[4040425]43forall( otype T ) T * realloc( T * ptr, size_t size );
44forall( otype T ) T * realloc( T * ptr, size_t size, unsigned char fill );
[bd85400]45
[4040425]46forall( otype T ) T * aligned_alloc( size_t alignment );
[b72bad4f]47forall( otype T ) T * memalign( size_t alignment );             // deprecated
[4040425]48forall( otype T ) int posix_memalign( T ** ptr, size_t alignment );
[bd85400]49
[6b6597c]50extern "C" {
51void * memset( void * ptr, int fill, size_t size );
52void free( void * ptr );
53} // extern "C"
[0438091]54
[bd85400]55//---------------------------------------
56
57int ato( const char * ptr );
58unsigned int ato( const char * ptr );
59long int ato( const char * ptr );
60unsigned long int ato( const char * ptr );
61long long int ato( const char * ptr );
62unsigned long long int ato( const char * ptr );
63float ato( const char * ptr );
64double ato( const char * ptr );
65long double ato( const char * ptr );
66float _Complex ato( const char * ptr );
67double _Complex ato( const char * ptr );
68long double _Complex ato( const char * ptr );
69
70int strto( const char * sptr, char ** eptr, int base );
71unsigned int strto( const char * sptr, char ** eptr, int base );
72long int strto( const char * sptr, char ** eptr, int base );
73unsigned long int strto( const char * sptr, char ** eptr, int base );
74long long int strto( const char * sptr, char ** eptr, int base );
75unsigned long long int strto( const char * sptr, char ** eptr, int base );
76float strto( const char * sptr, char ** eptr );
77double strto( const char * sptr, char ** eptr );
78long double strto( const char * sptr, char ** eptr );
79float _Complex strto( const char * sptr, char ** eptr );
80double _Complex strto( const char * sptr, char ** eptr );
81long double _Complex strto( const char * sptr, char ** eptr );
82
83//---------------------------------------
84
[4040425]85forall( otype T | { int ?<?( T, T ); } )
[bd85400]86T * bsearch( const T key, const T * arr, size_t dimension );
87
[4040425]88forall( otype T | { int ?<?( T, T ); } )
[bd85400]89void qsort( const T * arr, size_t dimension );
90
91//---------------------------------------
92
[4040425]93forall( otype T | { T ?/?( T, T ); T ?%?( T, T ); } )
[bd85400]94[ T, T ] div( T t1, T t2 );
95
96//---------------------------------------
97
98char abs( char );
[6e991d6]99extern "C" { int abs( int ); }                                                  // use default C routine for int
[bd85400]100long int abs( long int );
101long long int abs( long long int );
102float abs( float );
103double abs( double );
104long double abs( long double );
[6e991d6]105float abs( float _Complex );
106double abs( double _Complex );
107long double abs( long double _Complex );
[53ba273]108
109//---------------------------------------
110
[0438091]111void rand48seed( long int s );
112char rand48();
113int rand48();
114unsigned int rand48();
115long int rand48();
116unsigned long int rand48();
117float rand48();
118double rand48();
119float _Complex rand48();
120double _Complex rand48();
121long double _Complex rand48();
[bd85400]122
123//---------------------------------------
124
[4040425]125forall( otype T | { int ?<?( T, T ); } )
[bd85400]126T min( const T t1, const T t2 );
127
[4040425]128forall( otype T | { int ?>?( T, T ); } )
[bd85400]129T max( const T t1, const T t2 );
130
[4040425]131forall( otype T )
[bd85400]132void swap( T * t1, T * t2 );
133
134// Local Variables: //
135// mode: c //
136// tab-width: 4 //
137// End: //
Note: See TracBrowser for help on using the repository browser.