source: git/Singular/ipshell.h @ 103560

spielwiese
Last change on this file since 103560 was 103560, checked in by Hans Schoenemann <hannes@…>, 13 years ago
redesign of command type, fix tr. 343 git-svn-id: file:///usr/local/Singular/svn/trunk@14272 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 5.1 KB
Line 
1#ifndef IPSHELL_H
2#define IPSHELL_H
3/****************************************
4*  Computer Algebra System SINGULAR     *
5****************************************/
6/* $Id$ */
7/*
8* ABSTRACT
9*/
10#include <stdio.h>
11#include <kernel/structs.h>
12#include <kernel/ideals.h>
13
14struct _ssubexpr;
15typedef struct _ssubexpr *Subexpr;
16
17
18extern leftv iiCurrArgs;
19extern idhdl iiCurrProc;
20extern int iiOp; /* the current operation*/
21extern const char *  currid;
22extern int     iiRETURNEXPR_len;
23extern sleftv *iiRETURNEXPR;
24#ifdef USE_IILOCALRING
25extern ring   *iiLocalRing;
26#endif
27//extern cmdnames cmds[];
28extern const char *lastreserved;
29extern const char *singular_date; /* tesths.cc, set by final compile */
30
31extern BOOLEAN yyInRingConstruction; /* 1: during ring construction */
32
33int     IsCmd(const char *n, int & tok);
34
35BOOLEAN iiPStart(idhdl pn, sleftv * sl);
36BOOLEAN iiEStart(char* example, procinfo *pi);
37void    type_cmd(leftv v);
38void    test_cmd(int i);
39void    list_cmd(int typ, const char* what, const char * prefix,
40                 BOOLEAN iterate, BOOLEAN fullname=FALSE);
41//char *  iiStringMatrix(matrix im, int dim, char ch=',');
42void    killlocals(int v);
43int     exprlist_length(leftv v);
44const char *  Tok2Cmdname(int i);
45const char *  iiTwoOps(int t);
46int     IsPrime(int i);
47
48BOOLEAN iiWRITE(leftv res,leftv exprlist);
49BOOLEAN iiExport(leftv v, int toLev);
50BOOLEAN iiExport(leftv v, int toLev, idhdl roothdl);
51BOOLEAN iiInternalExport (leftv v, int toLev, idhdl roothdl);
52char *  iiGetLibName(procinfov v);
53char *  iiGetLibProcBuffer( procinfov pi, int part=1 );
54char *  iiProcName(char *buf, char & ct, char* &e);
55char *  iiProcArgs(char *e,BOOLEAN withParenth);
56BOOLEAN iiLibCmd( char *newlib, BOOLEAN autoexport, BOOLEAN tellerror, BOOLEAN force );
57/* sees wheter library lib has already been loaded
58   if yes, writes filename of lib into where and returns TRUE,
59   if  no, returns FALSE
60*/
61BOOLEAN iiLocateLib(const char* lib, char* where);
62leftv   iiMap(map theMap, const char * what);
63void    iiMakeResolv(resolvente r, int length, int rlen, char * name, int typ0,
64           intvec ** weights=NULL);
65BOOLEAN jjMINRES(leftv res, leftv v);
66BOOLEAN jjBETTI(leftv res, leftv v);
67BOOLEAN jjBETTI2(leftv res, leftv u, leftv v);
68BOOLEAN jjBETTI2_ID(leftv res, leftv u, leftv v);
69BOOLEAN jjIMPORTFROM(leftv res, leftv u, leftv v);
70BOOLEAN jjLIST_PL(leftv res, leftv v);
71
72BOOLEAN jjVARIABLES_P(leftv res, leftv u);
73BOOLEAN jjVARIABLES_ID(leftv res, leftv u);
74
75int     iiRegularity(lists L);
76leftv   singular_system(sleftv h);
77BOOLEAN jjSYSTEM(leftv res, leftv v);
78void    iiDebug();
79BOOLEAN iiCheckRing(int i);
80poly    iiHighCorner(ideal i, int ak);
81char *  iiConvName(const char *libname);
82BOOLEAN iiLoadLIB(FILE *fp, char *libnamebuf, char *newlib,
83                         idhdl pl, BOOLEAN autoexport, BOOLEAN tellerror);
84
85
86/* ================================================================== */
87/* Expressions : */
88BOOLEAN iiExprArith1(leftv res, sleftv* a, int op);
89BOOLEAN iiExprArith2(leftv res, sleftv* a, int op, sleftv* b,
90                     BOOLEAN proccall=FALSE);
91BOOLEAN iiExprArith3(leftv res, int op, leftv a, leftv b, leftv c);
92BOOLEAN iiExprArithM(leftv res, sleftv* a, int op);
93
94typedef BOOLEAN (*proc1)(leftv,leftv);
95
96#ifdef __GNUC__
97#if (__GNUC__ < 3)
98#define INIT_BUG 1
99void    jjInitTab1();
100#endif
101#endif
102
103#ifdef GENTABLE
104typedef char * (*Proc1)(char *);
105struct sValCmd1
106{
107  proc1 p;
108  short cmd;
109  short res;
110  short arg;
111  short valid_for;
112};
113
114typedef BOOLEAN (*proc2)(leftv,leftv,leftv);
115struct sValCmd2
116{
117  proc2 p;
118  short cmd;
119  short res;
120  short arg1;
121  short arg2;
122  short valid_for;
123};
124
125typedef BOOLEAN (*proc3)(leftv,leftv,leftv,leftv);
126struct sValCmd3
127{
128  proc3 p;
129  short cmd;
130  short res;
131  short arg1;
132  short arg2;
133  short arg3;
134  short valid_for;
135};
136struct sValCmdM
137{
138  proc1 p;
139  short cmd;
140  short res;
141  short number_of_args; /* -1: any, -2: any >0, .. */
142  short valid_for;
143};
144extern struct sValCmd2 dArith2[];
145extern struct sValCmd1 dArith1[];
146extern struct sValCmd3 dArith3[];
147extern struct sValCmdM dArithM[];
148#endif
149
150/* ================================================================== */
151/* Assigments : */
152BOOLEAN iiAssign(leftv left, leftv right);
153
154typedef BOOLEAN (*proci)(leftv,leftv,Subexpr);
155struct sValAssign_sys
156{
157  proc1 p;
158  short res;
159  short arg;
160};
161
162struct sValAssign
163{
164  proci p;
165  short res;
166  short arg;
167};
168
169BOOLEAN iiParameter(leftv p);
170BOOLEAN iiAlias(leftv p);
171/* ================================================================== */
172int     iiDeclCommand(leftv sy, leftv name, int lev, int t, idhdl* root,
173  BOOLEAN isring = FALSE, BOOLEAN init_b=TRUE);
174sleftv * iiMake_proc(idhdl pn, package pack, sleftv* sl);
175// from misc.cc:
176char *  showOption();
177BOOLEAN setOption(leftv res, leftv v);
178/* ================================================================== */
179char * versionString();
180/* ================================================================== */
181void  singular_example(char *str);
182
183BOOLEAN iiTryLoadLib(leftv v, const char *id);
184
185int iiAddCproc(char *libname, char *procname, BOOLEAN pstatic,
186               BOOLEAN(*func)(leftv res, leftv v));
187
188void iiCheckPack(package &p);
189#ifndef NDEBUG
190void checkall();
191#endif
192#endif
193
Note: See TracBrowser for help on using the repository browser.