source: src/libcfa/stdlib @ 4040425

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

change keyword type to otype and context to trait

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