source: git/Singular/ipshell.h @ b14855

spielwiese
Last change on this file since b14855 was cf4886, checked in by Hans Schoenemann <hannes@…>, 13 years ago
IsCmdToken only for gentable git-svn-id: file:///usr/local/Singular/svn/trunk@13825 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(idhdl h);
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);
70
71BOOLEAN jjVARIABLES_P(leftv res, leftv u);
72BOOLEAN jjVARIABLES_ID(leftv res, leftv u);
73
74int     iiRegularity(lists L);
75leftv   singular_system(sleftv h);
76BOOLEAN jjSYSTEM(leftv res, leftv v);
77void    iiDebug();
78BOOLEAN iiCheckRing(int i);
79poly    iiHighCorner(ideal i, int ak);
80char *  iiConvName(const char *libname);
81BOOLEAN iiLoadLIB(FILE *fp, char *libnamebuf, char *newlib,
82                         idhdl pl, BOOLEAN autoexport, BOOLEAN tellerror);
83
84
85/* ================================================================== */
86/* Expressions : */
87BOOLEAN iiExprArith1(leftv res, sleftv* a, int op);
88BOOLEAN iiExprArith2(leftv res, sleftv* a, int op, sleftv* b,
89                     BOOLEAN proccall=FALSE);
90BOOLEAN iiExprArith3(leftv res, int op, leftv a, leftv b, leftv c);
91BOOLEAN iiExprArithM(leftv res, sleftv* a, int op);
92
93typedef BOOLEAN (*proc1)(leftv,leftv);
94
95#ifdef __GNUC__
96#if (__GNUC__ < 3)
97#define INIT_BUG 1
98void    jjInitTab1();
99#endif
100#endif
101
102#ifdef GENTABLE
103typedef char * (*Proc1)(char *);
104struct sValCmd1
105{
106  proc1 p;
107  short cmd;
108  short res;
109  short arg;
110  short valid_for;
111};
112
113typedef BOOLEAN (*proc2)(leftv,leftv,leftv);
114struct sValCmd2
115{
116  proc2 p;
117  short cmd;
118  short res;
119  short arg1;
120  short arg2;
121  short valid_for;
122};
123
124typedef BOOLEAN (*proc3)(leftv,leftv,leftv,leftv);
125struct sValCmd3
126{
127  proc3 p;
128  short cmd;
129  short res;
130  short arg1;
131  short arg2;
132  short arg3;
133  short valid_for;
134};
135struct sValCmdM
136{
137  proc1 p;
138  short cmd;
139  short res;
140  short number_of_args; /* -1: any, -2: any >0, .. */
141  short valid_for;
142};
143extern struct sValCmd2 dArith2[];
144extern struct sValCmd1 dArith1[];
145extern struct sValCmd3 dArith3[];
146extern struct sValCmdM dArithM[];
147#endif
148
149/* ================================================================== */
150/* Assigments : */
151BOOLEAN iiAssign(leftv left, leftv right);
152
153typedef BOOLEAN (*proci)(leftv,leftv,Subexpr);
154struct sValAssign_sys
155{
156  proc1 p;
157  short res;
158  short arg;
159};
160
161struct sValAssign
162{
163  proci p;
164  short res;
165  short arg;
166};
167
168BOOLEAN iiParameter(leftv p);
169BOOLEAN iiAlias(leftv p);
170/* ================================================================== */
171int     iiDeclCommand(leftv sy, leftv name, int lev, int t, idhdl* root,
172  BOOLEAN isring = FALSE, BOOLEAN init_b=TRUE);
173sleftv * iiMake_proc(idhdl pn, package pack, sleftv* sl);
174// from misc.cc:
175char *  showOption();
176BOOLEAN setOption(leftv res, leftv v);
177/* ================================================================== */
178char * versionString();
179/* ================================================================== */
180void  singular_example(char *str);
181
182BOOLEAN iiTryLoadLib(leftv v, const char *id);
183
184int iiAddCproc(char *libname, char *procname, BOOLEAN pstatic,
185               BOOLEAN(*func)(leftv res, leftv v));
186
187void iiCheckPack(package &p);
188#ifndef NDEBUG
189void checkall();
190#endif
191#endif
192
Note: See TracBrowser for help on using the repository browser.