source: git/Singular/ipshell.h @ ca4a073

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