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