1 | #ifndef IPSHELL_H |
---|
2 | #define IPSHELL_H |
---|
3 | /**************************************** |
---|
4 | * Computer Algebra System SINGULAR * |
---|
5 | ****************************************/ |
---|
6 | /* $Id: ipshell.h,v 1.18 1999-07-09 14:58:28 Singular Exp $ */ |
---|
7 | /* |
---|
8 | * ABSTRACT |
---|
9 | */ |
---|
10 | #include <stdio.h> |
---|
11 | #include "structs.h" |
---|
12 | #include "subexpr.h" |
---|
13 | |
---|
14 | extern int traceit ; |
---|
15 | #define TRACE_SHOW_PROC 1 |
---|
16 | #define TRACE_SHOW_LINENO 2 |
---|
17 | #define TRACE_SHOW_LINE 4 |
---|
18 | #define TRACE_SHOW_RINGS 8 |
---|
19 | #define TRACE_SHOW_LINE1 16 |
---|
20 | #define TRACE_BREAKPOINT 32 |
---|
21 | #define TRACE_TMP_BREAKPOINT 64 |
---|
22 | extern leftv iiCurrArgs; |
---|
23 | extern int iiOp; /* the current operation*/ |
---|
24 | extern int myynest; |
---|
25 | extern char * currid; |
---|
26 | extern char * thisfile; |
---|
27 | extern int iiRETURNEXPR_len; |
---|
28 | extern sleftv *iiRETURNEXPR; |
---|
29 | #ifdef USE_IILOCALRING |
---|
30 | extern ring *iiLocalRing; |
---|
31 | #endif |
---|
32 | extern cmdnames cmds[]; |
---|
33 | extern char *lastreserved; |
---|
34 | extern BOOLEAN yyInRingConstruction; /* 1: during ring construction */ |
---|
35 | |
---|
36 | int IsCmd(char *n, int & tok); |
---|
37 | BOOLEAN iiPStart(idhdl pn, sleftv * sl); |
---|
38 | BOOLEAN iiEStart(char* example, procinfo *pi); |
---|
39 | void type_cmd(idhdl h); |
---|
40 | void test_cmd(int i); |
---|
41 | void list_cmd(int typ, const char* what, char * prefix, BOOLEAN iterate, |
---|
42 | BOOLEAN fullname=FALSE); |
---|
43 | void iiWriteMatrix(matrix im, const char *n, int dim, int spaces=0); |
---|
44 | char * iiStringMatrix(matrix im, int dim, char ch=','); |
---|
45 | void killlocals(int v); |
---|
46 | int exprlist_length(leftv v); |
---|
47 | char * Tok2Cmdname(int i); |
---|
48 | char * iiTwoOps(int t); |
---|
49 | int IsPrime(int i); |
---|
50 | |
---|
51 | BOOLEAN iiWRITE(leftv res,leftv exprlist); |
---|
52 | BOOLEAN iiExport(leftv v, int toLev); |
---|
53 | #ifdef HAVE_NAMESPACES |
---|
54 | BOOLEAN iiExport(leftv v, int toLev, idhdl roothdl); |
---|
55 | BOOLEAN iiInternalExport (leftv v, int toLev, idhdl roothdl); |
---|
56 | #endif /* HAVE_NAMESPACES */ |
---|
57 | char * iiGetLibName(procinfov v); |
---|
58 | char * iiGetLibProcBuffer( procinfov pi, int part=1 ); |
---|
59 | char * iiProcName(char *buf, char & ct, char* &e); |
---|
60 | char * iiProcArgs(char *e,BOOLEAN withParenth); |
---|
61 | #ifdef HAVE_NAMESPACES |
---|
62 | BOOLEAN iiLibCmd( char *newlib, BOOLEAN autoexport=TRUE, BOOLEAN tellerror=TRUE ); |
---|
63 | #else /* HAVE_NAMESPACES */ |
---|
64 | BOOLEAN iiLibCmd( char *newlib, BOOLEAN tellerror=TRUE ); |
---|
65 | #endif /* HAVE_NAMESPACES */ |
---|
66 | leftv iiMap(map theMap, char * what); |
---|
67 | void iiMakeResolv(resolvente r, int length, int rlen, char * name, int typ0, |
---|
68 | intvec ** weights=NULL); |
---|
69 | BOOLEAN jjMINRES(leftv res, leftv v); |
---|
70 | BOOLEAN jjBETTI(leftv res, leftv v); |
---|
71 | int iiRegularity(lists L); |
---|
72 | leftv singular_system(sleftv h); |
---|
73 | BOOLEAN jjSYSTEM(leftv res, leftv v); |
---|
74 | void iiDebug(); |
---|
75 | BOOLEAN iiCheckRing(int i); |
---|
76 | poly iiHighCorner(ideal i, int ak); |
---|
77 | /* ================================================================== */ |
---|
78 | /* Expressions : */ |
---|
79 | BOOLEAN iiExprArith1(leftv res, sleftv* a, int op); |
---|
80 | BOOLEAN iiExprArith2(leftv res, sleftv* a, int op, sleftv* b, |
---|
81 | BOOLEAN proccall=FALSE); |
---|
82 | BOOLEAN iiExprArith3(leftv res, int op, leftv a, leftv b, leftv c); |
---|
83 | BOOLEAN iiExprArithM(leftv res, sleftv* a, int op); |
---|
84 | |
---|
85 | typedef BOOLEAN (*proc1)(leftv,leftv); |
---|
86 | |
---|
87 | #ifdef INIT_BUG |
---|
88 | void jjInitTab1(); |
---|
89 | #endif |
---|
90 | #ifdef GENTABLE |
---|
91 | typedef char * (*Proc1)(char *); |
---|
92 | struct sValCmd1 |
---|
93 | { |
---|
94 | proc1 p; |
---|
95 | short cmd; |
---|
96 | short res; |
---|
97 | short arg; |
---|
98 | }; |
---|
99 | |
---|
100 | typedef BOOLEAN (*proc2)(leftv,leftv,leftv); |
---|
101 | struct sValCmd2 |
---|
102 | { |
---|
103 | proc2 p; |
---|
104 | short cmd; |
---|
105 | short res; |
---|
106 | short arg1; |
---|
107 | short arg2; |
---|
108 | #ifdef PROFILING |
---|
109 | short cnt; |
---|
110 | int t; |
---|
111 | #endif |
---|
112 | }; |
---|
113 | |
---|
114 | typedef BOOLEAN (*proc3)(leftv,leftv,leftv,leftv); |
---|
115 | struct sValCmd3 |
---|
116 | { |
---|
117 | proc3 p; |
---|
118 | short cmd; |
---|
119 | short res; |
---|
120 | short arg1; |
---|
121 | short arg2; |
---|
122 | short arg3; |
---|
123 | }; |
---|
124 | struct sValCmdM |
---|
125 | { |
---|
126 | proc1 p; |
---|
127 | short cmd; |
---|
128 | short res; |
---|
129 | short number_of_args; /* -1: any, -2: any >0, .. */ |
---|
130 | }; |
---|
131 | extern struct sValCmd2 dArith2[]; |
---|
132 | extern struct sValCmd1 dArith1[]; |
---|
133 | extern struct sValCmd3 dArith3[]; |
---|
134 | extern struct sValCmdM dArithM[]; |
---|
135 | #endif |
---|
136 | |
---|
137 | /* ================================================================== */ |
---|
138 | /* Assigments : */ |
---|
139 | BOOLEAN iiAssign(leftv left, leftv right); |
---|
140 | |
---|
141 | typedef BOOLEAN (*proci)(leftv,leftv,Subexpr); |
---|
142 | struct sValAssign_sys |
---|
143 | { |
---|
144 | proc1 p; |
---|
145 | short res; |
---|
146 | short arg; |
---|
147 | }; |
---|
148 | |
---|
149 | struct sValAssign |
---|
150 | { |
---|
151 | proci p; |
---|
152 | short res; |
---|
153 | short arg; |
---|
154 | }; |
---|
155 | |
---|
156 | BOOLEAN iiParameter(leftv p); |
---|
157 | /* ================================================================== */ |
---|
158 | int iiDeclCommand(leftv sy, leftv name, int lev, int t, idhdl* root, |
---|
159 | BOOLEAN isring = FALSE, BOOLEAN init_b=TRUE); |
---|
160 | #ifdef HAVE_NAMESPACES |
---|
161 | sleftv * iiMake_proc(idhdl pn, sleftv* slpn, sleftv* sl); |
---|
162 | #else /* HAVE_NAMESPACES */ |
---|
163 | sleftv * iiMake_proc(idhdl pn, sleftv* sl); |
---|
164 | #endif /* HAVE_NAMESPACES */ |
---|
165 | // from misc.cc: |
---|
166 | char * showOption(); |
---|
167 | BOOLEAN setOption(leftv res, leftv v); |
---|
168 | /* ================================================================== */ |
---|
169 | char * versionString(); |
---|
170 | #endif |
---|
171 | |
---|