00001
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef miscH
00028 #define miscH
00029
00030 #include "global.h"
00031 #include <string>
00032
00033 #define dblue lightgray
00034
00035
00036 #ifdef UseMemAvail
00037 extern int memavail ( void );
00038 #endif
00039
00040
00041 extern int firstBit(int i);
00042
00043
00045 inline int log2(int i) { return firstBit(i);};
00046
00050 extern char* strr ( int a ) ;
00051
00052 extern const char* digit[] ;
00053 extern const char* letter[] ;
00054
00058 extern char* strrr ( int a ) ;
00059
00060
00064 extern char* strrr ( double a ) ;
00065
00066 extern void beep( void );
00067
00068 extern int crc32buf( const void *vbuf, int len);
00069
00070 extern int atoi ( const std::string& s );
00071 extern double atof ( const std::string& s );
00072
00073 #ifdef min
00074 #undef min
00075 #endif
00076
00077 #ifdef max
00078 #undef max
00079 #endif
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092 template<typename T>
00093 const T& min ( const T& a, const T& b, const T& c )
00094 {
00095 return min ( a, min ( b, c ));
00096 }
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109 template<typename T>
00110 const T& max ( const T& a, const T& b, const T& c )
00111 {
00112 return max ( a, max ( b, c ));
00113 }
00114
00115
00116 extern char *strupr (const char *a);
00117
00118 #ifndef HAVE_ITOA
00119 extern char* itoa ( int a, char* b, int c);
00120 #endif
00121
00122 #if defined(MEMCHK) | defined(sgmain) | defined(karteneditor)
00123 extern void* asc_malloc ( size_t size );
00124 extern void asc_free ( void* p );
00125 #else
00126 #ifdef asc_malloc
00127 #undef asc_malloc
00128 #endif
00129 #define asc_malloc malloc
00130
00131 #ifdef asc_free
00132 #undef asc_free
00133 #endif
00134 #define asc_free free
00135 #endif
00136
00137 #endif