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
|
---|
12 | // Last Modified On : Fri Apr 1 22:26:14 2016
|
---|
13 | // Update Count : 73
|
---|
14 | //
|
---|
15 |
|
---|
16 | //---------------------------------------
|
---|
17 |
|
---|
18 | extern "C" {
|
---|
19 | #include <stddef.h> // size_t
|
---|
20 | #include <math.h> // floor
|
---|
21 | } // extern "C"
|
---|
22 |
|
---|
23 | forall( otype T ) T * malloc( void );
|
---|
24 | forall( otype T ) T * malloc( char fill );
|
---|
25 | forall( otype T ) T * malloc( T * ptr, size_t size );
|
---|
26 | forall( otype T ) T * malloc( T * ptr, size_t size, unsigned char fill );
|
---|
27 | forall( otype T ) T * calloc( size_t size );
|
---|
28 | forall( otype T ) T * realloc( T * ptr, size_t size );
|
---|
29 | forall( otype T ) T * realloc( T * ptr, size_t size, unsigned char fill );
|
---|
30 |
|
---|
31 | forall( otype T ) T * aligned_alloc( size_t alignment );
|
---|
32 | forall( otype T ) T * memalign( size_t alignment ); // deprecated
|
---|
33 | forall( otype T ) int posix_memalign( T ** ptr, size_t alignment );
|
---|
34 |
|
---|
35 | forall( otype T ) T * memset( T * ptr, unsigned char fill ); // use default value '\0' for fill
|
---|
36 | forall( otype T ) T * memset( T * ptr ); // remove when default value available
|
---|
37 |
|
---|
38 | //---------------------------------------
|
---|
39 |
|
---|
40 | int ato( const char * ptr );
|
---|
41 | unsigned int ato( const char * ptr );
|
---|
42 | long int ato( const char * ptr );
|
---|
43 | unsigned long int ato( const char * ptr );
|
---|
44 | long long int ato( const char * ptr );
|
---|
45 | unsigned long long int ato( const char * ptr );
|
---|
46 | float ato( const char * ptr );
|
---|
47 | double ato( const char * ptr );
|
---|
48 | long double ato( const char * ptr );
|
---|
49 | float _Complex ato( const char * ptr );
|
---|
50 | double _Complex ato( const char * ptr );
|
---|
51 | long double _Complex ato( const char * ptr );
|
---|
52 |
|
---|
53 | int strto( const char * sptr, char ** eptr, int base );
|
---|
54 | unsigned int strto( const char * sptr, char ** eptr, int base );
|
---|
55 | long int strto( const char * sptr, char ** eptr, int base );
|
---|
56 | unsigned long int strto( const char * sptr, char ** eptr, int base );
|
---|
57 | long long int strto( const char * sptr, char ** eptr, int base );
|
---|
58 | unsigned long long int strto( const char * sptr, char ** eptr, int base );
|
---|
59 | float strto( const char * sptr, char ** eptr );
|
---|
60 | double strto( const char * sptr, char ** eptr );
|
---|
61 | long double strto( const char * sptr, char ** eptr );
|
---|
62 | float _Complex strto( const char * sptr, char ** eptr );
|
---|
63 | double _Complex strto( const char * sptr, char ** eptr );
|
---|
64 | long double _Complex strto( const char * sptr, char ** eptr );
|
---|
65 |
|
---|
66 | //---------------------------------------
|
---|
67 |
|
---|
68 | forall( otype T | { int ?<?( T, T ); } )
|
---|
69 | T * bsearch( const T key, const T * arr, size_t dimension );
|
---|
70 |
|
---|
71 | forall( otype T | { int ?<?( T, T ); } )
|
---|
72 | void qsort( const T * arr, size_t dimension );
|
---|
73 |
|
---|
74 | //---------------------------------------
|
---|
75 |
|
---|
76 | forall( otype T | { T ?/?( T, T ); T ?%?( T, T ); } )
|
---|
77 | [ T, T ] div( T t1, T t2 );
|
---|
78 |
|
---|
79 | //---------------------------------------
|
---|
80 |
|
---|
81 | char abs( char );
|
---|
82 | extern "C" {
|
---|
83 | int abs( int ); // use default C routine for int
|
---|
84 | } // extern "C"
|
---|
85 | long int abs( long int );
|
---|
86 | long long int abs( long long int );
|
---|
87 | float abs( float );
|
---|
88 | double abs( double );
|
---|
89 | long double abs( long double );
|
---|
90 | float _Complex abs( float _Complex );
|
---|
91 | double _Complex abs( double _Complex );
|
---|
92 | long double _Complex abs( long double _Complex );
|
---|
93 |
|
---|
94 | //---------------------------------------
|
---|
95 |
|
---|
96 | float floor( float );
|
---|
97 | extern "C" {
|
---|
98 | double floor( double ); // use C routine for double
|
---|
99 | } // extern "C"
|
---|
100 | long double floor( long double );
|
---|
101 |
|
---|
102 | float ceil( float );
|
---|
103 | extern "C" {
|
---|
104 | double ceil( double ); // use C routine for double
|
---|
105 | } // extern "C"
|
---|
106 | long double ceil( long double );
|
---|
107 |
|
---|
108 | //---------------------------------------
|
---|
109 |
|
---|
110 | void rand48seed( long int s );
|
---|
111 | char rand48();
|
---|
112 | int rand48();
|
---|
113 | unsigned int rand48();
|
---|
114 | long int rand48();
|
---|
115 | unsigned long int rand48();
|
---|
116 | float rand48();
|
---|
117 | double rand48();
|
---|
118 | float _Complex rand48();
|
---|
119 | double _Complex rand48();
|
---|
120 | long double _Complex rand48();
|
---|
121 |
|
---|
122 | //---------------------------------------
|
---|
123 |
|
---|
124 | forall( otype T | { int ?<?( T, T ); } )
|
---|
125 | T min( const T t1, const T t2 );
|
---|
126 |
|
---|
127 | forall( otype T | { int ?>?( T, T ); } )
|
---|
128 | T max( const T t1, const T t2 );
|
---|
129 |
|
---|
130 | forall( otype T )
|
---|
131 | void swap( T * t1, T * t2 );
|
---|
132 |
|
---|
133 | // Local Variables: //
|
---|
134 | // mode: c //
|
---|
135 | // tab-width: 4 //
|
---|
136 | // End: //
|
---|