My Project  debian-1:4.1.2-p1+ds-2
Data Structures | Macros | Typedefs | Functions | Variables
ipid.h File Reference
#include "Singular/idrec.h"
#include "Singular/subexpr.h"
#include "Singular/lists.h"

Go to the source code of this file.

Data Structures

struct  ip_command
 
struct  ip_package
 
class  proclevel
 
struct  SModulFunctions
 
struct  soptionStruct
 

Macros

#define IDROOT   (currPack->idroot)
 
#define FLAG_STD   0
 
#define FLAG_TWOSTD   3
 
#define FLAG_QRING   4
 
#define hasFlag(A, F)   Sy_inset((F),(A)->flag)
 
#define setFlag(A, F)   (A)->flag|=Sy_bit(F)
 
#define resetFlag(A, F)   (A)->flag&=~Sy_bit(F)
 
#define IDNEXT(a)   ((a)->next)
 
#define IDTYP(a)   ((a)->typ)
 
#define IDFLAG(a)   ((a)->flag)
 
#define IDLEV(a)   ((a)->lev)
 
#define IDID(a)   ((a)->id)
 
#define IDATTR(a)   ((a)->attribute)
 
#define IDINT(a)   ((int)(long)((a)->data.ustring))
 
#define IDDATA(a)   ((a)->data.ustring)
 
#define IDRING(a)   ((a)->data.uring)
 
#define IDINTVEC(a)   ((a)->data.iv)
 
#define IDBIMAT(a)   ((a)->data.bim)
 
#define IDPOLY(a)   ((a)->data.p)
 
#define IDBIGINT(a)   ((a)->data.n)
 
#define IDNUMBER(a)   ((a)->data.n)
 
#define IDIDEAL(a)   ((a)->data.uideal)
 
#define IDMATRIX(a)   ((a)->data.umatrix)
 
#define IDMAP(a)   ((a)->data.umap)
 
#define IDSTRING(a)   ((a)->data.ustring)
 
#define IDLIST(a)   ((a)->data.l)
 
#define IDLINK(a)   ((a)->data.li)
 
#define IDPACKAGE(a)   ((a)->data.pack)
 
#define IDPROC(a)   ((a)->data.pinf)
 

Typedefs

typedef ip_command * command
 
typedef int(* SModulFunc_t) (SModulFunctions *)
 

Functions

package paCopy (package pack)
 
void paKill (package pack)
 
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)
 
idhdl enterid (const char *a, int lev, int t, idhdl *root, BOOLEAN init=TRUE, BOOLEAN serach=TRUE)
 
idhdl ggetid (const char *n)
 
void killid (const char *a, idhdl *i)
 
void killhdl (idhdl h, package prooti=currPack)
 
void killhdl2 (idhdl h, idhdl *ih, ring r)
 
lists ipNameList (idhdl root)
 
lists ipNameListLev (idhdl root, int lev)
 
void ipMoveId (idhdl h)
 
BOOLEAN checkPackage (package pack)
 
idhdl packFindHdl (package r)
 
void jjNormalizeQRingP (poly &p)
 
void jjNormalizeQRingId (leftv I)
 
void * idrecDataInit (int t)
 
void ipListFlag (idhdl h)
 

Variables

EXTERN_VAR idhdl currPackHdl
 
EXTERN_VAR idhdl basePackHdl
 
EXTERN_VAR package currPack
 
EXTERN_VAR package basePack
 
EXTERN_VAR proclevelprocstack
 
EXTERN_VAR idhdl currRingHdl
 
EXTERN_VAR omBin sip_command_bin
 
EXTERN_VAR omBin sip_package_bin
 
EXTERN_VAR omBin idrec_bin
 
EXTERN_VAR omBin sleftv_bin
 
EXTERN_VAR coeffs coeffs_BIGINT
 
const struct soptionStruct optionStruct []
 
const struct soptionStruct verboseStruct []
 

Data Structure Documentation

◆ sip_command

struct sip_command

Definition at line 23 of file ipid.h.

Data Fields
sleftv arg1
sleftv arg2
sleftv arg3
short argc
short op

◆ sip_package

struct sip_package

Definition at line 32 of file ipid.h.

Data Fields
void * handle
idhdl idroot
language_defs language
char * libname
BOOLEAN loaded
short ref

◆ soptionStruct

struct soptionStruct

Definition at line 144 of file ipid.h.

Data Fields
const char * name
unsigned resetval
unsigned setval

Macro Definition Documentation

◆ FLAG_QRING

#define FLAG_QRING   4

Definition at line 105 of file ipid.h.

◆ FLAG_STD

#define FLAG_STD   0

Definition at line 103 of file ipid.h.

◆ FLAG_TWOSTD

#define FLAG_TWOSTD   3

Definition at line 104 of file ipid.h.

◆ hasFlag

#define hasFlag (   A,
 
)    Sy_inset((F),(A)->flag)

Definition at line 106 of file ipid.h.

◆ IDATTR

#define IDATTR (   a)    ((a)->attribute)

Definition at line 117 of file ipid.h.

◆ IDBIGINT

#define IDBIGINT (   a)    ((a)->data.n)

Definition at line 125 of file ipid.h.

◆ IDBIMAT

#define IDBIMAT (   a)    ((a)->data.bim)

Definition at line 123 of file ipid.h.

◆ IDDATA

#define IDDATA (   a)    ((a)->data.ustring)

Definition at line 120 of file ipid.h.

◆ IDFLAG

#define IDFLAG (   a)    ((a)->flag)

Definition at line 114 of file ipid.h.

◆ IDID

#define IDID (   a)    ((a)->id)

Definition at line 116 of file ipid.h.

◆ IDIDEAL

#define IDIDEAL (   a)    ((a)->data.uideal)

Definition at line 127 of file ipid.h.

◆ IDINT

#define IDINT (   a)    ((int)(long)((a)->data.ustring))

Definition at line 119 of file ipid.h.

◆ IDINTVEC

#define IDINTVEC (   a)    ((a)->data.iv)

Definition at line 122 of file ipid.h.

◆ IDLEV

#define IDLEV (   a)    ((a)->lev)

Definition at line 115 of file ipid.h.

◆ IDLINK

#define IDLINK (   a)    ((a)->data.li)

Definition at line 132 of file ipid.h.

◆ IDLIST

#define IDLIST (   a)    ((a)->data.l)

Definition at line 131 of file ipid.h.

◆ IDMAP

#define IDMAP (   a)    ((a)->data.umap)

Definition at line 129 of file ipid.h.

◆ IDMATRIX

#define IDMATRIX (   a)    ((a)->data.umatrix)

Definition at line 128 of file ipid.h.

◆ IDNEXT

#define IDNEXT (   a)    ((a)->next)

Definition at line 112 of file ipid.h.

◆ IDNUMBER

#define IDNUMBER (   a)    ((a)->data.n)

Definition at line 126 of file ipid.h.

◆ IDPACKAGE

#define IDPACKAGE (   a)    ((a)->data.pack)

Definition at line 133 of file ipid.h.

◆ IDPOLY

#define IDPOLY (   a)    ((a)->data.p)

Definition at line 124 of file ipid.h.

◆ IDPROC

#define IDPROC (   a)    ((a)->data.pinf)

Definition at line 134 of file ipid.h.

◆ IDRING

#define IDRING (   a)    ((a)->data.uring)

Definition at line 121 of file ipid.h.

◆ IDROOT

#define IDROOT   (currPack->idroot)

Definition at line 17 of file ipid.h.

◆ IDSTRING

#define IDSTRING (   a)    ((a)->data.ustring)

Definition at line 130 of file ipid.h.

◆ IDTYP

#define IDTYP (   a)    ((a)->typ)

Definition at line 113 of file ipid.h.

◆ resetFlag

#define resetFlag (   A,
 
)    (A)->flag&=~Sy_bit(F)

Definition at line 108 of file ipid.h.

◆ setFlag

#define setFlag (   A,
 
)    (A)->flag|=Sy_bit(F)

Definition at line 107 of file ipid.h.

Typedef Documentation

◆ command

typedef ip_command* command

Definition at line 21 of file ipid.h.

◆ SModulFunc_t

typedef int(* SModulFunc_t) (SModulFunctions *)

Definition at line 79 of file ipid.h.

Function Documentation

◆ checkPackage()

BOOLEAN checkPackage ( package  pack)

◆ enterid()

idhdl enterid ( const char *  a,
int  lev,
int  t,
idhdl root,
BOOLEAN  init = TRUE,
BOOLEAN  serach = TRUE 
)

Definition at line 264 of file ipid.cc.

266 {
267  if (s==NULL) return NULL;
268  if (root==NULL) return NULL;
269  idhdl h;
270  s=omStrDup(s);
271  // idhdl *save_root=root;
272  if (t==PACKAGE_CMD)
273  {
274  if (root!=&(basePack->idroot))
275  {
276  root=&(basePack->idroot);
277  }
278  }
279  // is it already defined in root ?
280  if ((h=(*root)->get(s,lev))!=NULL)
281  {
282  if (IDLEV(h)==lev)
283  {
284  if ((IDTYP(h) == t)||(t==DEF_CMD))
285  {
286  if (IDTYP(h)==PACKAGE_CMD)
287  {
288  if (strcmp(s,"Top")==0)
289  {
290  goto errlabel;
291  }
292  else return h;
293  }
294  else
295  {
296  if (BVERBOSE(V_REDEFINE))
297  Warn("redefining %s (%s)",s,my_yylinebuf);
298  if (s==IDID(h)) IDID(h)=NULL;
299  killhdl2(h,root,currRing);
300  }
301  }
302  else
303  goto errlabel;
304  }
305  }
306  // is it already defined in currRing->idroot ?
307  else if (search && (currRing!=NULL)&&((*root) != currRing->idroot))
308  {
309  if ((h=currRing->idroot->get(s,lev))!=NULL)
310  {
311  if (IDLEV(h)==lev)
312  {
313  if ((IDTYP(h) == t)||(t==DEF_CMD))
314  {
315  if (BVERBOSE(V_REDEFINE))
316  Warn("redefining %s (%s)",s,my_yylinebuf);
317  if (s==IDID(h)) IDID(h)=NULL;
318  killhdl2(h,&currRing->idroot,currRing);
319  }
320  else
321  goto errlabel;
322  }
323  }
324  }
325  // is it already defined in idroot ?
326  else if (search && (*root != IDROOT))
327  {
328  if ((h=IDROOT->get(s,lev))!=NULL)
329  {
330  if (IDLEV(h)==lev)
331  {
332  if ((IDTYP(h) == t)||(t==DEF_CMD))
333  {
334  if (BVERBOSE(V_REDEFINE))
335  Warn("redefining %s (%s)",s,my_yylinebuf);
336  if (s==IDID(h)) IDID(h)=NULL;
337  killhdl2(h,&IDROOT,NULL);
338  }
339  else
340  goto errlabel;
341  }
342  }
343  }
344  *root = (*root)->set(s, lev, t, init);
345 #ifndef SING_NDEBUG
346  checkall();
347 #endif
348  return *root;
349 
350  errlabel:
351  //Werror("identifier `%s` in use(lev h=%d,typ=%d,t=%d, curr=%d)",s,IDLEV(h),IDTYP(h),t,lev);
352  Werror("identifier `%s` in use",s);
353  //listall();
354  omFree((ADDRESS)s);
355  return NULL;

◆ ggetid()

idhdl ggetid ( const char *  n)

Definition at line 520 of file ipid.cc.

522 {
523  idhdl h = IDROOT->get(n,myynest);
524  if ((h!=NULL)&&(IDLEV(h)==myynest)) return h;
525  if (currRing!=NULL)
526  {
527  idhdl h2 = currRing->idroot->get(n,myynest);
528  if (h2!=NULL) return h2;
529  }
530  if (h!=NULL) return h;
531  if (basePack!=currPack)
532  return basePack->idroot->get(n,myynest);
533  return NULL;

◆ idrecDataInit()

void* idrecDataInit ( int  t)

Definition at line 124 of file ipid.cc.

126 {
127  switch (t)
128  {
129  //the type with init routines:
130 #ifdef SINGULAR_4_2
131  case CNUMBER_CMD:
132  return (void*)n2Init(0,NULL);
133  case CPOLY_CMD:
134  return (void*)p2Init(0,NULL);
135  case CMATRIX_CMD:
136 #endif
137  case BIGINTMAT_CMD:
138  return (void *)new bigintmat();
139  case BUCKET_CMD:
140  if (currRing!=NULL)
141  return (void*)sBucketCreate(currRing);
142  else
143  {
144  WerrorS("need basering for polyBucket");
145  return NULL;
146  }
147  case INTVEC_CMD:
148  case INTMAT_CMD:
149  return (void *)new intvec();
150  case NUMBER_CMD:
151  {
152  if (currRing!=NULL) return (void *) nInit(0);
153  else return NULL;
154  }
155  case BIGINT_CMD:
156  return (void *) n_Init(0, coeffs_BIGINT);
157  case IDEAL_CMD:
158  case MODUL_CMD:
159  case MATRIX_CMD:
160  case SMATRIX_CMD:
161  return (void*) idInit(1,1);
162  case MAP_CMD:
163  {
164  map m = (map)idInit(1,1);
165  m->preimage = omStrDup(IDID(currRingHdl));
166  return (void *)m;
167  }
168  case STRING_CMD:
169  return (void *)omAlloc0(1);
170  case LIST_CMD:
171  {
173  l->Init();
174  return (void*)l;
175  }
176  //the types with the standard init: set the struct to zero
177  case LINK_CMD:
178  return (void*) omAlloc0Bin(sip_link_bin);
179  case RING_CMD:
180  return NULL;
181  case PACKAGE_CMD:
182  {
183  package pa=(package)omAlloc0Bin(sip_package_bin);
184  pa->language=LANG_NONE;
185  pa->loaded = FALSE;
186  return (void*)pa;
187  }
188  case PROC_CMD:
189  {
191  pi->ref=1;
192  pi->language=LANG_NONE;
193  return (void*)pi;
194  }
195  case RESOLUTION_CMD:
196  return (void *)omAlloc0(sizeof(ssyStrategy));
197  //other types: without init (int,script,poly,def,package)
198  case CRING_CMD:
199  case INT_CMD:
200  case DEF_CMD:
201  case POLY_CMD:
202  case VECTOR_CMD:
203  case QRING_CMD:
204  return (void*)0L;
205  default:
206  {
207  if (t>MAX_TOK)
208  {
209 #ifdef BLACKBOX_DEVEL
210  Print("bb-type %d\n",t);
211 #endif
212  blackbox *bb=getBlackboxStuff(t);
213  if (bb!=NULL)
214  return (void *)bb->blackbox_Init(bb);
215  }
216  else
217  Werror("unknown type in idrecDataInit:%d",t);
218  break;
219  }
220  }
221  return (void *)0L;

◆ ipListFlag()

void ipListFlag ( idhdl  h)

Definition at line 535 of file ipid.cc.

537 {
538  if (hasFlag(h,FLAG_STD)) PrintS(" (SB)");
539 #ifdef HAVE_PLURAL
540  if (hasFlag(h,FLAG_TWOSTD)) PrintS(" (2SB)");
541 #endif

◆ ipMoveId()

void ipMoveId ( idhdl  h)

Definition at line 620 of file ipid.cc.

622 {
623  if ((currRing!=NULL)&&(tomove!=NULL))
624  {
625  if (RingDependend(IDTYP(tomove))
626  || ((IDTYP(tomove)==LIST_CMD) && (lRingDependend(IDLIST(tomove)))))
627  {
628  /*move 'tomove' to ring id's*/
629  if (ipSwapId(tomove,IDROOT,currRing->idroot))
630  ipSwapId(tomove,basePack->idroot,currRing->idroot);
631  }
632  else
633  {
634  /*move 'tomove' to global id's*/
635  ipSwapId(tomove,currRing->idroot,IDROOT);
636  }
637  }

◆ ipNameList()

lists ipNameList ( idhdl  root)

Definition at line 543 of file ipid.cc.

545 {
546  idhdl h=root;
547  /* compute the length */
548  int l=0;
549  while (h!=NULL) { l++; h=IDNEXT(h); }
550  /* allocate list */
552  L->Init(l);
553  /* copy names */
554  h=root;
555  l=0;
556  while (h!=NULL)
557  {
558  /* list is initialized with 0 => no need to clear anything */
559  L->m[l].rtyp=STRING_CMD;
560  L->m[l].data=omStrDup(IDID(h));
561  l++;
562  h=IDNEXT(h);
563  }
564  return L;

◆ ipNameListLev()

lists ipNameListLev ( idhdl  root,
int  lev 
)

Definition at line 566 of file ipid.cc.

568 {
569  idhdl h=root;
570  /* compute the length */
571  int l=0;
572  while (h!=NULL) { if (IDLEV(h)==lev) l++; h=IDNEXT(h); }
573  /* allocate list */
575  L->Init(l);
576  /* copy names */
577  h=root;
578  l=0;
579  while (h!=NULL)
580  {
581  if (IDLEV(h)==lev)
582  {
583  /* list is initialized with 0 => no need to clear anything */
584  L->m[l].rtyp=STRING_CMD;
585  L->m[l].data=omStrDup(IDID(h));
586  l++;
587  }
588  h=IDNEXT(h);
589  }
590  return L;

◆ jjNormalizeQRingId()

void jjNormalizeQRingId ( leftv  I)

Definition at line 2186 of file ipassign.cc.

2188 {
2189  if ((currRing->qideal!=NULL) && (!hasFlag(I,FLAG_QRING)))
2190  {
2191  if (I->e==NULL)
2192  {
2193  ideal I0=(ideal)I->Data();
2194  switch (I->Typ())
2195  {
2196  case IDEAL_CMD:
2197  case MODUL_CMD:
2198  {
2199  ideal F=idInit(1,1);
2200  ideal II=kNF(F,currRing->qideal,I0);
2201  idDelete(&F);
2202  if (I->rtyp!=IDHDL)
2203  {
2204  idDelete((ideal*)&(I0));
2205  I->data=II;
2206  }
2207  else
2208  {
2209  idhdl h=(idhdl)I->data;
2210  idDelete((ideal*)&IDIDEAL(h));
2211  IDIDEAL(h)=II;
2212  setFlag(h,FLAG_QRING);
2213  }
2214  break;
2215  }
2216  default: break;
2217  }
2218  setFlag(I,FLAG_QRING);
2219  }
2220  }

◆ jjNormalizeQRingP()

void jjNormalizeQRingP ( poly &  p)

Definition at line 2221 of file ipassign.cc.

2223 {
2224  if((p!=NULL) && (currRing->qideal!=NULL))
2225  {
2226  ideal F=idInit(1,1);
2227  poly p2=kNF(F,currRing->qideal,p);
2228  pNormalize(p2);
2229  idDelete(&F);
2230  pDelete(&p);
2231  p=p2;
2232  }

◆ killhdl()

void killhdl ( idhdl  h,
package  prooti = currPack 
)

Definition at line 383 of file ipid.cc.

385 {
386  int t=IDTYP(h);
387  if (((BEGIN_RING<t) && (t<END_RING))
388  || ((t==LIST_CMD) && (lRingDependend((lists)IDDATA(h)))))
389  killhdl2(h,&currRing->idroot,currRing);
390  else
391  {
392  if(t==PACKAGE_CMD)
393  {
394  killhdl2(h,&(basePack->idroot),NULL);
395  }
396  else
397  {
398  idhdl s=proot->idroot;
399  while ((s!=h) && (s!=NULL)) s=s->next;
400  if (s!=NULL)
401  killhdl2(h,&(proot->idroot),NULL);
402  else if (basePack!=proot)
403  {
404  idhdl s=basePack->idroot;
405  while ((s!=h) && (s!=NULL)) s=s->next;
406  if (s!=NULL)
407  killhdl2(h,&(basePack->idroot),currRing);
408  else
409  killhdl2(h,&(currRing->idroot),currRing);
410  }
411  }
412  }

◆ killhdl2()

void killhdl2 ( idhdl  h,
idhdl ih,
ring  r 
)

Definition at line 414 of file ipid.cc.

416 {
417  //printf("kill %s, id %x, typ %d lev: %d\n",IDID(h),(int)IDID(h),IDTYP(h),IDLEV(h));
418  idhdl hh;
419 
420  if (TEST_V_ALLWARN
421  && (IDLEV(h)!=myynest)
422  &&(IDLEV(h)==0))
423  {
424  if (((*ih)==basePack->idroot)
425  || ((currRing!=NULL)&&((*ih)==currRing->idroot)))
426  Warn("kill global `%s` at line >>%s<<\n",IDID(h),my_yylinebuf);
427  }
428  if (h->attribute!=NULL)
429  {
430  if ((IDTYP(h)==RING_CMD)&&(IDRING(h)!=r))
431  h->attribute->killAll(IDRING(h));
432  else
433  h->attribute->killAll(r);
434  h->attribute=NULL;
435  }
436  if (IDTYP(h) == PACKAGE_CMD)
437  {
438  if (((IDPACKAGE(h)->language==LANG_C)&&(IDPACKAGE(h)->idroot!=NULL))
439  || (strcmp(IDID(h),"Top")==0))
440  {
441  Warn("cannot kill `%s`",IDID(h));
442  return;
443  }
444  // any objects defined for this package ?
445  if ((IDPACKAGE(h)->ref<=0) && (IDPACKAGE(h)->idroot!=NULL))
446  {
447  if (currPack==IDPACKAGE(h))
448  {
451  }
452  idhdl * hd = &IDRING(h)->idroot;
453  idhdl hdh = IDNEXT(*hd);
454  idhdl temp;
455  while (hdh!=NULL)
456  {
457  temp = IDNEXT(hdh);
458  killhdl2(hdh,&(IDPACKAGE(h)->idroot),NULL);
459  hdh = temp;
460  }
461  killhdl2(*hd,hd,NULL);
462  if (IDPACKAGE(h)->libname!=NULL) omFree((ADDRESS)(IDPACKAGE(h)->libname));
463  }
464  paKill(IDPACKAGE(h));
467  }
468  else if (IDTYP(h)==RING_CMD)
469  rKill(h);
470  else if (IDDATA(h)!=NULL)
472  // general -------------------------------------------------------------
473  // now dechain it and delete idrec
474  if (IDID(h)!=NULL) // OB: ?????
475  omFree((ADDRESS)IDID(h));
476  IDID(h)=NULL;
477  IDDATA(h)=NULL;
478  if (h == (*ih))
479  {
480  // h is at the beginning of the list
481  *ih = IDNEXT(h) /* ==*ih */;
482  }
483  else if (ih!=NULL)
484  {
485  // h is somethere in the list:
486  hh = *ih;
487  loop
488  {
489  if (hh==NULL)
490  {
491  PrintS(">>?<< not found for kill\n");
492  return;
493  }
494  idhdl hhh = IDNEXT(hh);
495  if (hhh == h)
496  {
497  IDNEXT(hh) = IDNEXT(hhh);
498  break;
499  }
500  hh = hhh;
501  }
502  }

◆ killid()

void killid ( const char *  a,
idhdl i 
)

Definition at line 356 of file ipid.cc.

358 {
359  if (id!=NULL)
360  {
361  idhdl h = (*ih)->get(id,myynest);
362 
363  // id not found in global list, is it defined in current ring ?
364  if (h==NULL)
365  {
366  if ((currRing!=NULL) && (*ih != (currRing->idroot)))
367  {
368  h = currRing->idroot->get(id,myynest);
369  if (h!=NULL)
370  {
371  killhdl2(h,&(currRing->idroot),currRing);
372  return;
373  }
374  }
375  Werror("`%s` is not defined",id);
376  return;
377  }
378  killhdl2(h,ih,currRing);
379  }
380  else
381  WerrorS("kill what ?");

◆ load_builtin()

BOOLEAN load_builtin ( const char *  newlib,
BOOLEAN  autoexport,
SModulFunc_t  init 
)

Definition at line 1239 of file iplib.cc.

1241 {
1242  int iiAddCproc(const char *libname, const char *procname, BOOLEAN pstatic,
1243  BOOLEAN(*func)(leftv res, leftv v));
1244 /*
1245  typedef int (*fktn_t)(int(*iiAddCproc)(const char *libname, const char *procname,
1246  BOOLEAN pstatic,
1247  BOOLEAN(*func)(leftv res, leftv v)));
1248 */
1249  // SModulFunc_t fktn;
1250  idhdl pl;
1251  char *plib = iiConvName(newlib);
1252  // BOOLEAN RET=TRUE;
1253  // int token;
1254 
1255  pl = basePack->idroot->get(plib,0); // search PACKAGE only in Top
1256  if ((pl!=NULL)
1257  &&(IDTYP(pl)==PACKAGE_CMD))
1258  {
1259  if(IDPACKAGE(pl)->language==LANG_C)
1260  {
1261  if (BVERBOSE(V_LOAD_LIB)) Warn( "(builtin) %s already loaded", newlib);
1262  omFree(plib);
1263  return FALSE;
1264  }
1265  }
1266  else
1267  {
1268  pl = enterid( plib,0, PACKAGE_CMD, &IDROOT, TRUE );
1269  IDPACKAGE(pl)->libname=omStrDup(newlib);
1270  }
1271  IDPACKAGE(pl)->language = LANG_C;
1272 
1273  IDPACKAGE(pl)->handle=(void *)NULL;
1274  SModulFunctions sModulFunctions;
1275 
1276  package s=currPack;
1277  currPack=IDPACKAGE(pl);
1278  if( init!= NULL)
1279  {
1280  sModulFunctions.iiArithAddCmd = iiArithAddCmd;
1281  if (autoexport) sModulFunctions.iiAddCproc = iiAddCprocTop;
1282  else sModulFunctions.iiAddCproc = iiAddCproc;
1283  (*init)(&sModulFunctions);
1284  }
1285  if (BVERBOSE(V_LOAD_LIB)) Print( "// ** loaded (builtin) %s \n", newlib);
1286  currPack->loaded=1;
1287  currPack=s;
1288 
1289  return FALSE;

◆ module_help_main()

void module_help_main ( const char *  newlib,
const char *  help 
)

Definition at line 1291 of file iplib.cc.

1293 {
1294  char *plib = iiConvName(newlib);
1295  idhdl pl = basePack->idroot->get(plib,0);
1296  if ((pl==NULL)||(IDTYP(pl)!=PACKAGE_CMD))
1297  Werror(">>%s<< is not a package (trying to add package help)",plib);
1298  else
1299  {
1300  package s=currPack;
1301  currPack=IDPACKAGE(pl);
1302  idhdl h=enterid("info",0,STRING_CMD,&IDROOT,FALSE);
1303  IDSTRING(h)=omStrDup(help);
1304  currPack=s;
1305  }

◆ module_help_proc()

void module_help_proc ( const char *  newlib,
const char *  p,
const char *  help 
)

Definition at line 1306 of file iplib.cc.

1308 {
1309  char *plib = iiConvName(newlib);
1310  idhdl pl = basePack->idroot->get(plib,0);
1311  if ((pl==NULL)||(IDTYP(pl)!=PACKAGE_CMD))
1312  Werror(">>%s<< is not a package(trying to add help for %s)",plib,p);
1313  else
1314  {
1315  package s=currPack;
1316  currPack=IDPACKAGE(pl);
1317  char buff[256];
1318  buff[255]='\0';
1319  strncpy(buff,p,255);
1320  strncat(buff,"_help",255-strlen(p));
1321  idhdl h=enterid(buff,0,STRING_CMD,&IDROOT,FALSE);
1322  IDSTRING(h)=omStrDup(help);
1323  currPack=s;
1324  }

◆ packFindHdl()

idhdl packFindHdl ( package  r)

Definition at line 749 of file ipid.cc.

751 {
752  idhdl h=basePack->idroot;
753  while (h!=NULL)
754  {
755  if ((IDTYP(h)==PACKAGE_CMD)
756  && (IDPACKAGE(h)==r))
757  return h;
758  h=IDNEXT(h);
759  }
760  return NULL;

◆ paCopy()

package paCopy ( package  pack)
inline

Definition at line 42 of file ipid.h.

44 {
45  pack->ref++;
46  return pack;

◆ paKill()

void paKill ( package  pack)
inline

Definition at line 48 of file ipid.h.

50 {
51  pack->ref--;

Variable Documentation

◆ basePack

EXTERN_VAR package basePack

Definition at line 16 of file ipid.h.

◆ basePackHdl

EXTERN_VAR idhdl basePackHdl

Definition at line 14 of file ipid.h.

◆ coeffs_BIGINT

EXTERN_VAR coeffs coeffs_BIGINT

Definition at line 141 of file ipid.h.

◆ currPack

EXTERN_VAR package currPack

Definition at line 15 of file ipid.h.

◆ currPackHdl

EXTERN_VAR idhdl currPackHdl

Definition at line 13 of file ipid.h.

◆ currRingHdl

EXTERN_VAR idhdl currRingHdl

Definition at line 76 of file ipid.h.

◆ idrec_bin

EXTERN_VAR omBin idrec_bin

Definition at line 138 of file ipid.h.

◆ optionStruct

const struct soptionStruct optionStruct[]

Definition at line 521 of file misc_ip.cc.

◆ procstack

EXTERN_VAR proclevel* procstack

Definition at line 64 of file ipid.h.

◆ sip_command_bin

EXTERN_VAR omBin sip_command_bin

Definition at line 136 of file ipid.h.

◆ sip_package_bin

EXTERN_VAR omBin sip_package_bin

Definition at line 137 of file ipid.h.

◆ sleftv_bin

EXTERN_VAR omBin sleftv_bin

Definition at line 139 of file ipid.h.

◆ verboseStruct

const struct soptionStruct verboseStruct[]

Definition at line 551 of file misc_ip.cc.

FALSE
#define FALSE
Definition: auxiliary.h:96
sleftv::Data
void * Data()
Definition: subexpr.cc:1175
iiCheckPack
void iiCheckPack(package &p)
Definition: ipshell.cc:1538
SModulFunctions::iiArithAddCmd
int(* iiArithAddCmd)(const char *szName, short nAlias, short nTokval, short nToktype, short nPos)
Definition: ipid.h:70
FLAG_TWOSTD
#define FLAG_TWOSTD
Definition: ipid.h:104
omFree
#define omFree(addr)
Definition: omAllocDecl.h:259
idDelete
#define idDelete(H)
delete an ideal
Definition: ideals.h:28
CRING_CMD
Definition: tok.h:55
NUMBER_CMD
Definition: grammar.cc:288
procinfov
procinfo * procinfov
Definition: structs.h:64
bigintmat
Definition: bigintmat.h:49
BIGINT_CMD
Definition: tok.h:37
LIST_CMD
Definition: tok.h:117
ADDRESS
void * ADDRESS
Definition: auxiliary.h:135
enterid
idhdl enterid(const char *s, int lev, int t, idhdl *root, BOOLEAN init, BOOLEAN search)
Definition: ipid.cc:264
MODUL_CMD
Definition: grammar.cc:287
STRING_CMD
Definition: tok.h:183
h
STATIC_VAR Poly * h
Definition: janet.cc:971
CNUMBER_CMD
Definition: tok.h:46
map
CanonicalForm map(const CanonicalForm &primElem, const Variable &alpha, const CanonicalForm &F, const Variable &beta)
map from to such that is mapped onto
Definition: cf_map_ext.cc:400
search
int search(const CFArray &A, const CanonicalForm &F, int i, int j)
search for F in A between index i and j
Definition: facSparseHensel.h:566
MAX_TOK
Definition: tok.h:216
IDDATA
#define IDDATA(a)
Definition: ipid.h:120
rKill
void rKill(ring r)
Definition: ipshell.cc:6123
procinfo
Definition: subexpr.h:52
omStrDup
#define omStrDup(s)
Definition: omAllocDecl.h:261
DEF_CMD
Definition: tok.h:57
V_LOAD_LIB
#define V_LOAD_LIB
Definition: options.h:45
omAllocBin
#define omAllocBin(bin)
Definition: omAllocDecl.h:203
BIGINTMAT_CMD
Definition: grammar.cc:278
omAlloc0Bin
#define omAlloc0Bin(bin)
Definition: omAllocDecl.h:204
pDelete
#define pDelete(p_ptr)
Definition: polys.h:175
loop
#define loop
Definition: structs.h:79
sleftv
Class used for (list of) interpreter objects.
Definition: subexpr.h:81
idhdl
idrec * idhdl
Definition: ring.h:20
RING_CMD
Definition: grammar.cc:281
RingDependend
int RingDependend(int t)
Definition: gentable.cc:27
MATRIX_CMD
Definition: grammar.cc:286
IDLIST
#define IDLIST(a)
Definition: ipid.h:131
currPack
VAR package currPack
Definition: ipid.cc:56
IDLEV
#define IDLEV(a)
Definition: ipid.h:115
iiAddCproc
int iiAddCproc(const char *libname, const char *procname, BOOLEAN pstatic, BOOLEAN(*func)(leftv res, leftv v))
Definition: iplib.cc:1005
pi
#define pi
Definition: libparse.cc:1144
packFindHdl
idhdl packFindHdl(package r)
Definition: ipid.cc:749
BEGIN_RING
Definition: grammar.cc:282
currPackHdl
VAR idhdl currPackHdl
Definition: ipid.cc:54
TRUE
#define TRUE
Definition: auxiliary.h:100
hasFlag
#define hasFlag(A, F)
Definition: ipid.h:106
res
CanonicalForm res
Definition: facAbsFact.cc:64
INT_CMD
Definition: tok.h:95
CPOLY_CMD
Definition: tok.h:47
PrintS
void PrintS(const char *s)
Definition: reporter.cc:283
BOOLEAN
int BOOLEAN
Definition: auxiliary.h:87
killhdl2
void killhdl2(idhdl h, idhdl *ih, ring r)
Definition: ipid.cc:414
PROC_CMD
Definition: grammar.cc:280
iiConvName
char * iiConvName(const char *libname)
Definition: iplib.cc:1373
IDROOT
#define IDROOT
Definition: ipid.h:17
sBucketCreate
sBucket_pt sBucketCreate(const ring r)
Definition: sbuckets.cc:94
IDEAL_CMD
Definition: grammar.cc:284
lRingDependend
BOOLEAN lRingDependend(lists L)
Definition: lists.cc:198
paKill
void paKill(package pack)
Definition: ipid.h:48
intvec
Definition: intvec.h:18
sleftv::data
void * data
Definition: subexpr.h:87
LANG_C
Definition: subexpr.h:22
iiArithAddCmd
int iiArithAddCmd(const char *szName, short nAlias, short nTokval, short nToktype, short nPos)
Definition: iparith.cc:9352
n_Init
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
Definition: coeffs.h:537
END_RING
Definition: grammar.cc:310
VECTOR_CMD
Definition: grammar.cc:292
idrec_bin
VAR omBin idrec_bin
Definition: ipid.cc:47
IDTYP
#define IDTYP(a)
Definition: ipid.h:113
iiAddCprocTop
int iiAddCprocTop(const char *libname, const char *procname, BOOLEAN pstatic, BOOLEAN(*func)(leftv res, leftv v))
Definition: iplib.cc:1080
procinfo_bin
VAR omBin procinfo_bin
Definition: subexpr.cc:41
ipSwapId
static int ipSwapId(idhdl tomove, idhdl &root1, idhdl &root2)
Definition: ipid.cc:595
slists::m
sleftv * m
Definition: lists.h:45
LANG_NONE
Definition: subexpr.h:22
sleftv::e
Subexpr e
Definition: subexpr.h:104
kNF
poly kNF(ideal F, ideal Q, poly p, int syzComp, int lazyReduce)
Definition: kstd1.cc:2823
help
#define help
Definition: libparse.cc:1229
IDRING
#define IDRING(a)
Definition: ipid.h:121
slists
Definition: lists.h:22
INTVEC_CMD
Definition: tok.h:100
INTMAT_CMD
Definition: grammar.cc:279
idrec
Definition: idrec.h:33
IDPACKAGE
#define IDPACKAGE(a)
Definition: ipid.h:133
BUCKET_CMD
Definition: grammar.cc:283
BVERBOSE
#define BVERBOSE(a)
Definition: options.h:33
Print
#define Print
Definition: emacs.cc:79
QRING_CMD
Definition: tok.h:157
slists_bin
VAR omBin slists_bin
Definition: lists.cc:22
FLAG_QRING
#define FLAG_QRING
Definition: ipid.h:105
Werror
void Werror(const char *fmt,...)
Definition: reporter.cc:188
idInit
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:34
PACKAGE_CMD
Definition: tok.h:148
myynest
VAR int myynest
Definition: febase.cc:40
IDHDL
#define IDHDL
Definition: tok.h:30
WerrorS
void WerrorS(const char *s)
Definition: feFopen.cc:24
sleftv::Typ
int Typ()
Definition: subexpr.cc:1032
m
int m
Definition: cfEzgcd.cc:121
basePack
VAR package basePack
Definition: ipid.cc:57
SModulFunctions
Definition: ipid.h:66
sleftv::rtyp
int rtyp
Definition: subexpr.h:90
NULL
#define NULL
Definition: omList.c:11
MAP_CMD
Definition: grammar.cc:285
lists
slists * lists
Definition: mpr_numeric.h:145
coeffs_BIGINT
VAR coeffs coeffs_BIGINT
Definition: ipid.cc:49
my_yylinebuf
VAR char my_yylinebuf[80]
Definition: febase.cc:42
l
int l
Definition: cfEzgcd.cc:93
IDSTRING
#define IDSTRING(a)
Definition: ipid.h:130
IDNEXT
#define IDNEXT(a)
Definition: ipid.h:112
currRingHdl
VAR idhdl currRingHdl
Definition: ipid.cc:58
s_internalDelete
void s_internalDelete(const int t, void *d, const ring r)
Definition: subexpr.cc:513
pa
BOOLEAN pa(leftv res, leftv args)
Definition: cohomo.cc:4346
Warn
#define Warn
Definition: emacs.cc:76
v
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
slists::Init
INLINE_THIS void Init(int l=0)
p
int p
Definition: cfModGcd.cc:4019
setFlag
#define setFlag(A, F)
Definition: ipid.h:107
currRing
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:13
s
const CanonicalForm int s
Definition: facAbsFact.cc:55
RESOLUTION_CMD
Definition: grammar.cc:290
nInit
#define nInit(i)
Definition: numbers.h:23
POLY_CMD
Definition: grammar.cc:289
SModulFunctions::iiAddCproc
int(* iiAddCproc)(const char *libname, const char *procname, BOOLEAN pstatic, BOOLEAN(*func)(leftv res, leftv v))
Definition: ipid.h:68
IDID
#define IDID(a)
Definition: ipid.h:116
pNormalize
#define pNormalize(p)
Definition: polys.h:301
FLAG_STD
#define FLAG_STD
Definition: ipid.h:103
V_REDEFINE
#define V_REDEFINE
Definition: options.h:43
idrec::set
idhdl set(const char *s, int lev, int t, BOOLEAN init=TRUE)
Definition: ipid.cc:222
omFreeBin
#define omFreeBin(addr, bin)
Definition: omAllocDecl.h:257
TEST_V_ALLWARN
#define TEST_V_ALLWARN
Definition: options.h:138
getBlackboxStuff
blackbox * getBlackboxStuff(const int t)
return the structure to the type given by t
Definition: blackbox.cc:16
LINK_CMD
Definition: tok.h:116
CMATRIX_CMD
Definition: tok.h:45
omAlloc0
#define omAlloc0(size)
Definition: omAllocDecl.h:209
IDIDEAL
#define IDIDEAL(a)
Definition: ipid.h:127
ssyStrategy
Definition: syz.h:36
SMATRIX_CMD
Definition: grammar.cc:291