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 312 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 731 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 1232 of file iplib.cc.

1233 {
1234  void* result = NULL;
1235 
1236 #if defined(HAVE_STATIC) || !defined(HAVE_DYNAMIC_LOADING)
1237  WerrorS("static version can not load function from dynamic modules");
1238 #else
1239  const char* bin_dir = feGetResource('b');
1240  if (!bin_dir) { return NULL; }
1241 
1242  char path_name[MAXPATHLEN];
1243  sprintf(path_name, "%s%s%s.%s", bin_dir, DIR_SEPP, newlib, MODULE_SUFFIX_STRING);
1244 
1245  void* openlib = dynl_open(path_name);
1246  if(!openlib)
1247  {
1248  Werror("dynl_open of %s failed:%s", path_name, dynl_error());
1249  return NULL;
1250  }
1251  result = dynl_sym(openlib, funcname);
1252  if (!result) Werror("%s: %s\n", funcname, dynl_error());
1253 #endif
1254 
1255  return result;
1256 }
#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:24
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 1003 of file iplib.cc.

1005 {
1006  procinfov pi;
1007  idhdl h;
1008 
1009  #ifndef SING_NDEBUG
1010  int dummy;
1011  if (IsCmd(procname,dummy))
1012  {
1013  Werror(">>%s< is a reserved name",procname);
1014  return 0;
1015  }
1016  #endif
1017 
1018  h = enterid(procname,0, PROC_CMD, &IDROOT, TRUE);
1019  if ( h!= NULL )
1020  {
1021  pi = IDPROC(h);
1022  pi->libname = omStrDup(libname);
1023  pi->procname = omStrDup(procname);
1024  pi->language = LANG_C;
1025  pi->ref = 1;
1026  pi->is_static = pstatic;
1027  pi->data.o.function = func;
1028  return(1);
1029  }
1030  else
1031  {
1032  PrintS("iiAddCproc: failed.\n");
1033  }
1034  return(0);
1035 }
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:259
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:8739
#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 1037 of file iplib.cc.

1039 {
1040  int r=iiAddCproc(libname,procname,pstatic,func);
1041  package s=currPack;
1043  if (r) r=iiAddCproc(libname,procname,pstatic,func);
1044  currPack=s;
1045  return r;
1046 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
const ring r
Definition: syzextra.cc:208
package basePack
Definition: ipid.cc:64
package currPack
Definition: ipid.cc:63
int iiAddCproc(const char *libname, const char *procname, BOOLEAN pstatic, BOOLEAN(*func)(leftv res, leftv v))
Definition: iplib.cc:1003
BOOLEAN iiAllStart ( procinfov  pi,
char *  p,
feBufferTypes  t,
int  l 
)

Definition at line 322 of file iplib.cc.

323 {
324  // see below:
325  BITSET save1=si_opt_1;
326  BITSET save2=si_opt_2;
327  newBuffer( omStrDup(p /*pi->data.s.body*/), t /*BT_proc*/,
328  pi, l );
329  BOOLEAN err=yyparse();
330  if (sLastPrinted.rtyp!=0)
331  {
333  }
334  // the access to optionStruct and verboseStruct do not work
335  // on x86_64-Linux for pic-code
336  if ((TEST_V_ALLWARN) &&
337  (t==BT_proc) &&
338  ((save1!=si_opt_1)||(save2!=si_opt_2)) &&
339  (pi->libname!=NULL) && (pi->libname[0]!='\0'))
340  {
341  if ((pi->libname!=NULL) && (pi->libname[0]!='\0'))
342  Warn("option changed in proc %s from %s",pi->procname,pi->libname);
343  else
344  Warn("option changed in proc %s",pi->procname);
345  int i;
346  for (i=0; optionStruct[i].setval!=0; i++)
347  {
348  if ((optionStruct[i].setval & si_opt_1)
349  && (!(optionStruct[i].setval & save1)))
350  {
351  Print(" +%s",optionStruct[i].name);
352  }
353  if (!(optionStruct[i].setval & si_opt_1)
354  && ((optionStruct[i].setval & save1)))
355  {
356  Print(" -%s",optionStruct[i].name);
357  }
358  }
359  for (i=0; verboseStruct[i].setval!=0; i++)
360  {
361  if ((verboseStruct[i].setval & si_opt_2)
362  && (!(verboseStruct[i].setval & save2)))
363  {
364  Print(" +%s",verboseStruct[i].name);
365  }
366  if (!(verboseStruct[i].setval & si_opt_2)
367  && ((verboseStruct[i].setval & save2)))
368  {
369  Print(" -%s",verboseStruct[i].name);
370  }
371  }
372  PrintLn();
373  }
374  return err;
375 }
unsigned si_opt_1
Definition: options.c:5
void PrintLn()
Definition: reporter.cc:327
#define Print
Definition: emacs.cc:83
return P p
Definition: myNF.cc:203
struct soptionStruct optionStruct[]
Definition: misc_ip.cc:522
#define BITSET
Definition: structs.h:17
char * procname
Definition: subexpr.h:56
unsigned setval
Definition: iplib.cc:315
struct soptionStruct verboseStruct[]
Definition: misc_ip.cc:552
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:321
void newBuffer(char *s, feBufferTypes t, procinfo *pi, int lineno)
Definition: fevoices.cc:171
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 9081 of file iparith.cc.

9088 {
9089  //printf("AddCmd(%s, %d, %d, %d, %d)\n", szName, nAlias,
9090  // nTokval, nToktype, nPos);
9091  if(nPos>=0)
9092  {
9093  // no checks: we rely on a correct generated code in iparith.inc
9095  assume(szName!=NULL);
9096  sArithBase.sCmds[nPos].name = omStrDup(szName);
9097  sArithBase.sCmds[nPos].alias = nAlias;
9098  sArithBase.sCmds[nPos].tokval = nTokval;
9099  sArithBase.sCmds[nPos].toktype = nToktype;
9100  sArithBase.nCmdUsed++;
9101  //if(nTokval>0) sArithBase.nLastIdentifier++;
9102  }
9103  else
9104  {
9105  if(szName==NULL) return -1;
9106  int nIndex = iiArithFindCmd(szName);
9107  if(nIndex>=0)
9108  {
9109  Print("'%s' already exists at %d\n", szName, nIndex);
9110  return -1;
9111  }
9112 
9114  {
9115  /* needs to create new slots */
9116  unsigned long nSize = (sArithBase.nCmdAllocated+1)*sizeof(cmdnames);
9117  sArithBase.sCmds = (cmdnames *)omRealloc(sArithBase.sCmds, nSize);
9118  if(sArithBase.sCmds==NULL) return -1;
9120  }
9121  /* still free slots available */
9122  sArithBase.sCmds[sArithBase.nCmdUsed].name = omStrDup(szName);
9123  sArithBase.sCmds[sArithBase.nCmdUsed].alias = nAlias;
9124  sArithBase.sCmds[sArithBase.nCmdUsed].tokval = nTokval;
9125  sArithBase.sCmds[sArithBase.nCmdUsed].toktype = nToktype;
9126  sArithBase.nCmdUsed++;
9127 
9128  qsort(sArithBase.sCmds, sArithBase.nCmdUsed, sizeof(cmdnames),
9129  (&_gentable_sort_cmds));
9132  {
9133  if(sArithBase.sCmds[sArithBase.nLastIdentifier].tokval>=0) break;
9134  }
9135  //Print("L=%d\n", sArithBase.nLastIdentifier);
9136  }
9137  return 0;
9138 }
static int _gentable_sort_cmds(const void *a, const void *b)
compares to entry of cmdsname-list
Definition: iparith.cc:8914
#define Print
Definition: emacs.cc:83
int nCmdAllocated
number of commands-slots allocated
Definition: iparith.cc:210
#define assume(x)
Definition: mod2.h:405
int nLastIdentifier
valid indentifieres are slot 1..nLastIdentifier
Definition: iparith.cc:211
int nCmdUsed
number of commands used
Definition: iparith.cc:209
#define NULL
Definition: omList.c:10
#define nSize(n)
Definition: numbers.h:39
static SArithBase sArithBase
Base entry for arithmetic.
Definition: iparith.cc:219
int iiArithFindCmd(const char *szName)
Definition: iparith.cc:8986
cmdnames * sCmds
array of existing commands
Definition: iparith.cc:204
#define omRealloc(addr, size)
Definition: omAllocDecl.h:225
#define omStrDup(s)
Definition: omAllocDecl.h:263
static void iiCheckNest ( )
static

Definition at line 560 of file iplib.cc.

561 {
562  if (myynest >= iiRETURNEXPR_len-1)
563  {
564 #ifdef USE_IILOCALRING
566  iiRETURNEXPR_len*sizeof(ring),
567  (iiRETURNEXPR_len+16)*sizeof(ring));
568  memset(&(iiLocalRing[iiRETURNEXPR_len]),0,16*sizeof(ring));
569 #endif
570  iiRETURNEXPR_len+=16;
571  }
572 }
int iiRETURNEXPR_len
Definition: iplib.cc:528
#define omreallocSize(addr, o_size, size)
Definition: omAllocDecl.h:231
int myynest
Definition: febase.cc:46
ring * iiLocalRing
Definition: iplib.cc:525
static void iiCleanProcs ( idhdl root)
static

Definition at line 857 of file iplib.cc.

858 {
859  idhdl prev=NULL;
860  loop
861  {
862  if (root==NULL) return;
863  if (IDTYP(root)==PROC_CMD)
864  {
865  procinfo *pi=(procinfo*)IDDATA(root);
866  if ((pi->language == LANG_SINGULAR)
867  && (pi->data.s.body_start == 0L))
868  {
869  // procinfo data incorrect:
870  // - no proc body can start at the beginning of the file
871  killhdl(root);
872  if (prev==NULL)
873  root=IDROOT;
874  else
875  {
876  root=prev;
877  prev=NULL;
878  }
879  continue;
880  }
881  }
882  prev=root;
883  root=IDNEXT(root);
884  }
885 }
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:372
#define IDDATA(a)
Definition: ipid.h:125
char* iiConvName ( const char *  libname)

Definition at line 1279 of file iplib.cc.

1280 {
1281  char *tmpname = omStrDup(libname);
1282  char *p = strrchr(tmpname, DIR_SEP);
1283  char *r;
1284  if(p==NULL) p = tmpname;
1285  else p++;
1286  r = (char *)strchr(p, '.');
1287  if( r!= NULL) *r = '\0';
1288  r = omStrDup(p);
1289  *r = mytoupper(*r);
1290  // printf("iiConvName: '%s' '%s' => '%s'\n", libname, tmpname, r);
1291  omFree((ADDRESS)tmpname);
1292 
1293  return(r);
1294 }
char mytoupper(char c)
Definition: iplib.cc:1260
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 665 of file iplib.cc.

666 {
667  BOOLEAN err;
668  int old_echo=si_echo;
669 
670  iiCheckNest();
671  procstack->push(example);
672 #ifdef USE_IILOCALRING
674 #endif
676  {
677  if (traceit&TRACE_SHOW_LINENO) printf("\n");
678  printf("entering example (level %d)\n",myynest);
679  }
680  myynest++;
681 
682  err=iiAllStart(pi,example,BT_example,(pi != NULL ? pi->data.s.example_lineno: 0));
683 
685  myynest--;
686  si_echo=old_echo;
687  if (traceit&TRACE_SHOW_PROC)
688  {
689  if (traceit&TRACE_SHOW_LINENO) printf("\n");
690  printf("leaving -example- (level %d)\n",myynest);
691  }
692 #ifdef USE_IILOCALRING
693  if (iiLocalRing[myynest] != currRing)
694  {
695  if (iiLocalRing[myynest]!=NULL)
696  {
699  }
700  else
701  {
703  currRing=NULL;
704  }
705  }
706 #else /* USE_IILOCALRING */
707 #endif /* USE_IILOCALRING */
708  if (NS_LRING != currRing)
709  {
710  if (NS_LRING!=NULL)
711  {
713  if ((rh==NULL)||(IDRING(rh)!=NS_LRING))
714  rh=rFindHdl(NS_LRING,NULL);
715  rSetHdl(rh);
716  }
717  else
718  {
720  currRing=NULL;
721  }
722  }
723 //#endif /* USE_IILOCALRING */
724  procstack->pop();
725  return err;
726 }
#define TRACE_SHOW_LINENO
Definition: reporter.h:28
proclevel * procstack
Definition: ipid.cc:58
int traceit
Definition: febase.cc:47
idhdl cRingHdl
Definition: ipid.h:60
static void iiCheckNest()
Definition: iplib.cc:560
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:385
procinfodata data
Definition: subexpr.h:62
idhdl currRingHdl
Definition: ipid.cc:65
idhdl rFindHdl(ring r, idhdl n)
Definition: ipshell.cc:1573
BOOLEAN iiAllStart(procinfov pi, char *p, feBufferTypes t, int l)
Definition: iplib.cc:322
ring * iiLocalRing
Definition: iplib.cc:525
#define NULL
Definition: omList.c:10
#define IDRING(a)
Definition: ipid.h:126
#define TRACE_SHOW_PROC
Definition: reporter.h:26
void rSetHdl(idhdl h)
Definition: ipshell.cc:4979
void push(char *)
Definition: ipid.cc:702
void pop()
Definition: ipid.cc:714
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 738 of file iplib.cc.

739 {
740 # define SI_GET_BUILTIN_MOD_INIT(name) if (strcmp(libname, #name ".so") == 0){ return SI_MOD_INIT0(name); }
742 # undef SI_GET_BUILTIN_MOD_INIT
743 
744  return NULL;
745 }
#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 210 of file iplib.cc.

211 {
212  char buf[256], *s = NULL, *p;
213  long procbuflen;
214 
215  FILE * fp = feFopen( pi->libname, "rb", NULL, TRUE );
216  if (fp==NULL)
217  {
218  return NULL;
219  }
220 
221  fseek(fp, pi->data.s.proc_start, SEEK_SET);
222  if(part==0)
223  { // load help string
224  int i, offset=0;
225  long head = pi->data.s.def_end - pi->data.s.proc_start;
226  procbuflen = pi->data.s.help_end - pi->data.s.help_start;
227  if (procbuflen<5)
228  {
229  fclose(fp);
230  return NULL; // help part does not exist
231  }
232  //Print("Help=%ld-%ld=%d\n", pi->data.s.body_start,
233  // pi->data.s.proc_start, procbuflen);
234  s = (char *)omAlloc(procbuflen+head+3);
235  myfread(s, head, 1, fp);
236  s[head] = '\n';
237  fseek(fp, pi->data.s.help_start, SEEK_SET);
238  myfread(s+head+1, procbuflen, 1, fp);
239  fclose(fp);
240  s[procbuflen+head+1] = '\n';
241  s[procbuflen+head+2] = '\0';
242  offset=0;
243  for(i=0;i<=procbuflen+head+2; i++)
244  {
245  if(s[i]=='\\' &&
246  (s[i+1]=='"' || s[i+1]=='{' || s[i+1]=='}' || s[i+1]=='\\'))
247  {
248  i++;
249  offset++;
250  }
251  if(offset>0) s[i-offset] = s[i];
252  }
253  return(s);
254  }
255  else if(part==1)
256  { // load proc part - must exist
257  procbuflen = pi->data.s.def_end - pi->data.s.proc_start;
258  char *ss=(char *)omAlloc(procbuflen+2);
259  //fgets(buf, sizeof(buf), fp);
260  myfread( ss, procbuflen, 1, fp);
261  char ct;
262  char *e;
263  s=iiProcName(ss,ct,e);
264  char *argstr=NULL;
265  *e=ct;
266  argstr=iiProcArgs(e,TRUE);
267 
268  assume(pi->data.s.body_end > pi->data.s.body_start);
269 
270  procbuflen = pi->data.s.body_end - pi->data.s.body_start;
271  pi->data.s.body = (char *)omAlloc( strlen(argstr)+procbuflen+15+
272  strlen(pi->libname) );
273  //Print("Body=%ld-%ld=%d\n", pi->data.s.body_end,
274  // pi->data.s.body_start, procbuflen);
275  assume(pi->data.s.body != NULL);
276  fseek(fp, pi->data.s.body_start, SEEK_SET);
277  strcpy(pi->data.s.body,argstr);
278  myfread( pi->data.s.body+strlen(argstr), procbuflen, 1, fp);
279  fclose( fp );
280  procbuflen+=strlen(argstr);
281  omFree(argstr);
282  omFree(ss);
283  pi->data.s.body[procbuflen] = '\0';
284  strcat( pi->data.s.body+procbuflen, "\n;return();\n\n" );
285  strcat( pi->data.s.body+procbuflen+13,pi->libname);
286  s=(char *)strchr(pi->data.s.body,'{');
287  if (s!=NULL) *s=' ';
288  return NULL;
289  }
290  else if(part==2)
291  { // example
292  if ( pi->data.s.example_lineno == 0)
293  return NULL; // example part does not exist
294  // load example
295  fseek(fp, pi->data.s.example_start, SEEK_SET);
296  /*char *dummy=*/ (void) fgets(buf, sizeof(buf), fp); // skip line with "example"
297  procbuflen = pi->data.s.proc_end - pi->data.s.example_start - strlen(buf);
298  //Print("Example=%ld-%ld=%d\n", pi->data.s.proc_end,
299  // pi->data.s.example_start, procbuflen);
300  s = (char *)omAlloc(procbuflen+14);
301  myfread(s, procbuflen, 1, fp);
302  s[procbuflen] = '\0';
303  strcat(s+procbuflen-3, "\n;return();\n\n" );
304  p=(char *)strchr(s,'{');
305  if (p!=NULL) *p=' ';
306  return(s);
307  }
308  return NULL;
309 }
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:195
int status int void * buf
Definition: si_signals.h:59
procinfodata data
Definition: subexpr.h:62
FILE * feFopen(const char *path, const char *mode, char *where, short useWerror, short path_only)
Definition: feFopen.cc:47
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:64
char * iiConvName(const char *libname)
Definition: iplib.cc:1279
procinfo* iiInitSingularProcinfo ( procinfov  pi,
const char *  libname,
const char *  procname,
int  line,
long  pos,
BOOLEAN  pstatic 
)

Definition at line 978 of file iplib.cc.

980 {
981  pi->libname = omStrDup(libname);
982  pi->procname = omStrDup(procname);
983  pi->language = LANG_SINGULAR;
984  pi->ref = 1;
985  pi->pack = NULL;
986  pi->is_static = pstatic;
987  pi->data.s.proc_start = pos;
988  pi->data.s.def_end = 0L;
989  pi->data.s.help_start = 0L;
990  pi->data.s.help_end = 0L;
991  pi->data.s.body_start = 0L;
992  pi->data.s.body_end = 0L;
993  pi->data.s.example_start = 0L;
994  pi->data.s.proc_lineno = line;
995  pi->data.s.body_lineno = 0;
996  pi->data.s.example_lineno = 0;
997  pi->data.s.body = NULL;
998  pi->data.s.help_chksum = 0;
999  return(pi);
1000 }
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 813 of file iplib.cc.

814 {
815  char libnamebuf[128];
816  // procinfov pi;
817  // idhdl h;
818  idhdl pl;
819  // idhdl hl;
820  // long pos = 0L;
821  char *plib = iiConvName(newlib);
822  FILE * fp = feFopen( newlib, "r", libnamebuf, tellerror );
823  // int lines = 1;
824  BOOLEAN LoadResult = TRUE;
825 
826  if (fp==NULL)
827  {
828  return TRUE;
829  }
830  pl = basePack->idroot->get(plib,0);
831  if (pl==NULL)
832  {
833  pl = enterid( plib,0, PACKAGE_CMD,
834  &(basePack->idroot), TRUE );
835  IDPACKAGE(pl)->language = LANG_SINGULAR;
836  IDPACKAGE(pl)->libname=omStrDup(newlib);
837  }
838  else
839  {
840  if(IDTYP(pl)!=PACKAGE_CMD)
841  {
842  WarnS("not of type package.");
843  fclose(fp);
844  return TRUE;
845  }
846  if (!force) return FALSE;
847  }
848  LoadResult = iiLoadLIB(fp, libnamebuf, newlib, pl, autoexport, tellerror);
849  omFree((ADDRESS)newlib);
850 
851  if(!LoadResult) IDPACKAGE(pl)->loaded = TRUE;
852  omFree((ADDRESS)plib);
853 
854  return LoadResult;
855 }
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:259
#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:47
#define NULL
Definition: omList.c:10
package basePack
Definition: ipid.cc:64
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:902
char * iiConvName(const char *libname)
Definition: iplib.cc:1279
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 902 of file iplib.cc.

904 {
905  extern FILE *yylpin;
906  libstackv ls_start = library_stack;
907  lib_style_types lib_style;
908 
909  yylpin = fp;
910  #if YYLPDEBUG > 1
911  print_init();
912  #endif
913  extern int lpverbose;
914  if (BVERBOSE(V_DEBUG_LIB)) lpverbose=1;
915  else lpverbose=0;
916  // yylplex sets also text_buffer
917  if (text_buffer!=NULL) *text_buffer='\0';
918  yylplex(newlib, libnamebuf, &lib_style, pl, autoexport);
919  if(yylp_errno)
920  {
921  Werror("Library %s: ERROR occurred: in line %d, %d.", newlib, yylplineno,
922  current_pos(0));
924  {
928  }
929  else
931  Werror("Cannot load library,... aborting.");
932  reinit_yylp();
933  fclose( yylpin );
935  return TRUE;
936  }
937  if (BVERBOSE(V_LOAD_LIB))
938  Print( "// ** loaded %s %s\n", libnamebuf, text_buffer);
939  if( (lib_style == OLD_LIBSTYLE) && (BVERBOSE(V_LOAD_LIB)))
940  {
941  Warn( "library %s has old format. This format is still accepted,", newlib);
942  Warn( "but for functionality you may wish to change to the new");
943  Warn( "format. Please refer to the manual for further information.");
944  }
945  reinit_yylp();
946  fclose( yylpin );
947  fp = NULL;
948  iiRunInit(IDPACKAGE(pl));
949 
950  {
951  libstackv ls;
952  for(ls = library_stack; (ls != NULL) && (ls != ls_start); )
953  {
954  if(ls->to_be_done)
955  {
956  ls->to_be_done=FALSE;
957  iiLibCmd(ls->get(),autoexport,tellerror,FALSE);
958  ls = ls->pop(newlib);
959  }
960  }
961 #if 0
962  PrintS("--------------------\n");
963  for(ls = library_stack; ls != NULL; ls = ls->next)
964  {
965  Print("%s: LIB-stack:(%d), %s %s\n", newlib, ls->cnt, ls->get(),
966  ls->to_be_done ? "not loaded" : "loaded");
967  }
968  PrintS("--------------------\n");
969 #endif
970  }
971 
972  if(fp != NULL) fclose(fp);
973  return FALSE;
974 }
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:886
#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:1368
BOOLEAN iiLibCmd(char *newlib, BOOLEAN autoexport, BOOLEAN tellerror, BOOLEAN force)
Definition: iplib.cc:813
#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:857
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 799 of file iplib.cc.

800 {
801  char *plib = iiConvName(lib);
802  idhdl pl = basePack->idroot->get(plib,0);
803  if( (pl!=NULL) && (IDTYP(pl)==PACKAGE_CMD) &&
804  (IDPACKAGE(pl)->language == LANG_SINGULAR))
805  {
806  strncpy(where,IDPACKAGE(pl)->libname,127);
807  return TRUE;
808  }
809  else
810  return FALSE;;
811 }
#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:64
char * iiConvName(const char *libname)
Definition: iplib.cc:1279
BOOLEAN iiMake_proc ( idhdl  pn,
package  pack,
sleftv sl 
)

Definition at line 573 of file iplib.cc.

574 {
575  int err;
576  procinfov pi = IDPROC(pn);
577  if(pi->is_static && myynest==0)
578  {
579  Werror("'%s::%s()' is a local procedure and cannot be accessed by an user.",
580  pi->libname, pi->procname);
581  return TRUE;
582  }
583  iiCheckNest();
584 #ifdef USE_IILOCALRING
586  //Print("currRing(%d):%s(%x) in %s\n",myynest,IDID(currRingHdl),currRing,IDID(pn));
587 #endif
588  iiRETURNEXPR.Init();
589  procstack->push(pi->procname);
591  || (pi->trace_flag&TRACE_SHOW_PROC))
592  {
594  Print("entering%-*.*s %s (level %d)\n",myynest*2,myynest*2," ",IDID(pn),myynest);
595  }
596 #ifdef RDEBUG
598 #endif
599  switch (pi->language)
600  {
601  default:
602  case LANG_NONE:
603  WerrorS("undefined proc");
604  err=TRUE;
605  break;
606 
607  case LANG_SINGULAR:
608  if ((pi->pack!=NULL)&&(currPack!=pi->pack))
609  {
610  currPack=pi->pack;
613  //Print("set pack=%s\n",IDID(currPackHdl));
614  }
615  else if ((pack!=NULL)&&(currPack!=pack))
616  {
617  currPack=pack;
620  //Print("set pack=%s\n",IDID(currPackHdl));
621  }
622  err=iiPStart(pn,sl);
623  break;
624  case LANG_C:
626  err = (pi->data.o.function)(res, sl);
627  memcpy(&iiRETURNEXPR,res,sizeof(iiRETURNEXPR));
629  break;
630  }
631  if ((traceit&TRACE_SHOW_PROC)
632  || (pi->trace_flag&TRACE_SHOW_PROC))
633  {
634  if (traceit&TRACE_SHOW_LINENO) PrintLn();
635  Print("leaving %-*.*s %s (level %d)\n",myynest*2,myynest*2," ",IDID(pn),myynest);
636  }
637  //const char *n="NULL";
638  //if (currRingHdl!=NULL) n=IDID(currRingHdl);
639  //Print("currRing(%d):%s(%x) after %s\n",myynest,n,currRing,IDID(pn));
640 #ifdef RDEBUG
641  if (traceit&TRACE_SHOW_RINGS) iiShowLevRings();
642 #endif
643  if (err)
644  {
646  //iiRETURNEXPR.Init(); //done by CleanUp
647  }
648  if (iiCurrArgs!=NULL)
649  {
650  if (!err) Warn("too many arguments for %s",IDID(pn));
651  iiCurrArgs->CleanUp();
654  }
655  procstack->pop();
656  if (err)
657  return TRUE;
658  return FALSE;
659 }
#define TRACE_SHOW_LINENO
Definition: reporter.h:28
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
#define TRACE_SHOW_RINGS
Definition: reporter.h:33
void PrintLn()
Definition: reporter.cc:327
#define Print
Definition: emacs.cc:83
package pack
Definition: subexpr.h:57
idhdl currPackHdl
Definition: ipid.cc:61
#define IDID(a)
Definition: ipid.h:121
#define FALSE
Definition: auxiliary.h:140
sleftv iiRETURNEXPR
Definition: iplib.cc:527
language_defs language
Definition: subexpr.h:58
proclevel * procstack
Definition: ipid.cc:58
static void iiShowLevRings()
Definition: iplib.cc:531
#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:24
int traceit
Definition: febase.cc:47
static void iiCheckNest()
Definition: iplib.cc:560
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:525
#define NULL
Definition: omList.c:10
BOOLEAN iiPStart(idhdl pn, sleftv *v)
Definition: iplib.cc:382
package currPack
Definition: ipid.cc:63
leftv iiCurrArgs
Definition: ipshell.cc:84
void CleanUp(ring r=currRing)
Definition: subexpr.cc:321
#define TRACE_SHOW_PROC
Definition: reporter.h:26
idhdl packFindHdl(package r)
Definition: ipid.cc:732
void iiCheckPack(package &p)
Definition: ipshell.cc:1512
#define omFreeBin(addr, bin)
Definition: omAllocDecl.h:259
void push(char *)
Definition: ipid.cc:702
void pop()
Definition: ipid.cc:714
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  // skip leading spaces:
156  loop
157  {
158  if ((*s==' ')||(*s=='\t'))
159  s++;
160  else if ((*s=='\n')&&(*(s+1)==' '))
161  s+=2;
162  else // start of new arg or \0 or )
163  break;
164  }
165  e=s;
166  while ((*e!=',')
167  &&((par!=0) || (*e!=')'))
168  &&(*e!='\0'))
169  {
170  if (*e=='(') par++;
171  else if (*e==')') par--;
172  args_found=args_found || (*e>' ');
173  e++;
174  }
175  in_args=(*e==',');
176  if (args_found)
177  {
178  *e='\0';
179  // check for space:
180  if ((int)strlen(argstr)+12 /* parameter + ;*/ +(int)strlen(s)>= argstrlen)
181  {
182  argstrlen*=2;
183  char *a=(char *)omAlloc( argstrlen);
184  strcpy(a,argstr);
185  omFree((ADDRESS)argstr);
186  argstr=a;
187  }
188  // copy the result to argstr
189  if(strncmp(s,"alias ",6)!=0)
190  {
191  strcat(argstr,"parameter ");
192  }
193  strcat(argstr,s);
194  strcat(argstr,"; ");
195  e++; // e was pointing to ','
196  }
197  } while (in_args);
198  return argstr;
199 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
const poly a
Definition: syzextra.cc:212
loop
Definition: myNF.cc:98
#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:59
BOOLEAN iiPStart ( idhdl  pn,
sleftv v 
)

Definition at line 382 of file iplib.cc.

383 {
384  procinfov pi=NULL;
385  int old_echo=si_echo;
386  BOOLEAN err=FALSE;
387  char save_flags=0;
388 
389  /* init febase ======================================== */
390  /* we do not enter this case if filename != NULL !! */
391  if (pn!=NULL)
392  {
393  pi = IDPROC(pn);
394  if(pi!=NULL)
395  {
396  save_flags=pi->trace_flag;
397  if( pi->data.s.body==NULL )
398  {
399  iiGetLibProcBuffer(pi);
400  if (pi->data.s.body==NULL) return TRUE;
401  }
402 // omUpdateInfo();
403 // int m=om_Info.UsedBytes;
404 // Print("proc %s, mem=%d\n",IDID(pn),m);
405  }
406  }
407  else return TRUE;
408  /* generate argument list ======================================*/
409  if (v!=NULL)
410  {
412  memcpy(iiCurrArgs,v,sizeof(sleftv));
413  memset(v,0,sizeof(sleftv));
414  }
415  else
416  {
418  }
419  iiCurrProc=pn;
420  /* start interpreter ======================================*/
421  myynest++;
422  if (myynest > SI_MAX_NEST)
423  {
424  WerrorS("nesting too deep");
425  err=TRUE;
426  }
427  else
428  {
429  err=iiAllStart(pi,pi->data.s.body,BT_proc,pi->data.s.body_lineno-(v!=NULL));
430 
431 #ifdef USE_IILOCALRING
432 #if 0
433  if(procstack->cRing != iiLocalRing[myynest]) Print("iiMake_proc: 1 ring not saved procs:%x, iiLocal:%x\n",procstack->cRing, iiLocalRing[myynest]);
434 #endif
435  if (iiLocalRing[myynest-1] != currRing)
436  {
438  {
439  //idhdl hn;
440  const char *n;
441  const char *o;
442  idhdl nh=NULL, oh=NULL;
443  if (iiLocalRing[myynest-1]!=NULL)
444  oh=rFindHdl(iiLocalRing[myynest-1],NULL);
445  if (oh!=NULL) o=oh->id;
446  else o="none";
447  if (currRing!=NULL)
448  nh=rFindHdl(currRing,NULL);
449  if (nh!=NULL) n=nh->id;
450  else n="none";
451  Werror("ring change during procedure call: %s -> %s (level %d)",o,n,myynest);
453  err=TRUE;
454  }
455  currRing=iiLocalRing[myynest-1];
456  }
457  if ((currRing==NULL)
458  && (currRingHdl!=NULL))
460  else
461  if ((currRing!=NULL) &&
463  ||(IDLEV(currRingHdl)>=myynest-1)))
464  {
466  iiLocalRing[myynest-1]=NULL;
467  }
468 #else /* USE_IILOCALRING */
469  if (procstack->cRing != currRing)
470  {
471  //if (procstack->cRingHdl!=NULL)
472  //Print("procstack:%s,",IDID(procstack->cRingHdl));
473  //if (currRingHdl!=NULL)
474  //Print(" curr:%s\n",IDID(currRingHdl));
475  //Print("pr:%x, curr: %x\n",procstack->cRing,currRing);
477  {
478  //idhdl hn;
479  const char *n;
480  const char *o;
481  if (procstack->cRing!=NULL)
482  {
483  //PrintS("reset ring\n");
485  o=IDID(procstack->cRingHdl);
488  }
489  else o="none";
490  if (currRing!=NULL) n=IDID(currRingHdl);
491  else n="none";
492  if (currRing==NULL)
493  {
494  Werror("ring change during procedure call: %s -> %s (level %d)",o,n,myynest);
496  err=TRUE;
497  }
498  }
499  if (procstack->cRingHdl!=NULL)
500  {
502  }
503  else
505  }
506 #endif /* USE_IILOCALRING */
507  //Print("kill locals for %s (level %d)\n",IDID(pn),myynest);
508  killlocals(myynest);
509 #ifndef SING_NDEBUG
510  checkall();
511 #endif
512  //Print("end kill locals for %s (%d)\n",IDID(pn),myynest);
513  }
514  myynest--;
515  si_echo=old_echo;
516  if (pi!=NULL)
517  pi->trace_flag=save_flags;
518 // omUpdateInfo();
519 // int m=om_Info.UsedBytes;
520 // Print("exit %s, mem=%d\n",IDID(pn),m);
521  return err;
522 }
#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:527
proclevel * procstack
Definition: ipid.cc:58
#define TRUE
Definition: auxiliary.h:144
sleftv * leftv
Definition: structs.h:60
void WerrorS(const char *s)
Definition: feFopen.cc:24
idhdl cRingHdl
Definition: ipid.h:60
Definition: idrec.h:34
idhdl iiCurrProc
Definition: ipshell.cc:85
#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:389
void checkall()
Definition: misc_ip.cc:1017
void killlocals(int v)
Definition: ipshell.cc:385
procinfodata data
Definition: subexpr.h:62
idhdl currRingHdl
Definition: ipid.cc:65
omBin sleftv_bin
Definition: subexpr.cc:50
idhdl rFindHdl(ring r, idhdl n)
Definition: ipshell.cc:1573
#define IDLEV(a)
Definition: ipid.h:120
BOOLEAN iiAllStart(procinfov pi, char *p, feBufferTypes t, int l)
Definition: iplib.cc:322
#define IDPROC(a)
Definition: ipid.h:139
#define pi
Definition: libparse.cc:1143
ring * iiLocalRing
Definition: iplib.cc:525
#define NULL
Definition: omList.c:10
#define IDRING(a)
Definition: ipid.h:126
ring cRing
Definition: ipid.h:61
leftv iiCurrArgs
Definition: ipshell.cc:84
void CleanUp(ring r=currRing)
Definition: subexpr.cc:321
const char * id
Definition: idrec.h:39
void rSetHdl(idhdl h)
Definition: ipshell.cc:4979
char * iiGetLibProcBuffer(procinfo *pi, int part)
Definition: iplib.cc:210
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 886 of file iplib.cc.

887 {
888  idhdl h=p->idroot->get("mod_init",0);
889  if (h==NULL) return;
890  if (IDTYP(h)==PROC_CMD)
891  {
892  int save=yylineno;
893  myynest++;
894  // procinfo *pi=(procinfo*)IDDATA(h);
895  //PrintS("mod_init found\n");
896  iiMake_proc(h,p,NULL);
897  myynest--;
898  yylineno=save;
899  }
900 }
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:573
#define NULL
Definition: omList.c:10
static Poly * h
Definition: janet.cc:978
static void iiShowLevRings ( )
static

Definition at line 531 of file iplib.cc.

532 {
533  int i;
534 #ifdef USE_IILOCALRING
535  for (i=0;i<=myynest;i++)
536  {
537  Print("lev %d:",i);
538  if (iiLocalRing[i]==NULL) PrintS("NULL");
539  else Print("%lx",(long)iiLocalRing[i]);
540  PrintLn();
541  }
542 #endif
543 #if 0
544  i=myynest;
546  while (p!=NULL)
547  {
548  Print("lev %d:",i);
549  if (p->cRingHdl==NULL) PrintS("NULL");
550  else Print("%s",IDID(p->cRingHdl));
551  PrintLn();
552  p=p->next;
553  }
554 #endif
555  if (currRing==NULL) PrintS("curr:NULL\n");
556  else Print ("curr:%lx\n",(long)currRing);
557 }
void PrintLn()
Definition: reporter.cc:327
#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:58
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:525
#define NULL
Definition: omList.c:10
BOOLEAN iiTryLoadLib ( leftv  v,
const char *  id 
)

Definition at line 751 of file iplib.cc.

752 {
753  BOOLEAN LoadResult = TRUE;
754  char libnamebuf[128];
755  char *libname = (char *)omAlloc(strlen(id)+5);
756  const char *suffix[] = { "", ".lib", ".so", ".sl", NULL };
757  int i = 0;
758  // FILE *fp;
759  // package pack;
760  // idhdl packhdl;
761  lib_types LT;
762  for(i=0; suffix[i] != NULL; i++)
763  {
764  sprintf(libname, "%s%s", id, suffix[i]);
765  *libname = mytolower(*libname);
766  if((LT = type_of_LIB(libname, libnamebuf)) > LT_NOTFOUND)
767  {
768  char *s=omStrDup(libname);
769  #ifdef HAVE_DYNAMIC_LOADING
770  char libnamebuf[256];
771  #endif
772 
773  if (LT==LT_SINGULAR)
774  LoadResult = iiLibCmd(s, FALSE, FALSE,TRUE);
775  #ifdef HAVE_DYNAMIC_LOADING
776  else if ((LT==LT_ELF) || (LT==LT_HPUX))
777  LoadResult = load_modules(s,libnamebuf,FALSE);
778  #endif
779  else if (LT==LT_BUILTIN)
780  {
781  LoadResult=load_builtin(s,FALSE, iiGetBuiltinModInit(s));
782  }
783  if(!LoadResult )
784  {
785  v->name = iiConvName(libname);
786  break;
787  }
788  }
789  }
790  omFree(libname);
791  return LoadResult;
792 }
BOOLEAN load_builtin(const char *newlib, BOOLEAN autoexport, SModulFunc_t init)
Definition: iplib.cc:1147
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:24
#define omAlloc(size)
Definition: omAllocDecl.h:210
BOOLEAN iiLibCmd(char *newlib, BOOLEAN autoexport, BOOLEAN tellerror, BOOLEAN force)
Definition: iplib.cc:813
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:1266
#define NULL
Definition: omList.c:10
SModulFunc_t iiGetBuiltinModInit(const char *libname)
Definition: iplib.cc:738
char libnamebuf[128]
Definition: libparse.cc:1096
char * iiConvName(const char *libname)
Definition: iplib.cc:1279
int BOOLEAN
Definition: auxiliary.h:131
BOOLEAN load_modules(const char *newlib, char *fullname, BOOLEAN autoexport)
Definition: iplib.cc:1050
#define omStrDup(s)
Definition: omAllocDecl.h:263
BOOLEAN load_builtin ( const char *  newlib,
BOOLEAN  autoexport,
SModulFunc_t  init 
)

Definition at line 1147 of file iplib.cc.

1148 {
1149  int iiAddCproc(const char *libname, const char *procname, BOOLEAN pstatic,
1150  BOOLEAN(*func)(leftv res, leftv v));
1151 /*
1152  typedef int (*fktn_t)(int(*iiAddCproc)(const char *libname, const char *procname,
1153  BOOLEAN pstatic,
1154  BOOLEAN(*func)(leftv res, leftv v)));
1155 */
1156  // SModulFunc_t fktn;
1157  idhdl pl;
1158  char *plib = iiConvName(newlib);
1159  // BOOLEAN RET=TRUE;
1160  // int token;
1161 
1162  pl = IDROOT->get(plib,0);
1163  if (pl!=NULL)
1164  {
1165  if (BVERBOSE(V_LOAD_LIB)) Warn( "(builtin) %s already loaded", newlib);
1166  omFree(plib);
1167  return FALSE;
1168  }
1169 
1170  pl = enterid( plib,0, PACKAGE_CMD, &IDROOT,
1171  TRUE );
1172  IDPACKAGE(pl)->language = LANG_C;
1173  IDPACKAGE(pl)->libname=omStrDup(newlib);
1174 
1175  IDPACKAGE(pl)->handle=(void *)NULL;
1176  SModulFunctions sModulFunctions;
1177 
1178  package s=currPack;
1179  currPack=IDPACKAGE(pl);
1180  if( init!= NULL)
1181  {
1182  sModulFunctions.iiArithAddCmd = iiArithAddCmd;
1183  if (autoexport) sModulFunctions.iiAddCproc = iiAddCprocTop;
1184  else sModulFunctions.iiAddCproc = iiAddCproc;
1185  (*init)(&sModulFunctions);
1186  }
1187  if (BVERBOSE(V_LOAD_LIB)) Print( "// ** loaded (builtin) %s \n", newlib);
1188  currPack->loaded=1;
1189  currPack=s;
1190 
1191  return FALSE;
1192 }
int iiAddCprocTop(const char *libname, const char *procname, BOOLEAN pstatic, BOOLEAN(*func)(leftv res, leftv v))
Definition: iplib.cc:1037
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:259
#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:63
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:1003
char * iiConvName(const char *libname)
Definition: iplib.cc:1279
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:9081
BOOLEAN load_modules ( const char *  newlib,
char *  fullname,
BOOLEAN  autoexport 
)

Definition at line 1050 of file iplib.cc.

1051 {
1052 #ifdef HAVE_STATIC
1053  WerrorS("mod_init: static version can not load modules");
1054  return TRUE;
1055 #else
1056 /*
1057  typedef int (*fktn_t)(int(*iiAddCproc)(const char *libname, const char *procname,
1058  BOOLEAN pstatic,
1059  BOOLEAN(*func)(leftv res, leftv v)));
1060 */
1061  SModulFunc_t fktn;
1062  idhdl pl;
1063  char *plib = iiConvName(newlib);
1064  BOOLEAN RET=TRUE;
1065  int token;
1066  char FullName[256];
1067 
1068  memset(FullName,0,256);
1069 
1070  if( *fullname != '/' && *fullname != '.' )
1071  sprintf(FullName, "./%s", newlib);
1072  else strncpy(FullName, fullname,255);
1073 
1074 
1075  if(IsCmd(plib, token))
1076  {
1077  Werror("'%s' is resered identifier\n", plib);
1078  goto load_modules_end;
1079  }
1080  pl = basePack->idroot->get(plib,0); /* packages only in top level
1081  (see enterid) */
1082  if (pl==NULL)
1083  {
1084  pl = enterid( plib,0, PACKAGE_CMD, &IDROOT,
1085  TRUE );
1086  IDPACKAGE(pl)->language = LANG_C;
1087  IDPACKAGE(pl)->libname=omStrDup(newlib);
1088  }
1089  else
1090  {
1091  if(IDTYP(pl)!=PACKAGE_CMD)
1092  {
1093  Warn("not of type package.");
1094  goto load_modules_end;
1095  }
1096  }
1097  if (dynl_check_opened(FullName))
1098  {
1099  if (BVERBOSE(V_LOAD_LIB)) Warn( "%s already loaded", fullname);
1100  return FALSE;
1101  }
1102  if((IDPACKAGE(pl)->handle=dynl_open(FullName))==(void *)NULL)
1103  {
1104  Werror("dynl_open failed:%s", dynl_error());
1105  Werror("%s not found", newlib);
1106  killhdl2(pl,&(basePack->idroot),NULL); // remove package
1107  goto load_modules_end;
1108  }
1109  else
1110  {
1111  SModulFunctions sModulFunctions;
1112 
1113  package s=currPack;
1114  currPack=IDPACKAGE(pl);
1115  fktn = (SModulFunc_t)dynl_sym(IDPACKAGE(pl)->handle, "mod_init");
1116  if( fktn!= NULL)
1117  {
1118  sModulFunctions.iiArithAddCmd = iiArithAddCmd;
1119  if (autoexport) sModulFunctions.iiAddCproc = iiAddCprocTop;
1120  else sModulFunctions.iiAddCproc = iiAddCproc;
1121  int ver=(*fktn)(&sModulFunctions);
1122  if (ver==MAX_TOK)
1123  {
1124  if (BVERBOSE(V_LOAD_LIB)) Print( "// ** loaded %s\n", fullname);
1125  }
1126  else
1127  {
1128  Warn("// ** loaded %s for a different version of Singular(expected: %d, got %d)",fullname,MAX_TOK,ver);
1129  }
1130  currPack->loaded=1;
1131  currPack=s;
1132  RET=FALSE;
1133  }
1134  else
1135  {
1136  Werror("mod_init not found:: %s\nThis is probably not a dynamic module for Singular!\n", dynl_error());
1137  killhdl2(pl,&(basePack->idroot),NULL); // remove package
1138  }
1139  }
1140 
1141  load_modules_end:
1142  return RET;
1143 #endif /*STATIC */
1144 }
int iiAddCprocTop(const char *libname, const char *procname, BOOLEAN pstatic, BOOLEAN(*func)(leftv res, leftv v))
Definition: iplib.cc:1037
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:170
#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:24
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
void killhdl2(idhdl h, idhdl *ih, ring r)
Definition: ipid.cc:403
idhdl enterid(const char *s, int lev, int t, idhdl *root, BOOLEAN init, BOOLEAN search)
Definition: ipid.cc:259
#define BVERBOSE(a)
Definition: options.h:33
#define NULL
Definition: omList.c:10
package basePack
Definition: ipid.cc:64
package currPack
Definition: ipid.cc:63
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:1003
char * iiConvName(const char *libname)
Definition: iplib.cc:1279
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:8739
#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:9081
void module_help_main ( const char *  newlib,
const char *  help 
)

Definition at line 1194 of file iplib.cc.

1195 {
1196  char *plib = iiConvName(newlib);
1197  idhdl pl = basePack->idroot->get(plib,0);
1198  if ((pl==NULL)||(IDTYP(pl)!=PACKAGE_CMD))
1199  Werror(">>%s<< is not a package (trying to add package help)",plib);
1200  else
1201  {
1202  package s=currPack;
1203  currPack=IDPACKAGE(pl);
1205  IDSTRING(h)=omStrDup(help);
1206  currPack=s;
1207  }
1208 }
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:259
#define IDSTRING(a)
Definition: ipid.h:135
#define help
Definition: libparse.cc:1228
#define NULL
Definition: omList.c:10
package basePack
Definition: ipid.cc:64
package currPack
Definition: ipid.cc:63
char * iiConvName(const char *libname)
Definition: iplib.cc:1279
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 1209 of file iplib.cc.

1210 {
1211  char *plib = iiConvName(newlib);
1212  idhdl pl = basePack->idroot->get(plib,0);
1213  if ((pl==NULL)||(IDTYP(pl)!=PACKAGE_CMD))
1214  Werror(">>%s<< is not a package(trying to add help for %s)",plib,p);
1215  else
1216  {
1217  package s=currPack;
1218  currPack=IDPACKAGE(pl);
1219  char buff[256];
1220  buff[255]='\0';
1221  strncpy(buff,p,255);
1222  strncat(buff,"_help",255-strlen(p));
1224  IDSTRING(h)=omStrDup(help);
1225  currPack=s;
1226  }
1227 }
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:259
#define IDSTRING(a)
Definition: ipid.h:135
#define help
Definition: libparse.cc:1228
#define NULL
Definition: omList.c:10
package basePack
Definition: ipid.cc:64
package currPack
Definition: ipid.cc:63
char * iiConvName(const char *libname)
Definition: iplib.cc:1279
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 1266 of file iplib.cc.

1267 {
1268  if(c>=65 && c<=(65+26)) c+=32;
1269  return(c);
1270 }
char mytoupper ( char  c)

Definition at line 1260 of file iplib.cc.

1261 {
1262  if(c>=97 && c<=(97+26)) c-=32;
1263  return(c);
1264 }
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 525 of file iplib.cc.

sleftv iiRETURNEXPR

Definition at line 527 of file iplib.cc.

int iiRETURNEXPR_len =0

Definition at line 528 of file iplib.cc.

libstackv library_stack

Definition at line 74 of file iplib.cc.

struct soptionStruct optionStruct[]

Definition at line 522 of file misc_ip.cc.

struct soptionStruct verboseStruct[]

Definition at line 552 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.