[35aab3] | 1 | #ifndef STRUCTS_H |
---|
| 2 | #define STRUCTS_H |
---|
| 3 | /**************************************** |
---|
| 4 | * Computer Algebra System SINGULAR * |
---|
| 5 | ****************************************/ |
---|
[341696] | 6 | /* $Id$ */ |
---|
[35aab3] | 7 | /* |
---|
| 8 | * ABSTRACT |
---|
| 9 | */ |
---|
| 10 | |
---|
[be6689f] | 11 | /* for memset: */ |
---|
| 12 | #include <string.h> |
---|
[c5e0e1] | 13 | /* for omBin */ |
---|
[b1dfaf] | 14 | #include <omalloc/omalloc.h> |
---|
[c81a40] | 15 | #ifdef HAVE_RINGS |
---|
[599326] | 16 | #include <kernel/si_gmp.h> |
---|
[c81a40] | 17 | #endif |
---|
[35aab3] | 18 | |
---|
[994445] | 19 | |
---|
[35aab3] | 20 | /* standard types */ |
---|
[c81a40] | 21 | #ifdef HAVE_RINGS |
---|
[be6689f] | 22 | typedef unsigned long NATNUMBER; |
---|
[a604c3] | 23 | typedef mpz_ptr int_number; |
---|
[c81a40] | 24 | #endif |
---|
[de7394] | 25 | #if (SIZEOF_LONG == 8) |
---|
| 26 | typedef int BOOLEAN; |
---|
| 27 | /* testet on x86_64, gcc 3.4.6: 2 % */ |
---|
| 28 | /* testet on IA64, gcc 3.4.6: 1 % */ |
---|
| 29 | #else |
---|
| 30 | /* testet on athlon, gcc 2.95.4: 1 % */ |
---|
[35aab3] | 31 | typedef short BOOLEAN; |
---|
[de7394] | 32 | #endif |
---|
[35aab3] | 33 | |
---|
[5be7db] | 34 | typedef void * ADDRESS; |
---|
[35aab3] | 35 | #define BITSET unsigned int |
---|
| 36 | |
---|
[fc5095] | 37 | #if SIZEOF_LONG == 4 |
---|
| 38 | typedef long long int64; |
---|
| 39 | #elif SIZEOF_LONG == 8 |
---|
| 40 | typedef long int64; |
---|
| 41 | #else |
---|
[5a9e7b] | 42 | #error int64 undefined |
---|
[fc5095] | 43 | #endif |
---|
| 44 | |
---|
| 45 | |
---|
[35aab3] | 46 | /* C++-part */ |
---|
| 47 | #ifdef __cplusplus |
---|
| 48 | class sleftv; |
---|
| 49 | class slists; |
---|
| 50 | class sattr; |
---|
| 51 | class skStrategy; |
---|
| 52 | class ssyStrategy; |
---|
| 53 | class procinfo; |
---|
[6bde67] | 54 | class CPolynomialSummator; |
---|
[1495df4] | 55 | class CGlobalMultiplier; |
---|
[a7fbdd] | 56 | class CFormulaPowerMultiplier; |
---|
[35aab3] | 57 | #endif |
---|
| 58 | |
---|
| 59 | struct sip_package; |
---|
[49abe32] | 60 | typedef struct sip_package ip_package; |
---|
| 61 | typedef ip_package * package; |
---|
[35aab3] | 62 | |
---|
[b07ba77] | 63 | |
---|
[35aab3] | 64 | typedef struct n_Procs_s n_Procs_s; |
---|
| 65 | |
---|
[5a9e7b] | 66 | // #ifdef HAVE_PLURAL |
---|
[35aab3] | 67 | struct nc_struct; |
---|
| 68 | typedef struct nc_struct nc_struct; |
---|
[5a9e7b] | 69 | // #endif |
---|
[35aab3] | 70 | |
---|
| 71 | typedef struct sip_link ip_link; |
---|
| 72 | |
---|
| 73 | /* the pointer types */ |
---|
| 74 | typedef char * char_ptr; |
---|
| 75 | typedef int * int_ptr; |
---|
| 76 | |
---|
| 77 | #ifdef __cplusplus |
---|
| 78 | typedef ip_link * si_link; |
---|
| 79 | typedef sleftv * leftv; |
---|
| 80 | typedef slists * lists; |
---|
| 81 | typedef sattr * attr; |
---|
| 82 | typedef skStrategy * kStrategy; |
---|
| 83 | typedef ssyStrategy * syStrategy; |
---|
| 84 | typedef procinfo * procinfov; |
---|
| 85 | |
---|
| 86 | /* the function pointer types */ |
---|
| 87 | |
---|
[5be7db] | 88 | class idrec; |
---|
| 89 | typedef idrec * idhdl; |
---|
| 90 | |
---|
[35aab3] | 91 | #endif /* __cplusplus */ |
---|
| 92 | |
---|
| 93 | |
---|
| 94 | |
---|
| 95 | /* |
---|
| 96 | ** 7. runtime procedures/global data |
---|
| 97 | */ |
---|
| 98 | |
---|
| 99 | /* 7.1 C-routines : */ |
---|
| 100 | |
---|
| 101 | |
---|
| 102 | #ifdef __cplusplus |
---|
| 103 | extern "C" { |
---|
| 104 | #endif |
---|
[fb0d9a] | 105 | void m2_end(int i) __attribute__((noreturn)); |
---|
[35aab3] | 106 | #ifdef __cplusplus |
---|
| 107 | } |
---|
| 108 | #endif |
---|
| 109 | |
---|
| 110 | /* 7.2 C++-routines : */ |
---|
| 111 | |
---|
| 112 | #ifdef __cplusplus |
---|
| 113 | int inits(void); |
---|
| 114 | int IsPrime(int i); |
---|
| 115 | extern int siSeed; |
---|
| 116 | int siRand(); |
---|
| 117 | #endif |
---|
| 118 | |
---|
| 119 | #define loop for(;;) |
---|
| 120 | |
---|
| 121 | #ifndef ABS |
---|
| 122 | #define ABS(x) ((x)<0?(-(x)):(x)) |
---|
| 123 | #endif |
---|
| 124 | |
---|
[c5e0e1] | 125 | extern omBin char_ptr_bin; |
---|
| 126 | extern omBin sleftv_bin; |
---|
[35aab3] | 127 | |
---|
| 128 | #endif |
---|
| 129 | |
---|