[0e1846] | 1 | #ifndef IPSHELL_H |
---|
| 2 | #define IPSHELL_H |
---|
| 3 | /**************************************** |
---|
| 4 | * Computer Algebra System SINGULAR * |
---|
| 5 | ****************************************/ |
---|
[a78f216] | 6 | /* $Id: ipshell.h,v 1.27 2002-01-07 17:18:11 Singular Exp $ */ |
---|
[0e1846] | 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 |
---|
[64d729] | 20 | #define TRACE_BREAKPOINT 32 |
---|
| 21 | #define TRACE_TMP_BREAKPOINT 64 |
---|
[0e1846] | 22 | extern leftv iiCurrArgs; |
---|
| 23 | extern int iiOp; /* the current operation*/ |
---|
| 24 | extern int myynest; |
---|
| 25 | extern char * currid; |
---|
| 26 | extern int iiRETURNEXPR_len; |
---|
| 27 | extern sleftv *iiRETURNEXPR; |
---|
[0a3ddd] | 28 | #ifdef USE_IILOCALRING |
---|
[0e1846] | 29 | extern ring *iiLocalRing; |
---|
[77ff8e] | 30 | #endif |
---|
[0e1846] | 31 | extern cmdnames cmds[]; |
---|
| 32 | extern char *lastreserved; |
---|
[923c27] | 33 | extern char *singular_date; |
---|
| 34 | |
---|
[34fbd93] | 35 | extern BOOLEAN yyInRingConstruction; /* 1: during ring construction */ |
---|
[0e1846] | 36 | |
---|
| 37 | int IsCmd(char *n, int & tok); |
---|
[057e93c] | 38 | BOOLEAN iiPStart(idhdl pn, sleftv * sl); |
---|
| 39 | BOOLEAN iiEStart(char* example, procinfo *pi); |
---|
[0e1846] | 40 | void type_cmd(idhdl h); |
---|
| 41 | void test_cmd(int i); |
---|
[daeb6d] | 42 | void list_cmd(int typ, const char* what, char * prefix, BOOLEAN iterate, |
---|
| 43 | BOOLEAN fullname=FALSE); |
---|
[0e1846] | 44 | void iiWriteMatrix(matrix im, const char *n, int dim, int spaces=0); |
---|
| 45 | char * iiStringMatrix(matrix im, int dim, char ch=','); |
---|
| 46 | void killlocals(int v); |
---|
| 47 | int exprlist_length(leftv v); |
---|
| 48 | char * Tok2Cmdname(int i); |
---|
| 49 | char * iiTwoOps(int t); |
---|
| 50 | int IsPrime(int i); |
---|
| 51 | |
---|
| 52 | BOOLEAN iiWRITE(leftv res,leftv exprlist); |
---|
| 53 | BOOLEAN iiExport(leftv v, int toLev); |
---|
[bd4cb92] | 54 | #ifdef HAVE_NS |
---|
| 55 | BOOLEAN iiExport(leftv v, int toLev, idhdl roothdl); |
---|
| 56 | BOOLEAN iiInternalExport (leftv v, int toLev, idhdl roothdl); |
---|
| 57 | #endif /* HAVE_NS */ |
---|
[0a3ddd] | 58 | #ifdef HAVE_NAMESPACES |
---|
| 59 | BOOLEAN iiExport(leftv v, int toLev, idhdl roothdl); |
---|
| 60 | BOOLEAN iiInternalExport (leftv v, int toLev, idhdl roothdl); |
---|
| 61 | #endif /* HAVE_NAMESPACES */ |
---|
[2ba9a6] | 62 | char * iiGetLibName(procinfov v); |
---|
| 63 | char * iiGetLibProcBuffer( procinfov pi, int part=1 ); |
---|
[0e1846] | 64 | char * iiProcName(char *buf, char & ct, char* &e); |
---|
| 65 | char * iiProcArgs(char *e,BOOLEAN withParenth); |
---|
[0a3ddd] | 66 | #ifdef HAVE_NAMESPACES |
---|
| 67 | BOOLEAN iiLibCmd( char *newlib, BOOLEAN autoexport=TRUE, BOOLEAN tellerror=TRUE ); |
---|
| 68 | #else /* HAVE_NAMESPACES */ |
---|
[dfc6b54] | 69 | BOOLEAN iiLibCmd( char *newlib, BOOLEAN tellerror=TRUE ); |
---|
[0a3ddd] | 70 | #endif /* HAVE_NAMESPACES */ |
---|
[698457] | 71 | /* sees wheter library lib has already been loaded |
---|
| 72 | if yes, writes filename of lib into where and returns TRUE, |
---|
| 73 | if no, returns FALSE |
---|
| 74 | */ |
---|
| 75 | BOOLEAN iiLocateLib(const char* lib, char* where); |
---|
[0e1846] | 76 | leftv iiMap(map theMap, char * what); |
---|
| 77 | void iiMakeResolv(resolvente r, int length, int rlen, char * name, int typ0, |
---|
| 78 | intvec ** weights=NULL); |
---|
| 79 | BOOLEAN jjMINRES(leftv res, leftv v); |
---|
| 80 | BOOLEAN jjBETTI(leftv res, leftv v); |
---|
| 81 | int iiRegularity(lists L); |
---|
| 82 | leftv singular_system(sleftv h); |
---|
| 83 | BOOLEAN jjSYSTEM(leftv res, leftv v); |
---|
| 84 | void iiDebug(); |
---|
| 85 | BOOLEAN iiCheckRing(int i); |
---|
[f99917f] | 86 | poly iiHighCorner(ideal i, int ak); |
---|
[0e1846] | 87 | /* ================================================================== */ |
---|
| 88 | /* Expressions : */ |
---|
| 89 | BOOLEAN iiExprArith1(leftv res, sleftv* a, int op); |
---|
| 90 | BOOLEAN iiExprArith2(leftv res, sleftv* a, int op, sleftv* b, |
---|
| 91 | BOOLEAN proccall=FALSE); |
---|
| 92 | BOOLEAN iiExprArith3(leftv res, int op, leftv a, leftv b, leftv c); |
---|
| 93 | BOOLEAN iiExprArithM(leftv res, sleftv* a, int op); |
---|
| 94 | |
---|
| 95 | typedef BOOLEAN (*proc1)(leftv,leftv); |
---|
| 96 | |
---|
| 97 | #ifdef INIT_BUG |
---|
| 98 | void jjInitTab1(); |
---|
| 99 | #endif |
---|
| 100 | #ifdef GENTABLE |
---|
| 101 | typedef char * (*Proc1)(char *); |
---|
| 102 | struct sValCmd1 |
---|
| 103 | { |
---|
| 104 | proc1 p; |
---|
| 105 | short cmd; |
---|
| 106 | short res; |
---|
| 107 | short arg; |
---|
| 108 | }; |
---|
| 109 | |
---|
| 110 | typedef BOOLEAN (*proc2)(leftv,leftv,leftv); |
---|
| 111 | struct sValCmd2 |
---|
| 112 | { |
---|
| 113 | proc2 p; |
---|
| 114 | short cmd; |
---|
| 115 | short res; |
---|
| 116 | short arg1; |
---|
| 117 | short arg2; |
---|
[670667] | 118 | #ifdef PROFILING |
---|
| 119 | short cnt; |
---|
| 120 | int t; |
---|
[6a6dccc] | 121 | #endif |
---|
[0e1846] | 122 | }; |
---|
| 123 | |
---|
| 124 | typedef BOOLEAN (*proc3)(leftv,leftv,leftv,leftv); |
---|
| 125 | struct sValCmd3 |
---|
| 126 | { |
---|
| 127 | proc3 p; |
---|
| 128 | short cmd; |
---|
| 129 | short res; |
---|
| 130 | short arg1; |
---|
| 131 | short arg2; |
---|
| 132 | short arg3; |
---|
| 133 | }; |
---|
| 134 | struct sValCmdM |
---|
| 135 | { |
---|
| 136 | proc1 p; |
---|
| 137 | short cmd; |
---|
| 138 | short res; |
---|
| 139 | short number_of_args; /* -1: any, -2: any >0, .. */ |
---|
| 140 | }; |
---|
| 141 | extern struct sValCmd2 dArith2[]; |
---|
| 142 | extern struct sValCmd1 dArith1[]; |
---|
| 143 | extern struct sValCmd3 dArith3[]; |
---|
| 144 | extern struct sValCmdM dArithM[]; |
---|
| 145 | #endif |
---|
| 146 | |
---|
| 147 | /* ================================================================== */ |
---|
| 148 | /* Assigments : */ |
---|
| 149 | BOOLEAN iiAssign(leftv left, leftv right); |
---|
| 150 | |
---|
| 151 | typedef BOOLEAN (*proci)(leftv,leftv,Subexpr); |
---|
| 152 | struct sValAssign_sys |
---|
| 153 | { |
---|
| 154 | proc1 p; |
---|
| 155 | short res; |
---|
| 156 | short arg; |
---|
| 157 | }; |
---|
| 158 | |
---|
| 159 | struct sValAssign |
---|
| 160 | { |
---|
| 161 | proci p; |
---|
| 162 | short res; |
---|
| 163 | short arg; |
---|
| 164 | }; |
---|
| 165 | |
---|
| 166 | BOOLEAN iiParameter(leftv p); |
---|
| 167 | /* ================================================================== */ |
---|
| 168 | int iiDeclCommand(leftv sy, leftv name, int lev, int t, idhdl* root, |
---|
[0a3ddd] | 169 | BOOLEAN isring = FALSE, BOOLEAN init_b=TRUE); |
---|
| 170 | #ifdef HAVE_NAMESPACES |
---|
| 171 | sleftv * iiMake_proc(idhdl pn, sleftv* slpn, sleftv* sl); |
---|
| 172 | #else /* HAVE_NAMESPACES */ |
---|
[a3bc95e] | 173 | #ifdef HAVE_NS |
---|
| 174 | sleftv * iiMake_proc(idhdl pn, package pack, sleftv* sl); |
---|
| 175 | #else /* HAVE_NS */ |
---|
[0e1846] | 176 | sleftv * iiMake_proc(idhdl pn, sleftv* sl); |
---|
[a3bc95e] | 177 | #endif /* HAVE_NS */ |
---|
[0a3ddd] | 178 | #endif /* HAVE_NAMESPACES */ |
---|
[0e1846] | 179 | // from misc.cc: |
---|
[979a09f] | 180 | char * showOption(); |
---|
[0e1846] | 181 | BOOLEAN setOption(leftv res, leftv v); |
---|
| 182 | /* ================================================================== */ |
---|
[9ea9c6] | 183 | char * versionString(); |
---|
[706c95] | 184 | /* ================================================================== */ |
---|
| 185 | void singular_example(char *str); |
---|
[a3bc95e] | 186 | |
---|
| 187 | #ifdef HAVE_NS |
---|
[a78f216] | 188 | void listall(int showproc=1); |
---|
[a3bc95e] | 189 | void checkall(); |
---|
| 190 | #endif |
---|
[0e1846] | 191 | #endif |
---|
| 192 | |
---|