Data Structures | Macros | Functions | Variables
iplib.cc File Reference
#include <kernel/mod2.h>
#include <Singular/tok.h>
#include <misc/options.h>
#include <Singular/ipid.h>
#include <omalloc/omalloc.h>
#include <polys/monomials/ring.h>
#include <Singular/subexpr.h>
#include <Singular/ipshell.h>
#include <Singular/fevoices.h>
#include <Singular/lists.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <sys/stat.h>
#include "libparse.h"
#include <Singular/mod_lib.h>

Go to the source code of this file.

Data Structures

struct  soptionStruct
 

Macros

#define SI_MAX_NEST   500
 
#define MODULE_SUFFIX   so
 
#define MODULE_SUFFIX_STRING   EXPANDED_STRINGIFY(MODULE_SUFFIX)
 
#define NS_LRING   (procstack->cRing)
 
#define SI_GET_BUILTIN_MOD_INIT0(name)   int SI_MOD_INIT0(name)(SModulFunctions*);
 
#define SI_GET_BUILTIN_MOD_INIT(name)   if (strcmp(libname, #name ".so") == 0){ return SI_MOD_INIT0(name); }
 

Functions

BOOLEAN load_modules (const char *newlib, char *fullname, BOOLEAN autoexport)
 
int iiArithAddCmd (const char *szName, short nAlias, short nTokval, short nToktype, short nPos)
 
void yylprestart (FILE *input_file)
 
int current_pos (int i=0)
 
void print_init ()
 
char mytolower (char c)
 
BOOLEAN iiGetLibStatus (char *lib)
 
char * iiGetLibName (procinfov pi)
 
char * iiProcName (char *buf, char &ct, char *&e)
 
char * iiProcArgs (char *e, BOOLEAN withParenth)
 
char * iiGetLibProcBuffer (procinfo *pi, int part)
 
BOOLEAN iiAllStart (procinfov pi, char *p, feBufferTypes t, int l)
 
BOOLEAN iiPStart (idhdl pn, sleftv *v)
 
static void iiShowLevRings ()
 
static void iiCheckNest ()
 
BOOLEAN iiMake_proc (idhdl pn, package pack, sleftv *sl)
 
BOOLEAN iiEStart (char *example, procinfo *pi)
 
 SI_FOREACH_BUILTIN (SI_GET_BUILTIN_MOD_INIT0)}
 
SModulFunc_t iiGetBuiltinModInit (const char *libname)
 
BOOLEAN iiTryLoadLib (leftv v, const char *id)
 
BOOLEAN iiLocateLib (const char *lib, char *where)
 
BOOLEAN iiLibCmd (char *newlib, BOOLEAN autoexport, BOOLEAN tellerror, BOOLEAN force)
 
static void iiCleanProcs (idhdl &root)
 
static void iiRunInit (package p)
 
BOOLEAN iiLoadLIB (FILE *fp, const char *libnamebuf, const char *newlib, idhdl pl, BOOLEAN autoexport, BOOLEAN tellerror)
 
procinfoiiInitSingularProcinfo (procinfov pi, const char *libname, const char *procname, int line, long pos, BOOLEAN pstatic)
 
int iiAddCproc (const char *libname, const char *procname, BOOLEAN pstatic, BOOLEAN(*func)(leftv res, leftv v))
 
int iiAddCprocTop (const char *libname, const char *procname, BOOLEAN pstatic, BOOLEAN(*func)(leftv res, leftv v))
 
BOOLEAN load_builtin (const char *newlib, BOOLEAN autoexport, SModulFunc_t init)
 
void module_help_main (const char *newlib, const char *help)
 
void module_help_proc (const char *newlib, const char *p, const char *help)
 
void * binary_module_function (const char *newlib, const char *funcname)
 
char mytoupper (char c)
 
char * iiConvName (const char *libname)
 

Variables

int yylp_errno
 
int yylplineno
 
char * yylp_errlist []
 
libstackv library_stack
 
struct soptionStruct optionStruct []
 
struct soptionStruct verboseStruct []
 
ring * iiLocalRing
 
sleftv iiRETURNEXPR
 
int iiRETURNEXPR_len =0
 

Data Structure Documentation

struct soptionStruct

Definition at line 302 of file iplib.cc.

Data Fields
const char * name
unsigned resetval
unsigned setval

Macro Definition Documentation

#define MODULE_SUFFIX   so

Definition at line 44 of file iplib.cc.

#define MODULE_SUFFIX_STRING   EXPANDED_STRINGIFY(MODULE_SUFFIX)

Definition at line 47 of file iplib.cc.

#define NS_LRING   (procstack->cRing)

Definition at line 60 of file iplib.cc.

#define SI_GET_BUILTIN_MOD_INIT (   name)    if (strcmp(libname, #name ".so") == 0){ return SI_MOD_INIT0(name); }
#define SI_GET_BUILTIN_MOD_INIT0 (   name)    int SI_MOD_INIT0(name)(SModulFunctions*);

Definition at line 721 of file iplib.cc.

#define SI_MAX_NEST   500

Definition at line 32 of file iplib.cc.

Function Documentation

void* binary_module_function ( const char *  newlib,
const char *  funcname 
)

Definition at line 1215 of file iplib.cc.

1216 {
1217  void* result = NULL;
1218 
1219 #if defined(HAVE_STATIC) || !defined(HAVE_DYNAMIC_LOADING)
1220  WerrorS("static version can not load function from dynamic modules");
1221 #else
1222  const char* bin_dir = feGetResource('b');
1223  if (!bin_dir) { return NULL; }
1224 
1225  char path_name[MAXPATHLEN];
1226  sprintf(path_name, "%s%s%s.%s", bin_dir, DIR_SEPP, newlib, MODULE_SUFFIX_STRING);
1227 
1228  void* openlib = dynl_open(path_name);
1229  if(!openlib)
1230  {
1231  Werror("dynl_open of %s failed:%s", path_name, dynl_error());
1232  return NULL;
1233  }
1234  result = dynl_sym(openlib, funcname);
1235  if (!result) Werror("%s: %s\n", funcname, dynl_error());
1236 #endif
1237 
1238  return result;
1239 }
#define MAXPATHLEN
Definition: omRet2Info.c:22
void * dynl_sym(void *handle, const char *symbol)
Definition: mod_raw.cc:171
void WerrorS(const char *s)
Definition: feFopen.cc:23
void * dynl_open(char *filename)
Definition: mod_raw.cc:157
char * feGetResource(const char id, int warn)
Definition: feResource.cc:149
#define DIR_SEPP
Definition: feResource.h:7
#define MODULE_SUFFIX_STRING
Definition: iplib.cc:47
#define NULL
Definition: omList.c:10
void Werror(const char *fmt,...)
Definition: reporter.cc:199
return result
Definition: facAbsBiFact.cc:76
const char * dynl_error()
Definition: mod_raw.cc:187
int current_pos ( int  i = 0)

Definition at line 3347 of file libparse.cc.

3348 {
3349  return(i+offset+(int)(yytext-yylp_buffer_start));
3350 }
#define yytext
Definition: libparse.cc:16
int i
Definition: cfEzgcd.cc:123
char * yylp_buffer_start
Definition: libparse.cc:1100
int offset
Definition: libparse.cc:1091
int iiAddCproc ( const char *  libname,
const char *  procname,
BOOLEAN  pstatic,
BOOLEAN(*)(leftv res, leftv v func 
)

Definition at line 991 of file iplib.cc.

993 {
994  procinfov pi;
995  idhdl h;
996 
997  #ifndef SING_NDEBUG
998  int dummy;
999  if (IsCmd(procname,dummy))
1000  {
1001  Werror(">>%s< is a reserved name",procname);
1002  return 0;
1003  }
1004  #endif
1005 
1006  h = enterid(procname,0, PROC_CMD, &IDROOT, TRUE);
1007  if ( h!= NULL )
1008  {
1009  pi = IDPROC(h);
1010  pi->libname = omStrDup(libname);
1011  pi->procname = omStrDup(procname);
1012  pi->language = LANG_C;
1013  pi->ref = 1;
1014  pi->is_static = pstatic;
1015  pi->data.o.function = func;
1016  return(1);
1017  }
1018  else
1019  {
1020  PrintS("iiAddCproc: failed.\n");
1021  }
1022  return(0);
1023 }
language_defs language
Definition: subexpr.h:58
#define IDROOT
Definition: ipid.h:20
#define TRUE
Definition: auxiliary.h:144
short ref
Definition: subexpr.h:59
Definition: idrec.h:34
char * procname
Definition: subexpr.h:56
Definition: subexpr.h:20
idhdl enterid(const char *s, int lev, int t, idhdl *root, BOOLEAN init, BOOLEAN search)
Definition: ipid.cc:256
char * libname
Definition: subexpr.h:55
procinfodata data
Definition: subexpr.h:62
void PrintS(const char *s)
Definition: reporter.cc:294
char is_static
Definition: subexpr.h:60
#define IDPROC(a)
Definition: ipid.h:139
#define pi
Definition: libparse.cc:1143
#define NULL
Definition: omList.c:10
static Poly * h
Definition: janet.cc:978
void Werror(const char *fmt,...)
Definition: reporter.cc:199
int IsCmd(const char *n, int &tok)
Definition: iparith.cc:8688
#define omStrDup(s)
Definition: omAllocDecl.h:263
int iiAddCprocTop ( const char *  libname,
const char *  procname,
BOOLEAN  pstatic,
BOOLEAN(*)(leftv res, leftv v func 
)

Definition at line 1025 of file iplib.cc.

1027 {
1028  int r=iiAddCproc(libname,procname,pstatic,func);
1029  package s=currPack;
1031  if (r) r=iiAddCproc(libname,procname,pstatic,func);
1032  currPack=s;
1033  return r;
1034 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
const ring r
Definition: syzextra.cc:208
package basePack
Definition: ipid.cc:63
package currPack
Definition: ipid.cc:62
int iiAddCproc(const char *libname, const char *procname, BOOLEAN pstatic, BOOLEAN(*func)(leftv res, leftv v))
Definition: iplib.cc:991
BOOLEAN iiAllStart ( procinfov  pi,
char *  p,
feBufferTypes  t,
int  l 
)

Definition at line 312 of file iplib.cc.

313 {
314  // see below:
315  BITSET save1=si_opt_1;
316  BITSET save2=si_opt_2;
317  newBuffer( omStrDup(p /*pi->data.s.body*/), t /*BT_proc*/,
318  pi, l );
319  BOOLEAN err=yyparse();
320  if (sLastPrinted.rtyp!=0)
321  {
323  }
324  // the access to optionStruct and verboseStruct do not work
325  // on x86_64-Linux for pic-code
326  if ((TEST_V_ALLWARN) &&
327  (t==BT_proc) &&
328  ((save1!=si_opt_1)||(save2!=si_opt_2)) &&
329  (pi->libname!=NULL) && (pi->libname[0]!='\0'))
330  {
331  if ((pi->libname!=NULL) && (pi->libname[0]!='\0'))
332  Warn("option changed in proc %s from %s",pi->procname,pi->libname);
333  else
334  Warn("option changed in proc %s",pi->procname);
335  int i;
336  for (i=0; optionStruct[i].setval!=0; i++)
337  {
338  if ((optionStruct[i].setval & si_opt_1)
339  && (!(optionStruct[i].setval & save1)))
340  {
341  Print(" +%s",optionStruct[i].name);
342  }
343  if (!(optionStruct[i].setval & si_opt_1)
344  && ((optionStruct[i].setval & save1)))
345  {
346  Print(" -%s",optionStruct[i].name);
347  }
348  }
349  for (i=0; verboseStruct[i].setval!=0; i++)
350  {
351  if ((verboseStruct[i].setval & si_opt_2)
352  && (!(verboseStruct[i].setval & save2)))
353  {
354  Print(" +%s",verboseStruct[i].name);
355  }
356  if (!(verboseStruct[i].setval & si_opt_2)
357  && ((verboseStruct[i].setval & save2)))
358  {
359  Print(" -%s",verboseStruct[i].name);
360  }
361  }
362  PrintLn();
363  }
364  return err;
365 }
unsigned si_opt_1
Definition: options.c:5
void PrintLn()
Definition: reporter.cc:322
#define Print
Definition: emacs.cc:83
return P p
Definition: myNF.cc:203
struct soptionStruct optionStruct[]
Definition: misc_ip.cc:519
#define BITSET
Definition: structs.h:17
char * procname
Definition: subexpr.h:56
unsigned setval
Definition: iplib.cc:305
struct soptionStruct verboseStruct[]
Definition: misc_ip.cc:549
char * libname
Definition: subexpr.h:55
int i
Definition: cfEzgcd.cc:123
int yyparse(void)
Definition: grammar.cc:2168
char name(const Variable &v)
Definition: variable.h:95
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
sleftv sLastPrinted
Definition: subexpr.cc:55
void CleanUp(ring r=currRing)
Definition: subexpr.cc:301
void newBuffer(char *s, feBufferTypes t, procinfo *pi, int lineno)
Definition: fevoices.cc:169
unsigned si_opt_2
Definition: options.c:6
int BOOLEAN
Definition: auxiliary.h:131
#define TEST_V_ALLWARN
Definition: options.h:135
int l
Definition: cfEzgcd.cc:94
#define Warn
Definition: emacs.cc:80
#define omStrDup(s)
Definition: omAllocDecl.h:263
int iiArithAddCmd ( const char *  szName,
short  nAlias,
short  nTokval,
short  nToktype,
short  nPos 
)

Definition at line 9028 of file iparith.cc.

9035 {
9036  //printf("AddCmd(%s, %d, %d, %d, %d)\n", szName, nAlias,
9037  // nTokval, nToktype, nPos);
9038  if(nPos>=0)
9039  {
9040  // no checks: we rely on a correct generated code in iparith.inc
9042  assume(szName!=NULL);
9043  sArithBase.sCmds[nPos].name = omStrDup(szName);
9044  sArithBase.sCmds[nPos].alias = nAlias;
9045  sArithBase.sCmds[nPos].tokval = nTokval;
9046  sArithBase.sCmds[nPos].toktype = nToktype;
9047  sArithBase.nCmdUsed++;
9048  //if(nTokval>0) sArithBase.nLastIdentifier++;
9049  }
9050  else
9051  {
9052  if(szName==NULL) return -1;
9053  int nIndex = iiArithFindCmd(szName);
9054  if(nIndex>=0)
9055  {
9056  Print("'%s' already exists at %d\n", szName, nIndex);
9057  return -1;
9058  }
9059 
9061  {
9062  /* needs to create new slots */
9063  unsigned long nSize = (sArithBase.nCmdAllocated+1)*sizeof(cmdnames);
9064  sArithBase.sCmds = (cmdnames *)omRealloc(sArithBase.sCmds, nSize);
9065  if(sArithBase.sCmds==NULL) return -1;
9067  }
9068  /* still free slots available */
9069  sArithBase.sCmds[sArithBase.nCmdUsed].name = omStrDup(szName);
9070  sArithBase.sCmds[sArithBase.nCmdUsed].alias = nAlias;
9071  sArithBase.sCmds[sArithBase.nCmdUsed].tokval = nTokval;
9072  sArithBase.sCmds[sArithBase.nCmdUsed].toktype = nToktype;
9073  sArithBase.nCmdUsed++;
9074 
9075  qsort(sArithBase.sCmds, sArithBase.nCmdUsed, sizeof(cmdnames),
9076  (&_gentable_sort_cmds));
9079  {
9080  if(sArithBase.sCmds[sArithBase.nLastIdentifier].tokval>=0) break;
9081  }
9082  //Print("L=%d\n", sArithBase.nLastIdentifier);
9083  }
9084  return 0;
9085 }
static int _gentable_sort_cmds(const void *a, const void *b)
compares to entry of cmdsname-list
Definition: iparith.cc:8861
#define Print
Definition: emacs.cc:83
int nCmdAllocated
number of commands-slots allocated
Definition: iparith.cc:208
#define assume(x)
Definition: mod2.h:405
int nLastIdentifier
valid indentifieres are slot 1..nLastIdentifier
Definition: iparith.cc:209
int nCmdUsed
number of commands used
Definition: iparith.cc:207
#define NULL
Definition: omList.c:10
#define nSize(n)
Definition: numbers.h:39
static SArithBase sArithBase
Base entry for arithmetic.
Definition: iparith.cc:217
int iiArithFindCmd(const char *szName)
Definition: iparith.cc:8933
cmdnames * sCmds
array of existing commands
Definition: iparith.cc:202
#define omRealloc(addr, size)
Definition: omAllocDecl.h:225
#define omStrDup(s)
Definition: omAllocDecl.h:263
static void iiCheckNest ( )
static

Definition at line 550 of file iplib.cc.

551 {
552  if (myynest >= iiRETURNEXPR_len-1)
553  {
554 #ifdef USE_IILOCALRING
556  iiRETURNEXPR_len*sizeof(ring),
557  (iiRETURNEXPR_len+16)*sizeof(ring));
558  memset(&(iiLocalRing[iiRETURNEXPR_len]),0,16*sizeof(ring));
559 #endif
560  iiRETURNEXPR_len+=16;
561  }
562 }
int iiRETURNEXPR_len
Definition: iplib.cc:518
#define omreallocSize(addr, o_size, size)
Definition: omAllocDecl.h:231
int myynest
Definition: febase.cc:46
ring * iiLocalRing
Definition: iplib.cc:515
static void iiCleanProcs ( idhdl root)
static

Definition at line 845 of file iplib.cc.

846 {
847  idhdl prev=NULL;
848  loop
849  {
850  if (root==NULL) return;
851  if (IDTYP(root)==PROC_CMD)
852  {
853  procinfo *pi=(procinfo*)IDDATA(root);
854  if ((pi->language == LANG_SINGULAR)
855  && (pi->data.s.body_start == 0L))
856  {
857  // procinfo data incorrect:
858  // - no proc body can start at the beginning of the file
859  killhdl(root);
860  if (prev==NULL)
861  root=IDROOT;
862  else
863  {
864  root=prev;
865  prev=NULL;
866  }
867  continue;
868  }
869  }
870  prev=root;
871  root=IDNEXT(root);
872  }
873 }
loop
Definition: myNF.cc:98
#define IDNEXT(a)
Definition: ipid.h:117
language_defs language
Definition: subexpr.h:58
#define IDROOT
Definition: ipid.h:20
Definition: idrec.h:34
#define IDTYP(a)
Definition: ipid.h:118
procinfodata data
Definition: subexpr.h:62
#define pi
Definition: libparse.cc:1143
#define NULL
Definition: omList.c:10
void killhdl(idhdl h, package proot)
Definition: ipid.cc:369
#define IDDATA(a)
Definition: ipid.h:125
char* iiConvName ( const char *  libname)

Definition at line 1262 of file iplib.cc.

1263 {
1264  char *tmpname = omStrDup(libname);
1265  char *p = strrchr(tmpname, DIR_SEP);
1266  char *r;
1267  if(p==NULL) p = tmpname;
1268  else p++;
1269  r = (char *)strchr(p, '.');
1270  if( r!= NULL) *r = '\0';
1271  r = omStrDup(p);
1272  *r = mytoupper(*r);
1273  // printf("iiConvName: '%s' '%s' => '%s'\n", libname, tmpname, r);
1274  omFree((ADDRESS)tmpname);
1275 
1276  return(r);
1277 }
char mytoupper(char c)
Definition: iplib.cc:1243
return P p
Definition: myNF.cc:203
void * ADDRESS
Definition: auxiliary.h:161
#define DIR_SEP
Definition: feResource.h:6
const ring r
Definition: syzextra.cc:208
#define omFree(addr)
Definition: omAllocDecl.h:261
#define NULL
Definition: omList.c:10
#define omStrDup(s)
Definition: omAllocDecl.h:263
BOOLEAN iiEStart ( char *  example,
procinfo pi 
)

Definition at line 655 of file iplib.cc.

656 {
657  BOOLEAN err;
658  int old_echo=si_echo;
659 
660  iiCheckNest();
661  procstack->push(example);
662 #ifdef USE_IILOCALRING
664 #endif
666  {
667  if (traceit&TRACE_SHOW_LINENO) printf("\n");
668  printf("entering example (level %d)\n",myynest);
669  }
670  myynest++;
671 
672  err=iiAllStart(pi,example,BT_example,(pi != NULL ? pi->data.s.example_lineno: 0));
673 
675  myynest--;
676  si_echo=old_echo;
677  if (traceit&TRACE_SHOW_PROC)
678  {
679  if (traceit&TRACE_SHOW_LINENO) printf("\n");
680  printf("leaving -example- (level %d)\n",myynest);
681  }
682 #ifdef USE_IILOCALRING
683  if (iiLocalRing[myynest] != currRing)
684  {
685  if (iiLocalRing[myynest]!=NULL)
686  {
689  }
690  else
691  {
693  currRing=NULL;
694  }
695  }
696 #else /* USE_IILOCALRING */
697 #endif /* USE_IILOCALRING */
698  if (NS_LRING != currRing)
699  {
700  if (NS_LRING!=NULL)
701  {
703  if ((rh==NULL)||(IDRING(rh)!=NS_LRING))
704  rh=rFindHdl(NS_LRING,NULL);
705  rSetHdl(rh);
706  }
707  else
708  {
710  currRing=NULL;
711  }
712  }
713 //#endif /* USE_IILOCALRING */
714  procstack->pop();
715  return err;
716 }
#define TRACE_SHOW_LINENO
Definition: reporter.h:26
proclevel * procstack
Definition: ipid.cc:57
int traceit
Definition: febase.cc:47
idhdl cRingHdl
Definition: ipid.h:60
static void iiCheckNest()
Definition: iplib.cc:550
Definition: idrec.h:34
int myynest
Definition: febase.cc:46
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
void killlocals(int v)
Definition: ipshell.cc:382
procinfodata data
Definition: subexpr.h:62
idhdl currRingHdl
Definition: ipid.cc:64
idhdl rFindHdl(ring r, idhdl n)
Definition: ipshell.cc:1690
BOOLEAN iiAllStart(procinfov pi, char *p, feBufferTypes t, int l)
Definition: iplib.cc:312
ring * iiLocalRing
Definition: iplib.cc:515
#define NULL
Definition: omList.c:10
#define IDRING(a)
Definition: ipid.h:126
#define TRACE_SHOW_PROC
Definition: reporter.h:25
void rSetHdl(idhdl h)
Definition: ipshell.cc:4821
void push(char *)
Definition: ipid.cc:699
void pop()
Definition: ipid.cc:711
int BOOLEAN
Definition: auxiliary.h:131
#define NS_LRING
Definition: iplib.cc:60
int si_echo
Definition: febase.cc:41
SModulFunc_t iiGetBuiltinModInit ( const char *  libname)

Definition at line 728 of file iplib.cc.

729 {
730 # define SI_GET_BUILTIN_MOD_INIT(name) if (strcmp(libname, #name ".so") == 0){ return SI_MOD_INIT0(name); }
732 # undef SI_GET_BUILTIN_MOD_INIT
733 
734  return NULL;
735 }
#define SI_GET_BUILTIN_MOD_INIT(name)
SI_FOREACH_BUILTIN(SI_GET_BUILTIN_MOD_INIT0)}
#define NULL
Definition: omList.c:10
char* iiGetLibName ( procinfov  pi)

Definition at line 101 of file iplib.cc.

102 {
103  return pi->libname;
104 }
char * libname
Definition: subexpr.h:55
char* iiGetLibProcBuffer ( procinfo pi,
int  part 
)

Definition at line 200 of file iplib.cc.

201 {
202  char buf[256], *s = NULL, *p;
203  long procbuflen;
204 
205  FILE * fp = feFopen( pi->libname, "rb", NULL, TRUE );
206  if (fp==NULL)
207  {
208  return NULL;
209  }
210 
211  fseek(fp, pi->data.s.proc_start, SEEK_SET);
212  if(part==0)
213  { // load help string
214  int i, offset=0;
215  long head = pi->data.s.def_end - pi->data.s.proc_start;
216  procbuflen = pi->data.s.help_end - pi->data.s.help_start;
217  if (procbuflen<5)
218  {
219  fclose(fp);
220  return NULL; // help part does not exist
221  }
222  //Print("Help=%ld-%ld=%d\n", pi->data.s.body_start,
223  // pi->data.s.proc_start, procbuflen);
224  s = (char *)omAlloc(procbuflen+head+3);
225  myfread(s, head, 1, fp);
226  s[head] = '\n';
227  fseek(fp, pi->data.s.help_start, SEEK_SET);
228  myfread(s+head+1, procbuflen, 1, fp);
229  fclose(fp);
230  s[procbuflen+head+1] = '\n';
231  s[procbuflen+head+2] = '\0';
232  offset=0;
233  for(i=0;i<=procbuflen+head+2; i++)
234  {
235  if(s[i]=='\\' &&
236  (s[i+1]=='"' || s[i+1]=='{' || s[i+1]=='}' || s[i+1]=='\\'))
237  {
238  i++;
239  offset++;
240  }
241  if(offset>0) s[i-offset] = s[i];
242  }
243  return(s);
244  }
245  else if(part==1)
246  { // load proc part - must exist
247  procbuflen = pi->data.s.def_end - pi->data.s.proc_start;
248  char *ss=(char *)omAlloc(procbuflen+2);
249  //fgets(buf, sizeof(buf), fp);
250  myfread( ss, procbuflen, 1, fp);
251  char ct;
252  char *e;
253  s=iiProcName(ss,ct,e);
254  char *argstr=NULL;
255  *e=ct;
256  argstr=iiProcArgs(e,TRUE);
257 
258  assume(pi->data.s.body_end > pi->data.s.body_start);
259 
260  procbuflen = pi->data.s.body_end - pi->data.s.body_start;
261  pi->data.s.body = (char *)omAlloc( strlen(argstr)+procbuflen+15+
262  strlen(pi->libname) );
263  //Print("Body=%ld-%ld=%d\n", pi->data.s.body_end,
264  // pi->data.s.body_start, procbuflen);
265  assume(pi->data.s.body != NULL);
266  fseek(fp, pi->data.s.body_start, SEEK_SET);
267  strcpy(pi->data.s.body,argstr);
268  myfread( pi->data.s.body+strlen(argstr), procbuflen, 1, fp);
269  fclose( fp );
270  procbuflen+=strlen(argstr);
271  omFree(argstr);
272  omFree(ss);
273  pi->data.s.body[procbuflen] = '\0';
274  strcat( pi->data.s.body+procbuflen, "\n;return();\n\n" );
275  strcat( pi->data.s.body+procbuflen+13,pi->libname);
276  s=(char *)strchr(pi->data.s.body,'{');
277  if (s!=NULL) *s=' ';
278  return NULL;
279  }
280  else if(part==2)
281  { // example
282  if ( pi->data.s.example_lineno == 0)
283  return NULL; // example part does not exist
284  // load example
285  fseek(fp, pi->data.s.example_start, SEEK_SET);
286  /*char *dummy=*/ (void) fgets(buf, sizeof(buf), fp); // skip line with "example"
287  procbuflen = pi->data.s.proc_end - pi->data.s.example_start - strlen(buf);
288  //Print("Example=%ld-%ld=%d\n", pi->data.s.proc_end,
289  // pi->data.s.example_start, procbuflen);
290  s = (char *)omAlloc(procbuflen+14);
291  myfread(s, procbuflen, 1, fp);
292  s[procbuflen] = '\0';
293  strcat(s+procbuflen-3, "\n;return();\n\n" );
294  p=(char *)strchr(s,'{');
295  if (p!=NULL) *p=' ';
296  return(s);
297  }
298  return NULL;
299 }
char * iiProcArgs(char *e, BOOLEAN withParenth)
Definition: iplib.cc:127
const CanonicalForm int s
Definition: facAbsFact.cc:55
CanonicalForm fp
Definition: cfModGcd.cc:4043
return P p
Definition: myNF.cc:203
#define TRUE
Definition: auxiliary.h:144
#define omAlloc(size)
Definition: omAllocDecl.h:210
char * libname
Definition: subexpr.h:55
#define omFree(addr)
Definition: omAllocDecl.h:261
#define assume(x)
Definition: mod2.h:405
size_t myfread(void *ptr, size_t size, size_t nmemb, FILE *stream)
Definition: feFopen.cc:194
int status int void * buf
Definition: si_signals.h:58
procinfodata data
Definition: subexpr.h:62
FILE * feFopen(const char *path, const char *mode, char *where, short useWerror, short path_only)
Definition: feFopen.cc:46
int i
Definition: cfEzgcd.cc:123
char * iiProcName(char *buf, char &ct, char *&e)
Definition: iplib.cc:113
#define NULL
Definition: omList.c:10
CanonicalForm head(const CanonicalForm &f)
#define SEEK_SET
Definition: mod2.h:125
int offset
Definition: libparse.cc:1091
BOOLEAN iiGetLibStatus ( char *  lib)

Definition at line 83 of file iplib.cc.

84 {
85  idhdl hl;
86 
87  char *plib = iiConvName(lib);
88  hl = basePack->idroot->get(plib,0);
89  omFree(plib);
90  if((hl==NULL) ||(IDTYP(hl)!=PACKAGE_CMD))
91  {
92  return FALSE;
93  }
94  return (strcmp(lib,IDPACKAGE(hl)->libname)==0);
95 }
#define FALSE
Definition: auxiliary.h:140
Definition: idrec.h:34
#define IDPACKAGE(a)
Definition: ipid.h:138
#define IDTYP(a)
Definition: ipid.h:118
#define omFree(addr)
Definition: omAllocDecl.h:261
#define NULL
Definition: omList.c:10
package basePack
Definition: ipid.cc:63
char * iiConvName(const char *libname)
Definition: iplib.cc:1262
procinfo* iiInitSingularProcinfo ( procinfov  pi,
const char *  libname,
const char *  procname,
int  line,
long  pos,
BOOLEAN  pstatic 
)

Definition at line 966 of file iplib.cc.

968 {
969  pi->libname = omStrDup(libname);
970  pi->procname = omStrDup(procname);
971  pi->language = LANG_SINGULAR;
972  pi->ref = 1;
973  pi->pack = NULL;
974  pi->is_static = pstatic;
975  pi->data.s.proc_start = pos;
976  pi->data.s.def_end = 0L;
977  pi->data.s.help_start = 0L;
978  pi->data.s.help_end = 0L;
979  pi->data.s.body_start = 0L;
980  pi->data.s.body_end = 0L;
981  pi->data.s.example_start = 0L;
982  pi->data.s.proc_lineno = line;
983  pi->data.s.body_lineno = 0;
984  pi->data.s.example_lineno = 0;
985  pi->data.s.body = NULL;
986  pi->data.s.help_chksum = 0;
987  return(pi);
988 }
package pack
Definition: subexpr.h:57
language_defs language
Definition: subexpr.h:58
short ref
Definition: subexpr.h:59
char * procname
Definition: subexpr.h:56
char * libname
Definition: subexpr.h:55
procinfodata data
Definition: subexpr.h:62
char is_static
Definition: subexpr.h:60
#define NULL
Definition: omList.c:10
#define omStrDup(s)
Definition: omAllocDecl.h:263
BOOLEAN iiLibCmd ( char *  newlib,
BOOLEAN  autoexport,
BOOLEAN  tellerror,
BOOLEAN  force 
)

Definition at line 801 of file iplib.cc.

802 {
803  char libnamebuf[128];
804  // procinfov pi;
805  // idhdl h;
806  idhdl pl;
807  // idhdl hl;
808  // long pos = 0L;
809  char *plib = iiConvName(newlib);
810  FILE * fp = feFopen( newlib, "r", libnamebuf, tellerror );
811  // int lines = 1;
812  BOOLEAN LoadResult = TRUE;
813 
814  if (fp==NULL)
815  {
816  return TRUE;
817  }
818  pl = basePack->idroot->get(plib,0);
819  if (pl==NULL)
820  {
821  pl = enterid( plib,0, PACKAGE_CMD,
822  &(basePack->idroot), TRUE );
823  IDPACKAGE(pl)->language = LANG_SINGULAR;
824  IDPACKAGE(pl)->libname=omStrDup(newlib);
825  }
826  else
827  {
828  if(IDTYP(pl)!=PACKAGE_CMD)
829  {
830  WarnS("not of type package.");
831  fclose(fp);
832  return TRUE;
833  }
834  if (!force) return FALSE;
835  }
836  LoadResult = iiLoadLIB(fp, libnamebuf, newlib, pl, autoexport, tellerror);
837  omFree((ADDRESS)newlib);
838 
839  if(!LoadResult) IDPACKAGE(pl)->loaded = TRUE;
840  omFree((ADDRESS)plib);
841 
842  return LoadResult;
843 }
CanonicalForm fp
Definition: cfModGcd.cc:4043
#define FALSE
Definition: auxiliary.h:140
#define TRUE
Definition: auxiliary.h:144
void * ADDRESS
Definition: auxiliary.h:161
#define WarnS
Definition: emacs.cc:81
Definition: idrec.h:34
#define IDPACKAGE(a)
Definition: ipid.h:138
#define IDTYP(a)
Definition: ipid.h:118
idhdl enterid(const char *s, int lev, int t, idhdl *root, BOOLEAN init, BOOLEAN search)
Definition: ipid.cc:256
#define omFree(addr)
Definition: omAllocDecl.h:261
FILE * feFopen(const char *path, const char *mode, char *where, short useWerror, short path_only)
Definition: feFopen.cc:46
#define NULL
Definition: omList.c:10
package basePack
Definition: ipid.cc:63
char libnamebuf[128]
Definition: libparse.cc:1096
BOOLEAN iiLoadLIB(FILE *fp, const char *libnamebuf, const char *newlib, idhdl pl, BOOLEAN autoexport, BOOLEAN tellerror)
Definition: iplib.cc:890
char * iiConvName(const char *libname)
Definition: iplib.cc:1262
int BOOLEAN
Definition: auxiliary.h:131
#define omStrDup(s)
Definition: omAllocDecl.h:263
BOOLEAN iiLoadLIB ( FILE *  fp,
const char *  libnamebuf,
const char *  newlib,
idhdl  pl,
BOOLEAN  autoexport,
BOOLEAN  tellerror 
)

Definition at line 890 of file iplib.cc.

892 {
893  extern FILE *yylpin;
894  libstackv ls_start = library_stack;
895  lib_style_types lib_style;
896 
897  yylpin = fp;
898  #if YYLPDEBUG > 1
899  print_init();
900  #endif
901  extern int lpverbose;
902  if (BVERBOSE(V_DEBUG_LIB)) lpverbose=1;
903  else lpverbose=0;
904  // yylplex sets also text_buffer
905  if (text_buffer!=NULL) *text_buffer='\0';
906  yylplex(newlib, libnamebuf, &lib_style, pl, autoexport);
907  if(yylp_errno)
908  {
909  Werror("Library %s: ERROR occured: in line %d, %d.", newlib, yylplineno,
910  current_pos(0));
912  {
916  }
917  else
919  Werror("Cannot load library,... aborting.");
920  reinit_yylp();
921  fclose( yylpin );
923  return TRUE;
924  }
925  if (BVERBOSE(V_LOAD_LIB))
926  Print( "// ** loaded %s %s\n", libnamebuf, text_buffer);
927  if( (lib_style == OLD_LIBSTYLE) && (BVERBOSE(V_LOAD_LIB)))
928  {
929  Warn( "library %s has old format. This format is still accepted,", newlib);
930  Warn( "but for functionality you may wish to change to the new");
931  Warn( "format. Please refer to the manual for further information.");
932  }
933  reinit_yylp();
934  fclose( yylpin );
935  fp = NULL;
936  iiRunInit(IDPACKAGE(pl));
937 
938  {
939  libstackv ls;
940  for(ls = library_stack; (ls != NULL) && (ls != ls_start); )
941  {
942  if(ls->to_be_done)
943  {
944  ls->to_be_done=FALSE;
945  iiLibCmd(ls->get(),autoexport,tellerror,FALSE);
946  ls = ls->pop(newlib);
947  }
948  }
949 #if 0
950  PrintS("--------------------\n");
951  for(ls = library_stack; ls != NULL; ls = ls->next)
952  {
953  Print("%s: LIB-stack:(%d), %s %s\n", newlib, ls->cnt, ls->get(),
954  ls->to_be_done ? "not loaded" : "loaded");
955  }
956  PrintS("--------------------\n");
957 #endif
958  }
959 
960  if(fp != NULL) fclose(fp);
961  return FALSE;
962 }
int cnt
Definition: subexpr.h:167
#define Print
Definition: emacs.cc:83
CanonicalForm fp
Definition: cfModGcd.cc:4043
int yylplex(const char *libname, const char *libfile, lib_style_types *lib_style, idhdl pl, BOOLEAN autoexport=FALSE, lp_modes=LOAD_LIB)
libstackv next
Definition: subexpr.h:164
#define FALSE
Definition: auxiliary.h:140
static void iiRunInit(package p)
Definition: iplib.cc:874
#define V_LOAD_LIB
Definition: options.h:45
#define IDROOT
Definition: ipid.h:20
BOOLEAN to_be_done
Definition: subexpr.h:166
#define TRUE
Definition: auxiliary.h:144
void print_init()
Definition: libparse.cc:3483
void * ADDRESS
Definition: auxiliary.h:161
char * get()
Definition: subexpr.h:170
#define V_DEBUG_LIB
Definition: options.h:46
libstackv pop(const char *p)
Definition: iplib.cc:1351
BOOLEAN iiLibCmd(char *newlib, BOOLEAN autoexport, BOOLEAN tellerror, BOOLEAN force)
Definition: iplib.cc:801
#define IDPACKAGE(a)
Definition: ipid.h:138
#define YYLP_BAD_CHAR
Definition: libparse.h:93
int lpverbose
Definition: libparse.cc:1104
int yylp_errno
Definition: libparse.cc:1128
#define omFree(addr)
Definition: omAllocDecl.h:261
char * yylp_errlist[]
Definition: libparse.cc:1112
void PrintS(const char *s)
Definition: reporter.cc:294
#define BVERBOSE(a)
Definition: options.h:33
#define NULL
Definition: omList.c:10
char * text_buffer
Definition: libparse.cc:1097
int current_pos(int i=0)
Definition: libparse.cc:3347
lib_style_types
Definition: libparse.h:9
char libnamebuf[128]
Definition: libparse.cc:1096
static void iiCleanProcs(idhdl &root)
Definition: iplib.cc:845
void Werror(const char *fmt,...)
Definition: reporter.cc:199
libstackv library_stack
Definition: iplib.cc:74
int yylplineno
Definition: libparse.cc:1102
#define Warn
Definition: emacs.cc:80
void reinit_yylp()
Definition: libparse.cc:3377
BOOLEAN iiLocateLib ( const char *  lib,
char *  where 
)

Definition at line 787 of file iplib.cc.

788 {
789  char *plib = iiConvName(lib);
790  idhdl pl = basePack->idroot->get(plib,0);
791  if( (pl!=NULL) && (IDTYP(pl)==PACKAGE_CMD) &&
792  (IDPACKAGE(pl)->language == LANG_SINGULAR))
793  {
794  strncpy(where,IDPACKAGE(pl)->libname,127);
795  return TRUE;
796  }
797  else
798  return FALSE;;
799 }
#define FALSE
Definition: auxiliary.h:140
#define TRUE
Definition: auxiliary.h:144
Definition: idrec.h:34
#define IDPACKAGE(a)
Definition: ipid.h:138
#define IDTYP(a)
Definition: ipid.h:118
#define NULL
Definition: omList.c:10
package basePack
Definition: ipid.cc:63
char * iiConvName(const char *libname)
Definition: iplib.cc:1262
BOOLEAN iiMake_proc ( idhdl  pn,
package  pack,
sleftv sl 
)

Definition at line 563 of file iplib.cc.

564 {
565  int err;
566  procinfov pi = IDPROC(pn);
567  if(pi->is_static && myynest==0)
568  {
569  Werror("'%s::%s()' is a local procedure and cannot be accessed by an user.",
570  pi->libname, pi->procname);
571  return TRUE;
572  }
573  iiCheckNest();
574 #ifdef USE_IILOCALRING
576  //Print("currRing(%d):%s(%x) in %s\n",myynest,IDID(currRingHdl),currRing,IDID(pn));
577 #endif
578  iiRETURNEXPR.Init();
579  procstack->push(pi->procname);
581  || (pi->trace_flag&TRACE_SHOW_PROC))
582  {
584  Print("entering%-*.*s %s (level %d)\n",myynest*2,myynest*2," ",IDID(pn),myynest);
585  }
586 #ifdef RDEBUG
588 #endif
589  switch (pi->language)
590  {
591  default:
592  case LANG_NONE:
593  WerrorS("undefined proc");
594  err=TRUE;
595  break;
596 
597  case LANG_SINGULAR:
598  if ((pi->pack!=NULL)&&(currPack!=pi->pack))
599  {
600  currPack=pi->pack;
603  //Print("set pack=%s\n",IDID(currPackHdl));
604  }
605  else if ((pack!=NULL)&&(currPack!=pack))
606  {
607  currPack=pack;
610  //Print("set pack=%s\n",IDID(currPackHdl));
611  }
612  err=iiPStart(pn,sl);
613  break;
614  case LANG_C:
616  err = (pi->data.o.function)(res, sl);
617  memcpy(&iiRETURNEXPR,res,sizeof(iiRETURNEXPR));
619  break;
620  }
621  if ((traceit&TRACE_SHOW_PROC)
622  || (pi->trace_flag&TRACE_SHOW_PROC))
623  {
624  if (traceit&TRACE_SHOW_LINENO) PrintLn();
625  Print("leaving %-*.*s %s (level %d)\n",myynest*2,myynest*2," ",IDID(pn),myynest);
626  }
627  //const char *n="NULL";
628  //if (currRingHdl!=NULL) n=IDID(currRingHdl);
629  //Print("currRing(%d):%s(%x) after %s\n",myynest,n,currRing,IDID(pn));
630 #ifdef RDEBUG
631  if (traceit&TRACE_SHOW_RINGS) iiShowLevRings();
632 #endif
633  if (err)
634  {
636  //iiRETURNEXPR.Init(); //done by CleanUp
637  }
638  if (iiCurrArgs!=NULL)
639  {
640  if (!err) Warn("too many arguments for %s",IDID(pn));
641  iiCurrArgs->CleanUp();
644  }
645  procstack->pop();
646  if (err)
647  return TRUE;
648  return FALSE;
649 }
#define TRACE_SHOW_LINENO
Definition: reporter.h:26
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
#define TRACE_SHOW_RINGS
Definition: reporter.h:28
void PrintLn()
Definition: reporter.cc:322
#define Print
Definition: emacs.cc:83
package pack
Definition: subexpr.h:57
idhdl currPackHdl
Definition: ipid.cc:60
#define IDID(a)
Definition: ipid.h:121
#define FALSE
Definition: auxiliary.h:140
sleftv iiRETURNEXPR
Definition: iplib.cc:517
language_defs language
Definition: subexpr.h:58
proclevel * procstack
Definition: ipid.cc:57
static void iiShowLevRings()
Definition: iplib.cc:521
#define TRUE
Definition: auxiliary.h:144
void Init()
Definition: subexpr.h:108
void * ADDRESS
Definition: auxiliary.h:161
sleftv * leftv
Definition: structs.h:60
void WerrorS(const char *s)
Definition: feFopen.cc:23
int traceit
Definition: febase.cc:47
static void iiCheckNest()
Definition: iplib.cc:550
char * procname
Definition: subexpr.h:56
poly res
Definition: myNF.cc:322
Definition: subexpr.h:20
int myynest
Definition: febase.cc:46
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
char * libname
Definition: subexpr.h:55
procinfodata data
Definition: subexpr.h:62
omBin sleftv_bin
Definition: subexpr.cc:50
char is_static
Definition: subexpr.h:60
#define omAlloc0Bin(bin)
Definition: omAllocDecl.h:206
#define IDPROC(a)
Definition: ipid.h:139
#define pi
Definition: libparse.cc:1143
ring * iiLocalRing
Definition: iplib.cc:515
#define NULL
Definition: omList.c:10
BOOLEAN iiPStart(idhdl pn, sleftv *v)
Definition: iplib.cc:372
package currPack
Definition: ipid.cc:62
leftv iiCurrArgs
Definition: ipshell.cc:82
void CleanUp(ring r=currRing)
Definition: subexpr.cc:301
#define TRACE_SHOW_PROC
Definition: reporter.h:25
idhdl packFindHdl(package r)
Definition: ipid.cc:729
void iiCheckPack(package &p)
Definition: ipshell.cc:1629
#define omFreeBin(addr, bin)
Definition: omAllocDecl.h:259
void push(char *)
Definition: ipid.cc:699
void pop()
Definition: ipid.cc:711
char trace_flag
Definition: subexpr.h:61
void Werror(const char *fmt,...)
Definition: reporter.cc:199
#define Warn
Definition: emacs.cc:80
char* iiProcArgs ( char *  e,
BOOLEAN  withParenth 
)

Definition at line 127 of file iplib.cc.

128 {
129  while ((*e==' ') || (*e=='\t') || (*e=='(')) e++;
130  if (*e<' ')
131  {
132  if (withParenth)
133  {
134  // no argument list, allow list #
135  return omStrDup("parameter list #;");
136  }
137  else
138  {
139  // empty list
140  return omStrDup("");
141  }
142  }
143  BOOLEAN in_args;
144  BOOLEAN args_found;
145  char *s;
146  char *argstr=(char *)omAlloc(127); // see ../omalloc/omTables.inc
147  int argstrlen=127;
148  *argstr='\0';
149  int par=0;
150  do
151  {
152  args_found=FALSE;
153  s=e; // set s to the starting point of the arg
154  // and search for the end
155  while(*s==' ') s++; e=s; // skip leading paces
156  while ((*e!=',')
157  &&((par!=0) || (*e!=')'))
158  &&(*e!='\0'))
159  {
160  if (*e=='(') par++;
161  else if (*e==')') par--;
162  args_found=args_found || (*e>' ');
163  e++;
164  }
165  in_args=(*e==',');
166  if (args_found)
167  {
168  *e='\0';
169  // check for space:
170  if ((int)strlen(argstr)+12 /* parameter + ;*/ +(int)strlen(s)>= argstrlen)
171  {
172  argstrlen*=2;
173  char *a=(char *)omAlloc( argstrlen);
174  strcpy(a,argstr);
175  omFree((ADDRESS)argstr);
176  argstr=a;
177  }
178  // copy the result to argstr
179  if(strncmp(s,"alias ",6)!=0)
180  {
181  strcat(argstr,"parameter ");
182  }
183  strcat(argstr,s);
184  strcat(argstr,"; ");
185  e++; // e was pointing to ','
186  }
187  } while (in_args);
188  return argstr;
189 }
const const intvec const intvec const ring _currRing const const intvec const intvec const ring _currRing int
Definition: gb_hack.h:53
const CanonicalForm int s
Definition: facAbsFact.cc:55
const poly a
Definition: syzextra.cc:212
#define FALSE
Definition: auxiliary.h:140
void * ADDRESS
Definition: auxiliary.h:161
#define omAlloc(size)
Definition: omAllocDecl.h:210
#define omFree(addr)
Definition: omAllocDecl.h:261
int BOOLEAN
Definition: auxiliary.h:131
#define omStrDup(s)
Definition: omAllocDecl.h:263
char* iiProcName ( char *  buf,
char &  ct,
char *&  e 
)

Definition at line 113 of file iplib.cc.

114 {
115  char *s=buf+5;
116  while (*s==' ') s++;
117  e=s+1;
118  while ((*e>' ') && (*e!='(')) e++;
119  ct=*e;
120  *e='\0';
121  return s;
122 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
int status int void * buf
Definition: si_signals.h:58
BOOLEAN iiPStart ( idhdl  pn,
sleftv v 
)

Definition at line 372 of file iplib.cc.

373 {
374  procinfov pi=NULL;
375  int old_echo=si_echo;
376  BOOLEAN err=FALSE;
377  char save_flags=0;
378 
379  /* init febase ======================================== */
380  /* we do not enter this case if filename != NULL !! */
381  if (pn!=NULL)
382  {
383  pi = IDPROC(pn);
384  if(pi!=NULL)
385  {
386  save_flags=pi->trace_flag;
387  if( pi->data.s.body==NULL )
388  {
389  iiGetLibProcBuffer(pi);
390  if (pi->data.s.body==NULL) return TRUE;
391  }
392 // omUpdateInfo();
393 // int m=om_Info.UsedBytes;
394 // Print("proc %s, mem=%d\n",IDID(pn),m);
395  }
396  }
397  else return TRUE;
398  /* generate argument list ======================================*/
399  if (v!=NULL)
400  {
402  memcpy(iiCurrArgs,v,sizeof(sleftv));
403  memset(v,0,sizeof(sleftv));
404  }
405  else
406  {
408  }
409  iiCurrProc=pn;
410  /* start interpreter ======================================*/
411  myynest++;
412  if (myynest > SI_MAX_NEST)
413  {
414  WerrorS("nesting too deep");
415  err=TRUE;
416  }
417  else
418  {
419  err=iiAllStart(pi,pi->data.s.body,BT_proc,pi->data.s.body_lineno-(v!=NULL));
420 
421 #ifdef USE_IILOCALRING
422 #if 0
423  if(procstack->cRing != iiLocalRing[myynest]) Print("iiMake_proc: 1 ring not saved procs:%x, iiLocal:%x\n",procstack->cRing, iiLocalRing[myynest]);
424 #endif
425  if (iiLocalRing[myynest-1] != currRing)
426  {
428  {
429  //idhdl hn;
430  const char *n;
431  const char *o;
432  idhdl nh=NULL, oh=NULL;
433  if (iiLocalRing[myynest-1]!=NULL)
434  oh=rFindHdl(iiLocalRing[myynest-1],NULL);
435  if (oh!=NULL) o=oh->id;
436  else o="none";
437  if (currRing!=NULL)
438  nh=rFindHdl(currRing,NULL);
439  if (nh!=NULL) n=nh->id;
440  else n="none";
441  Werror("ring change during procedure call: %s -> %s (level %d)",o,n,myynest);
443  err=TRUE;
444  }
445  currRing=iiLocalRing[myynest-1];
446  }
447  if ((currRing==NULL)
448  && (currRingHdl!=NULL))
450  else
451  if ((currRing!=NULL) &&
453  ||(IDLEV(currRingHdl)>=myynest-1)))
454  {
456  iiLocalRing[myynest-1]=NULL;
457  }
458 #else /* USE_IILOCALRING */
459  if (procstack->cRing != currRing)
460  {
461  //if (procstack->cRingHdl!=NULL)
462  //Print("procstack:%s,",IDID(procstack->cRingHdl));
463  //if (currRingHdl!=NULL)
464  //Print(" curr:%s\n",IDID(currRingHdl));
465  //Print("pr:%x, curr: %x\n",procstack->cRing,currRing);
467  {
468  //idhdl hn;
469  const char *n;
470  const char *o;
471  if (procstack->cRing!=NULL)
472  {
473  //PrintS("reset ring\n");
475  o=IDID(procstack->cRingHdl);
478  }
479  else o="none";
480  if (currRing!=NULL) n=IDID(currRingHdl);
481  else n="none";
482  if (currRing==NULL)
483  {
484  Werror("ring change during procedure call: %s -> %s (level %d)",o,n,myynest);
486  err=TRUE;
487  }
488  }
489  if (procstack->cRingHdl!=NULL)
490  {
492  }
493  else
495  }
496 #endif /* USE_IILOCALRING */
497  //Print("kill locals for %s (level %d)\n",IDID(pn),myynest);
498  killlocals(myynest);
499 #ifndef SING_NDEBUG
500  checkall();
501 #endif
502  //Print("end kill locals for %s (%d)\n",IDID(pn),myynest);
503  }
504  myynest--;
505  si_echo=old_echo;
506  if (pi!=NULL)
507  pi->trace_flag=save_flags;
508 // omUpdateInfo();
509 // int m=om_Info.UsedBytes;
510 // Print("exit %s, mem=%d\n",IDID(pn),m);
511  return err;
512 }
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
#define Print
Definition: emacs.cc:83
#define IDID(a)
Definition: ipid.h:121
#define FALSE
Definition: auxiliary.h:140
sleftv iiRETURNEXPR
Definition: iplib.cc:517
proclevel * procstack
Definition: ipid.cc:57
const CanonicalForm CFMap CFMap int &both_non_zero int n
Definition: cfEzgcd.cc:52
#define TRUE
Definition: auxiliary.h:144
sleftv * leftv
Definition: structs.h:60
void WerrorS(const char *s)
Definition: feFopen.cc:23
idhdl cRingHdl
Definition: ipid.h:60
Definition: idrec.h:34
idhdl iiCurrProc
Definition: ipshell.cc:83
#define SI_MAX_NEST
Definition: iplib.cc:32
int myynest
Definition: febase.cc:46
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
BOOLEAN RingDependend()
Definition: subexpr.cc:369
void checkall()
Definition: misc_ip.cc:1016
void killlocals(int v)
Definition: ipshell.cc:382
procinfodata data
Definition: subexpr.h:62
idhdl currRingHdl
Definition: ipid.cc:64
omBin sleftv_bin
Definition: subexpr.cc:50
idhdl rFindHdl(ring r, idhdl n)
Definition: ipshell.cc:1690
#define IDLEV(a)
Definition: ipid.h:120
BOOLEAN iiAllStart(procinfov pi, char *p, feBufferTypes t, int l)
Definition: iplib.cc:312
#define IDPROC(a)
Definition: ipid.h:139
#define pi
Definition: libparse.cc:1143
ring * iiLocalRing
Definition: iplib.cc:515
#define NULL
Definition: omList.c:10
#define IDRING(a)
Definition: ipid.h:126
ring cRing
Definition: ipid.h:61
leftv iiCurrArgs
Definition: ipshell.cc:82
void CleanUp(ring r=currRing)
Definition: subexpr.cc:301
const char * id
Definition: idrec.h:39
void rSetHdl(idhdl h)
Definition: ipshell.cc:4821
char * iiGetLibProcBuffer(procinfo *pi, int part)
Definition: iplib.cc:200
int BOOLEAN
Definition: auxiliary.h:131
char trace_flag
Definition: subexpr.h:61
void Werror(const char *fmt,...)
Definition: reporter.cc:199
int si_echo
Definition: febase.cc:41
static void iiRunInit ( package  p)
static

Definition at line 874 of file iplib.cc.

875 {
876  idhdl h=p->idroot->get("mod_init",0);
877  if (h==NULL) return;
878  if (IDTYP(h)==PROC_CMD)
879  {
880  int save=yylineno;
881  myynest++;
882  // procinfo *pi=(procinfo*)IDDATA(h);
883  //PrintS("mod_init found\n");
884  iiMake_proc(h,p,NULL);
885  myynest--;
886  yylineno=save;
887  }
888 }
int yylineno
Definition: febase.cc:45
return P p
Definition: myNF.cc:203
Definition: idrec.h:34
int myynest
Definition: febase.cc:46
#define IDTYP(a)
Definition: ipid.h:118
BOOLEAN iiMake_proc(idhdl pn, package pack, sleftv *sl)
Definition: iplib.cc:563
#define NULL
Definition: omList.c:10
static Poly * h
Definition: janet.cc:978
static void iiShowLevRings ( )
static

Definition at line 521 of file iplib.cc.

522 {
523  int i;
524 #ifdef USE_IILOCALRING
525  for (i=0;i<=myynest;i++)
526  {
527  Print("lev %d:",i);
528  if (iiLocalRing[i]==NULL) PrintS("NULL");
529  else Print("%lx",(long)iiLocalRing[i]);
530  PrintLn();
531  }
532 #endif
533 #if 0
534  i=myynest;
536  while (p!=NULL)
537  {
538  Print("lev %d:",i);
539  if (p->cRingHdl==NULL) PrintS("NULL");
540  else Print("%s",IDID(p->cRingHdl));
541  PrintLn();
542  p=p->next;
543  }
544 #endif
545  if (currRing==NULL) PrintS("curr:NULL\n");
546  else Print ("curr:%lx\n",(long)currRing);
547 }
void PrintLn()
Definition: reporter.cc:322
#define Print
Definition: emacs.cc:83
#define IDID(a)
Definition: ipid.h:121
return P p
Definition: myNF.cc:203
proclevel * procstack
Definition: ipid.cc:57
idhdl cRingHdl
Definition: ipid.h:60
int myynest
Definition: febase.cc:46
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
Definition: ipid.h:56
proclevel * next
Definition: ipid.h:59
int i
Definition: cfEzgcd.cc:123
void PrintS(const char *s)
Definition: reporter.cc:294
ring * iiLocalRing
Definition: iplib.cc:515
#define NULL
Definition: omList.c:10
BOOLEAN iiTryLoadLib ( leftv  v,
const char *  id 
)

Definition at line 741 of file iplib.cc.

742 {
743  BOOLEAN LoadResult = TRUE;
744  char libnamebuf[128];
745  char *libname = (char *)omAlloc(strlen(id)+5);
746  const char *suffix[] = { "", ".lib", ".so", ".sl", NULL };
747  int i = 0;
748  // FILE *fp;
749  // package pack;
750  // idhdl packhdl;
751  lib_types LT;
752  for(i=0; suffix[i] != NULL; i++)
753  {
754  sprintf(libname, "%s%s", id, suffix[i]);
755  *libname = mytolower(*libname);
756  if((LT = type_of_LIB(libname, libnamebuf)) > LT_NOTFOUND)
757  {
758  char *s=omStrDup(libname);
759  char libnamebuf[256];
760 
761  if (LT==LT_SINGULAR)
762  LoadResult = iiLibCmd(s, FALSE, FALSE,TRUE);
763  #ifdef HAVE_DYNAMIC_LOADING
764  else if ((LT==LT_ELF) || (LT==LT_HPUX))
765  LoadResult = load_modules(s,libnamebuf,FALSE);
766  #endif
767  else if (LT==LT_BUILTIN)
768  {
769  LoadResult=load_builtin(s,FALSE, iiGetBuiltinModInit(s));
770  }
771  if(!LoadResult )
772  {
773  v->name = iiConvName(libname);
774  break;
775  }
776  }
777  }
778  omFree(libname);
779  return LoadResult;
780 }
BOOLEAN load_builtin(const char *newlib, BOOLEAN autoexport, SModulFunc_t init)
Definition: iplib.cc:1130
const CanonicalForm int s
Definition: facAbsFact.cc:55
#define FALSE
Definition: auxiliary.h:140
Definition: mod_raw.h:16
#define TRUE
Definition: auxiliary.h:144
lib_types type_of_LIB(const char *newlib, char *libnamebuf)
Definition: mod_lib.cc:23
#define omAlloc(size)
Definition: omAllocDecl.h:210
BOOLEAN iiLibCmd(char *newlib, BOOLEAN autoexport, BOOLEAN tellerror, BOOLEAN force)
Definition: iplib.cc:801
const char * name
Definition: subexpr.h:88
#define omFree(addr)
Definition: omAllocDecl.h:261
int i
Definition: cfEzgcd.cc:123
lib_types
Definition: mod_raw.h:16
char mytolower(char c)
Definition: iplib.cc:1249
#define NULL
Definition: omList.c:10
SModulFunc_t iiGetBuiltinModInit(const char *libname)
Definition: iplib.cc:728
char libnamebuf[128]
Definition: libparse.cc:1096
char * iiConvName(const char *libname)
Definition: iplib.cc:1262
int BOOLEAN
Definition: auxiliary.h:131
BOOLEAN load_modules(const char *newlib, char *fullname, BOOLEAN autoexport)
Definition: iplib.cc:1038
#define omStrDup(s)
Definition: omAllocDecl.h:263
BOOLEAN load_builtin ( const char *  newlib,
BOOLEAN  autoexport,
SModulFunc_t  init 
)

Definition at line 1130 of file iplib.cc.

1131 {
1132  int iiAddCproc(const char *libname, const char *procname, BOOLEAN pstatic,
1133  BOOLEAN(*func)(leftv res, leftv v));
1134 /*
1135  typedef int (*fktn_t)(int(*iiAddCproc)(const char *libname, const char *procname,
1136  BOOLEAN pstatic,
1137  BOOLEAN(*func)(leftv res, leftv v)));
1138 */
1139  // SModulFunc_t fktn;
1140  idhdl pl;
1141  char *plib = iiConvName(newlib);
1142  // BOOLEAN RET=TRUE;
1143  // int token;
1144 
1145  pl = IDROOT->get(plib,0);
1146  if (pl!=NULL)
1147  {
1148  if (BVERBOSE(V_LOAD_LIB)) Warn( "(builtin) %s already loaded", newlib);
1149  omFree(plib);
1150  return FALSE;
1151  }
1152 
1153  pl = enterid( plib,0, PACKAGE_CMD, &IDROOT,
1154  TRUE );
1155  IDPACKAGE(pl)->language = LANG_C;
1156  IDPACKAGE(pl)->libname=omStrDup(newlib);
1157 
1158  IDPACKAGE(pl)->handle=(void *)NULL;
1159  SModulFunctions sModulFunctions;
1160 
1161  package s=currPack;
1162  currPack=IDPACKAGE(pl);
1163  if( init!= NULL)
1164  {
1165  sModulFunctions.iiArithAddCmd = iiArithAddCmd;
1166  if (autoexport) sModulFunctions.iiAddCproc = iiAddCprocTop;
1167  else sModulFunctions.iiAddCproc = iiAddCproc;
1168  (*init)(&sModulFunctions);
1169  }
1170  if (BVERBOSE(V_LOAD_LIB)) Print( "// ** loaded (builtin) %s \n", newlib);
1171  currPack->loaded=1;
1172  currPack=s;
1173 
1174  return FALSE;
1175 }
int iiAddCprocTop(const char *libname, const char *procname, BOOLEAN pstatic, BOOLEAN(*func)(leftv res, leftv v))
Definition: iplib.cc:1025
const CanonicalForm int s
Definition: facAbsFact.cc:55
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
#define Print
Definition: emacs.cc:83
#define FALSE
Definition: auxiliary.h:140
#define V_LOAD_LIB
Definition: options.h:45
#define IDROOT
Definition: ipid.h:20
#define TRUE
Definition: auxiliary.h:144
Definition: idrec.h:34
poly res
Definition: myNF.cc:322
Definition: subexpr.h:20
#define IDPACKAGE(a)
Definition: ipid.h:138
idhdl enterid(const char *s, int lev, int t, idhdl *root, BOOLEAN init, BOOLEAN search)
Definition: ipid.cc:256
#define omFree(addr)
Definition: omAllocDecl.h:261
#define BVERBOSE(a)
Definition: options.h:33
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
#define NULL
Definition: omList.c:10
package currPack
Definition: ipid.cc:62
int(* iiAddCproc)(const char *libname, const char *procname, BOOLEAN pstatic, BOOLEAN(*func)(leftv res, leftv v))
Definition: ipid.h:73
int iiAddCproc(const char *libname, const char *procname, BOOLEAN pstatic, BOOLEAN(*func)(leftv res, leftv v))
Definition: iplib.cc:991
char * iiConvName(const char *libname)
Definition: iplib.cc:1262
int BOOLEAN
Definition: auxiliary.h:131
int(* iiArithAddCmd)(const char *szName, short nAlias, short nTokval, short nToktype, short nPos)
Definition: ipid.h:75
#define Warn
Definition: emacs.cc:80
#define omStrDup(s)
Definition: omAllocDecl.h:263
int iiArithAddCmd(const char *szName, short nAlias, short nTokval, short nToktype, short nPos)
Definition: iparith.cc:9028
BOOLEAN load_modules ( const char *  newlib,
char *  fullname,
BOOLEAN  autoexport 
)

Definition at line 1038 of file iplib.cc.

1039 {
1040 #ifdef HAVE_STATIC
1041  WerrorS("mod_init: static version can not load modules");
1042  return TRUE;
1043 #else
1044 /*
1045  typedef int (*fktn_t)(int(*iiAddCproc)(const char *libname, const char *procname,
1046  BOOLEAN pstatic,
1047  BOOLEAN(*func)(leftv res, leftv v)));
1048 */
1049  SModulFunc_t fktn;
1050  idhdl pl;
1051  char *plib = iiConvName(newlib);
1052  BOOLEAN RET=TRUE;
1053  int token;
1054  char FullName[256];
1055 
1056  memset(FullName,0,256);
1057 
1058  if( *fullname != '/' && *fullname != '.' )
1059  sprintf(FullName, "./%s", newlib);
1060  else strncpy(FullName, fullname,255);
1061 
1062 
1063  if(IsCmd(plib, token))
1064  {
1065  Werror("'%s' is resered identifier\n", plib);
1066  goto load_modules_end;
1067  }
1068  pl = basePack->idroot->get(plib,0); /* packages only in top level
1069  (see enterid) */
1070  if (pl==NULL)
1071  {
1072  pl = enterid( plib,0, PACKAGE_CMD, &IDROOT,
1073  TRUE );
1074  IDPACKAGE(pl)->language = LANG_C;
1075  IDPACKAGE(pl)->libname=omStrDup(newlib);
1076  }
1077  else
1078  {
1079  if(IDTYP(pl)!=PACKAGE_CMD)
1080  {
1081  Warn("not of type package.");
1082  goto load_modules_end;
1083  }
1084  }
1085  if (dynl_check_opened(FullName))
1086  {
1087  if (BVERBOSE(V_LOAD_LIB)) Warn( "%s already loaded", fullname);
1088  return FALSE;
1089  }
1090  if((IDPACKAGE(pl)->handle=dynl_open(FullName))==(void *)NULL)
1091  {
1092  Werror("dynl_open failed:%s", dynl_error());
1093  Werror("%s not found", newlib);
1094  goto load_modules_end;
1095  }
1096  else
1097  {
1098  SModulFunctions sModulFunctions;
1099 
1100  package s=currPack;
1101  currPack=IDPACKAGE(pl);
1102  fktn = (SModulFunc_t)dynl_sym(IDPACKAGE(pl)->handle, "mod_init");
1103  if( fktn!= NULL)
1104  {
1105  sModulFunctions.iiArithAddCmd = iiArithAddCmd;
1106  if (autoexport) sModulFunctions.iiAddCproc = iiAddCprocTop;
1107  else sModulFunctions.iiAddCproc = iiAddCproc;
1108  int ver=(*fktn)(&sModulFunctions);
1109  if (ver==MAX_TOK)
1110  {
1111  if (BVERBOSE(V_LOAD_LIB)) Print( "// ** loaded %s\n", fullname);
1112  }
1113  else
1114  {
1115  Warn("// ** loaded %s for a different version of Singular(expected: %d, got %d)",fullname,MAX_TOK,ver);
1116  }
1117  currPack->loaded=1;
1118  currPack=s;
1119  RET=FALSE;
1120  }
1121  else Werror("mod_init not found:: %s\nThis is probably not a dynamic module for Singular!\n", dynl_error());
1122  }
1123 
1124  load_modules_end:
1125  return RET;
1126 #endif /*STATIC */
1127 }
int iiAddCprocTop(const char *libname, const char *procname, BOOLEAN pstatic, BOOLEAN(*func)(leftv res, leftv v))
Definition: iplib.cc:1025
const CanonicalForm int s
Definition: facAbsFact.cc:55
#define Print
Definition: emacs.cc:83
#define FALSE
Definition: auxiliary.h:140
#define V_LOAD_LIB
Definition: options.h:45
Definition: tok.h:167
#define IDROOT
Definition: ipid.h:20
#define TRUE
Definition: auxiliary.h:144
void * dynl_sym(void *handle, const char *symbol)
Definition: mod_raw.cc:171
void WerrorS(const char *s)
Definition: feFopen.cc:23
Definition: idrec.h:34
void * dynl_open(char *filename)
Definition: mod_raw.cc:157
int dynl_check_opened(char *filename)
Definition: mod_raw.cc:150
Definition: subexpr.h:20
#define IDPACKAGE(a)
Definition: ipid.h:138
#define IDTYP(a)
Definition: ipid.h:118
idhdl enterid(const char *s, int lev, int t, idhdl *root, BOOLEAN init, BOOLEAN search)
Definition: ipid.cc:256
#define BVERBOSE(a)
Definition: options.h:33
#define NULL
Definition: omList.c:10
package basePack
Definition: ipid.cc:63
package currPack
Definition: ipid.cc:62
int(* SModulFunc_t)(SModulFunctions *)
Definition: ipid.h:84
int(* iiAddCproc)(const char *libname, const char *procname, BOOLEAN pstatic, BOOLEAN(*func)(leftv res, leftv v))
Definition: ipid.h:73
int iiAddCproc(const char *libname, const char *procname, BOOLEAN pstatic, BOOLEAN(*func)(leftv res, leftv v))
Definition: iplib.cc:991
char * iiConvName(const char *libname)
Definition: iplib.cc:1262
int BOOLEAN
Definition: auxiliary.h:131
int(* iiArithAddCmd)(const char *szName, short nAlias, short nTokval, short nToktype, short nPos)
Definition: ipid.h:75
void Werror(const char *fmt,...)
Definition: reporter.cc:199
const char * dynl_error()
Definition: mod_raw.cc:187
int IsCmd(const char *n, int &tok)
Definition: iparith.cc:8688
#define Warn
Definition: emacs.cc:80
#define omStrDup(s)
Definition: omAllocDecl.h:263
int iiArithAddCmd(const char *szName, short nAlias, short nTokval, short nToktype, short nPos)
Definition: iparith.cc:9028
void module_help_main ( const char *  newlib,
const char *  help 
)

Definition at line 1177 of file iplib.cc.

1178 {
1179  char *plib = iiConvName(newlib);
1180  idhdl pl = basePack->idroot->get(plib,0);
1181  if ((pl==NULL)||(IDTYP(pl)!=PACKAGE_CMD))
1182  Werror(">>%s<< is not a package (trying to add package help)",plib);
1183  else
1184  {
1185  package s=currPack;
1186  currPack=IDPACKAGE(pl);
1188  IDSTRING(h)=omStrDup(help);
1189  currPack=s;
1190  }
1191 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
#define FALSE
Definition: auxiliary.h:140
#define IDROOT
Definition: ipid.h:20
Definition: idrec.h:34
#define IDPACKAGE(a)
Definition: ipid.h:138
#define IDTYP(a)
Definition: ipid.h:118
idhdl enterid(const char *s, int lev, int t, idhdl *root, BOOLEAN init, BOOLEAN search)
Definition: ipid.cc:256
#define IDSTRING(a)
Definition: ipid.h:135
#define help
Definition: libparse.cc:1228
#define NULL
Definition: omList.c:10
package basePack
Definition: ipid.cc:63
package currPack
Definition: ipid.cc:62
char * iiConvName(const char *libname)
Definition: iplib.cc:1262
static Poly * h
Definition: janet.cc:978
void Werror(const char *fmt,...)
Definition: reporter.cc:199
#define omStrDup(s)
Definition: omAllocDecl.h:263
void module_help_proc ( const char *  newlib,
const char *  p,
const char *  help 
)

Definition at line 1192 of file iplib.cc.

1193 {
1194  char *plib = iiConvName(newlib);
1195  idhdl pl = basePack->idroot->get(plib,0);
1196  if ((pl==NULL)||(IDTYP(pl)!=PACKAGE_CMD))
1197  Werror(">>%s<< is not a package(trying to add help for %s)",plib,p);
1198  else
1199  {
1200  package s=currPack;
1201  currPack=IDPACKAGE(pl);
1202  char buff[256];
1203  buff[255]='\0';
1204  strncpy(buff,p,255);
1205  strncat(buff,"_help",255-strlen(p));
1207  IDSTRING(h)=omStrDup(help);
1208  currPack=s;
1209  }
1210 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
#define FALSE
Definition: auxiliary.h:140
return P p
Definition: myNF.cc:203
#define IDROOT
Definition: ipid.h:20
Definition: idrec.h:34
#define IDPACKAGE(a)
Definition: ipid.h:138
#define IDTYP(a)
Definition: ipid.h:118
idhdl enterid(const char *s, int lev, int t, idhdl *root, BOOLEAN init, BOOLEAN search)
Definition: ipid.cc:256
#define IDSTRING(a)
Definition: ipid.h:135
#define help
Definition: libparse.cc:1228
#define NULL
Definition: omList.c:10
package basePack
Definition: ipid.cc:63
package currPack
Definition: ipid.cc:62
char * iiConvName(const char *libname)
Definition: iplib.cc:1262
static Poly * h
Definition: janet.cc:978
void Werror(const char *fmt,...)
Definition: reporter.cc:199
#define omStrDup(s)
Definition: omAllocDecl.h:263
char mytolower ( char  c)

Definition at line 1249 of file iplib.cc.

1250 {
1251  if(c>=65 && c<=(65+26)) c+=32;
1252  return(c);
1253 }
char mytoupper ( char  c)

Definition at line 1243 of file iplib.cc.

1244 {
1245  if(c>=97 && c<=(97+26)) c-=32;
1246  return(c);
1247 }
void print_init ( )

Definition at line 3483 of file libparse.cc.

3484 {
3485  printf("Init=%d\n", yy_init);
3486 }
static int yy_init
Definition: libparse.cc:238
SI_FOREACH_BUILTIN ( SI_GET_BUILTIN_MOD_INIT0  )
void yylprestart ( FILE *  input_file)

Variable Documentation

ring* iiLocalRing

Definition at line 515 of file iplib.cc.

sleftv iiRETURNEXPR

Definition at line 517 of file iplib.cc.

int iiRETURNEXPR_len =0

Definition at line 518 of file iplib.cc.

libstackv library_stack

Definition at line 74 of file iplib.cc.

struct soptionStruct optionStruct[]

Definition at line 519 of file misc_ip.cc.

struct soptionStruct verboseStruct[]

Definition at line 549 of file misc_ip.cc.

char* yylp_errlist[]

Definition at line 1112 of file libparse.cc.

int yylp_errno

Definition at line 1128 of file libparse.cc.

int yylplineno

Definition at line 1102 of file libparse.cc.