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