00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef ILL_UTIL_H
00025 #define ILL_UTIL_H
00026
00027 #include "machdefs.h"
00028 #include "config.h"
00029
00030 #ifdef _USRDLL
00031
00032 #ifdef QSLIB_EXPORTS
00033 #define QSLIB_INTERFACE __declspec(dllexport)
00034 #else
00035 #define QSLIB_INTERFACE __declspec(dllimport)
00036 #endif
00037
00038 #else
00039
00040 #define QSLIB_INTERFACE extern
00041
00042 #endif
00043
00044 #ifdef WIN32
00045 #define strcasecmp(s1, s2) stricmp(s1, s2)
00046 #define strncasecmp(s1, s2, n) strnicmp(s1, s2, n)
00047 #endif
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077 typedef char ILLbool;
00078
00079 #define FALSE 0
00080 #define TRUE 1
00081
00082 #define ILL_SWAP(a,b,t) (((t)=(a)),((a)=(b)),((b)=(t)))
00083 #define EGLPNUM_SWAP(a,b,t) ((EGlpNumCopy(t,a)),(EGlpNumCopy(a,b)),(EGlpNumCopy(b,t)))
00084
00085 #define ILL_OURABS(a) (((a) >= 0) ? (a) : -(a))
00086
00087 #include "sortrus_common.h"
00088 #include "allocrus.h"
00089 #include "urandom.h"
00090 #include "zeit.h"
00091
00092
00093
00094
00095
00096 #define ILL_UTIL_STR(new, str) \
00097 { new = ILLutil_str(str); \
00098 if (str != NULL) { ILL_CHECKnull(new, "out of memeory"); } }
00099
00100 extern char *ILLutil_str (
00101 const char *str);
00102
00103
00104
00105 extern int ILLutil_array_index (
00106 char *list[],
00107 int n,
00108 const char *name);
00109
00110
00111
00112 extern int ILLutil_index (
00113 const char *list[],
00114 const char *name);
00115
00116
00117
00118 extern unsigned int ILLutil_nextprime (
00119 unsigned int x);
00120
00121 extern const char *ILLutil_strchr (
00122 const char *s,
00123 int c);
00124
00125 extern int ILLutil_strcasecmp (
00126 const char *s1,
00127 const char *s2);
00128 extern int ILLutil_strncasecmp (
00129 const char *s1,
00130 const char *s2,
00131 size_t n);
00132
00133
00134 extern int ILLutil_our_gcd (
00135 int a,
00136 int b),
00137 ILLutil_our_lcm (
00138 int a,
00139 int b),
00140 ILLutil_our_log2 (
00141 int a);
00142
00143 double ILLutil_our_floor (
00144 double x),
00145 ILLutil_our_ceil (
00146 double x),
00147 ILLutil_our_frac (
00148 double x),
00149 ILLutil_norm_sqr (
00150 double *v,
00151 int len);
00152
00153 #include "bgetopt.h"
00154
00155
00156 #endif