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