HPGCC3 Documentation 3.0 R003
|
00001 //& *** (c) 2006-2011 The HPGCC3 Team *** 00002 //& Claudio Lapilli 00003 //& Ingo Blank 00004 //& 00005 //& This file is licensed under the terms and conditions of the 00006 //& HPGCC3 license that is included with the source distribution. 00007 //& *** (c) 2006-2011 The HPGCC3 Team *** 00008 00009 00014 #ifndef _HPSTDLIB_H 00015 #define _HPSTDLIB_H 00016 00017 00018 // LONG TYPE DEFINITION, ADDED BY CLAUDIO 01/14/05 00019 #ifndef _LONGLONG_DEF 00020 typedef unsigned long long ULONGLONG; 00021 typedef long long LONGLONG; 00022 #define _LONGLONG_DEF 00023 #endif 00024 00025 00026 00027 #include <sys.h> 00028 00029 // TODO: Doxygen (ibl) 00030 // abstract PRNG descriptor 00031 typedef unsigned (*RNDFUNC)(int); 00032 typedef void (*SRNDFUNC)(unsigned); 00033 00034 // dispatch pointer 00035 extern RNDFUNC rand_hook; 00036 extern SRNDFUNC srand_hook; 00037 00041 #define INVALID_PTR 0 00042 00045 #define BLOCK_USED 1 00046 00049 #define BLOCK_FREE -1 00050 00051 00052 00056 void *malloc(size_t); 00057 00058 00062 void free(void *); 00063 00064 00065 00068 int freemem(); 00069 00073 void *calloc(size_t, size_t); 00074 00079 void * realloc(void *oldp, size_t size); 00080 00104 int getheapblockinfo(void *ptr, void **blkstart,size_t *blksize); 00105 00106 // runtime 00107 00111 void exit(int); 00112 00113 00117 int atexit(void(*__func)(void)); 00118 00119 00120 00121 // misc 00122 00131 unsigned mwc(int bits); // multiply with carry 32 bit pseudo RNG 00132 00133 00134 // misc 00135 00145 #define RAND_MAX 0x7FFFFFFF 00146 00147 int rand(void); 00148 unsigned int rand_bits(int bits); 00149 00150 00151 // misc 00152 00162 void srand(unsigned int seed); // multiply with carry 32 bit pseudo RNG 00163 00164 00165 int memcmp(const void *s1, const void *s2, size_t n); //Memory Compare 00166 //Al Nov '04 - TODO: Documentation? 00167 00173 void 00174 qsort(void *base, size_t n_elements, size_t width,int (*compar)(const void *, const void *)); 00175 00184 void * 00185 bsearch(register const void *key, register const void *base, 00186 register size_t n_elements, register size_t size, 00187 int (*compar)(const void *, const void *)); 00188 00189 00190 #endif