source: git/kernel/structs.h @ 98938c

spielwiese
Last change on this file since 98938c was 6c0f53, checked in by Viktor Levandovskyy <levandov@…>, 20 years ago
*levandov: new interface for plural git-svn-id: file:///usr/local/Singular/svn/trunk@6975 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 19.8 KB
Line 
1#ifndef STRUCTS_H
2#define STRUCTS_H
3/****************************************
4*  Computer Algebra System SINGULAR     *
5****************************************/
6/* $Id: structs.h,v 1.3 2003-12-16 18:30:31 levandov Exp $ */
7/*
8* ABSTRACT
9*/
10
11#include <string.h> /* for memset */
12
13#define LONGALGNEW
14/* standard types */
15typedef unsigned char  uchar ;
16typedef unsigned short CARDINAL;
17typedef short BOOLEAN;
18
19typedef void * Sy_reference;
20#define ADDRESS Sy_reference
21#define BITSET  unsigned int
22
23/* EXPONENT_TYPE is determined by configure und defined in mod2.h */
24/* the following defines should really go into mod2.h,
25   but configure dislikes it */
26
27
28// define if a*b is with mod instead of tables
29#if defined(i386)
30// seems to be better on i386 processors
31#define HAVE_MULT_MOD
32#ifdef HAVE_MULT_MOD
33/* #define HAVE_DIV_MOD*/
34#endif
35#endif
36
37typedef long Exponent_t;
38typedef long Order_t;
39
40enum tHomog
41{
42   isNotHomog = FALSE,
43   isHomog    = TRUE,
44   testHomog
45};
46enum noeof_t
47{
48  noeof_brace = 1,
49  noeof_asstring,
50  noeof_block,
51  noeof_bracket,
52  noeof_comment,
53  noeof_procname,
54  noeof_string
55};
56
57enum n_coeffType
58{
59  n_unknown=0,
60  n_Zp,
61  n_Q,
62  n_R,
63  n_GF,
64  n_long_R,
65  n_Zp_a,
66  n_Q_a,
67  n_long_C
68};
69
70#ifdef HAVE_PLURAL
71enum nc_type
72{
73  nc_general=0, /* yx=q xy+... */
74  nc_skew, /*1*/ /* yx=q xy */
75  nc_comm, /*2*/ /* yx= xy */
76  nc_lie,  /*3*/ /* yx=xy+... */
77  nc_undef /*4*/  /* for internal reasons */
78};
79#endif
80
81
82/* C++-part */
83#ifdef __cplusplus
84class ip_smatrix;
85class idrec;
86class intvec;
87class sleftv;
88class slists;
89class sattr;
90class skStrategy;
91class ssyStrategy;
92class procinfo;
93class namerec;
94class kBucket;
95class sBucket;
96#endif
97
98struct n_Procs_s;
99struct sip_sring;
100struct sip_sideal;
101struct sip_link;
102struct spolynom;
103struct _ssubexpr;
104struct _sssym;
105struct snumber;
106struct sip_command;
107struct sip_package;
108struct s_si_link_extension;
109#ifndef LONGALGNEW
110struct reca;
111#endif /* not LONGALGNEW */
112
113typedef struct  n_Procs_s  n_Procs_s;
114
115#ifdef HAVE_PLURAL
116struct nc_struct;
117typedef struct nc_struct   nc_struct;
118#endif
119
120typedef struct _ssubexpr   sSubexpr;
121typedef struct _sssym      ssym;
122typedef struct spolyrec    polyrec;
123typedef struct sip_sideal  ip_sideal;
124typedef struct sip_smap    ip_smap;
125typedef struct sip_sring   ip_sring;
126typedef struct sip_link    ip_link;
127typedef struct sip_command ip_command;
128typedef struct sip_package ip_package;
129
130/* the pointer types */
131typedef char *             char_ptr;
132typedef int  *             int_ptr;
133typedef short *            short_ptr;
134typedef void *             void_ptr;
135typedef ip_sring *         ring;
136typedef int                idtyp;
137typedef struct snumber *   number;
138typedef polyrec *          poly;
139typedef poly *             polyset;
140typedef ip_sideal *        ideal;
141typedef ip_smap *          map;
142typedef struct sideal_list *      ideal_list;
143typedef ideal *            resolvente;
144typedef union uutypes      utypes;
145typedef ip_command *       command;
146typedef struct s_si_link_extension *si_link_extension;
147#ifndef LONGALGNEW
148typedef struct reca *      napoly;
149#else /* LONGALGNEW */
150typedef polyrec *   napoly;
151#endif /* LONGALGNEW */
152
153#ifdef __cplusplus
154typedef idrec *            idhdl;
155typedef ip_smatrix *       matrix;
156typedef ip_link *          si_link;
157typedef sleftv *           leftv;
158typedef slists *           lists;
159typedef sSubexpr *         Subexpr;
160typedef sattr *            attr;
161typedef skStrategy *       kStrategy;
162typedef ip_package *       package;
163typedef ssyStrategy *      syStrategy;
164typedef procinfo *         procinfov;
165typedef namerec *          namehdl;
166typedef kBucket*           kBucket_pt;
167typedef sBucket*           sBucket_pt;
168typedef struct p_Procs_s p_Procs_s;
169
170// for hdegree.cc
171typedef struct sindlist indlist;
172typedef indlist * indset;
173struct sindlist
174{
175  indset nx;
176  intvec * set;
177};
178
179// for longalg.cc
180struct snaIdeal
181{
182  int anz;
183  napoly *liste;
184};
185typedef struct snaIdeal * naIdeal;
186
187
188// for sparsemat.cc
189typedef struct smprec sm_prec;
190typedef sm_prec * smpoly;
191struct smprec
192{
193  smpoly n;            // the next element
194  int pos;             // position
195  int e;               // level
196  poly m;              // the element
197  float f;             // complexity of the element
198};
199
200struct _scmdnames
201{
202  char *name;
203  short alias;
204  short tokval;
205  short toktype;
206};
207typedef struct _scmdnames cmdnames;
208
209typedef number (*numberfunc)(number a,number b);
210typedef number (*nMapFunc)(number a);
211struct n_Procs_s
212{
213   n_Procs_s* next;
214   // the union stuff
215   // Zp:
216   int npPrimeM;
217   int npPminus1M;
218   #ifdef HAVE_DIV_MOD
219   CARDINAL *npInvTable;
220   #endif
221   #if !defined(HAVE_DIV_MOD) || !defined(HAVE_MULT_MOD)
222   CARDINAL *npExpTable;
223   CARDINAL *npLogTable;
224   #endif
225   // Zp_a, Q_a
226
227   // general stuff
228   numberfunc nMult, nSub ,nAdd ,nDiv, nIntDiv, nIntMod, nExactDiv;
229   void    (*nNew)(number * a);
230   number  (*nInit)(int i);
231   number  (*nPar)(int i);
232   int     (*nParDeg)(number n);
233   int     (*nSize)(number n);
234   int     (*nInt)(number &n);
235   number  (*nNeg)(number a);
236   number  (*nInvers)(number a);
237   number  (*nCopy)(number a);
238   number  (*cfCopy)(number a, const ring r);
239   number  (*nRePart)(number a);
240   number  (*nImPart)(number a);
241   void    (*nWrite)(number &a);
242   char *  (*nRead)(char * s, number * a);
243   void    (*nNormalize)(number &a);
244   BOOLEAN (*nGreater)(number a,number b),
245           (*nEqual)(number a,number b),
246           (*nIsZero)(number a),
247           (*nIsOne)(number a),
248           (*nIsMOne)(number a),
249           (*nGreaterZero)(number a);
250   void    (*nPower)(number a, int i, number * result);
251   number  (*n_GetDenom)(number &n, const ring r);
252   number  (*nGcd)(number a, number b, const ring r);
253   number  (*nLcm)(number a, number b, const ring r);
254   void    (*cfDelete)(number * a, const ring r);
255   nMapFunc (*cfSetMap)(ring src, ring dst);
256   char *  (*nName)(number n);
257   void    (*nInpMult)(number &a, number b, ring r);
258//extern number  (*nMap)(number from);
259
260   number nNULL; /* the 0 as constant */
261   int     char_flag;
262   int     ref;
263   short   nChar;
264   n_coeffType type;
265};
266/* current ring stuff */
267
268extern ring      currRing;
269extern ideal     currQuotient;
270extern idhdl      currRingHdl;
271
272#ifndef HAVE_NS
273extern idhdl      idroot;
274#define IDROOT idroot
275#endif /* ! HAVE_NS */
276
277#ifdef HAVE_NS
278extern idhdl currPackHdl;
279extern idhdl basePackHdl;
280extern package currPack;
281extern package basePack;
282#define IDROOT (currPack->idroot)
283#endif /* HAVE_NS */
284
285/* the function pointer types */
286
287typedef long     (*pLDegProc)(poly p, int *length, ring r= currRing);
288typedef long     (*pFDegProc)(poly p, ring r = currRing);
289typedef void     (*p_SetmProc)(poly p, ring r = currRing);
290
291typedef enum
292{
293  ro_dp, // ordering is a degree ordering
294  ro_wp, // ordering is a weighted degree ordering
295  ro_wp_neg, // ordering is a weighted degree ordering
296             // with possibly negative weights
297  ro_cp,    // ordering duplicates variables
298  ro_syzcomp, // ordering indicates "subset" of component number
299  ro_syz, // ordering  with component number >syzcomp is lower
300  ro_none
301}
302ro_typ;
303
304// ordering is a degree ordering
305struct sro_dp
306{
307  short place;  // where degree is stored (in L):
308  short start;  // bounds of ordering (in E):
309  short end;
310};
311typedef struct sro_dp sro_dp;
312
313// ordering is a weighted degree ordering
314struct sro_wp
315{
316  short place;  // where weighted degree is stored (in L)
317  short start;  // bounds of ordering (in E)
318  short end;
319  int *weights; // pointers into wvhdl field
320};
321typedef struct sro_wp sro_wp;
322
323// ordering duplicates variables
324struct sro_cp
325{
326  short place;  // where start is copied to (in E)
327  short start;  // bounds of sources of copied variables (in E)
328  short end;
329};
330typedef struct sro_cp sro_cp;
331
332// ordering indicates "subset" of component number
333struct sro_syzcomp
334{
335  short place;  // where the index is stored (in L)
336  long *ShiftedComponents; // pointer into index field
337  int* Components;
338#ifdef PDEBUG
339  long length;
340#endif
341};
342typedef struct sro_syzcomp sro_syzcomp;
343
344// ordering  with component number >syzcomp is lower
345struct sro_syz
346{
347  short place;       // where the index is stored (in L)
348  int limit;         // syzcomp
349  int* syz_index;    // mapping Component -> SyzIndex for Comp <= limit
350  int  curr_index;   // SyzIndex for Component > limit
351};
352
353typedef struct sro_syz sro_syz;
354
355#ifndef OM_ALLOC_H
356struct omBin_s;
357#endif
358
359struct sro_ord
360{
361  ro_typ  ord_typ;
362  int     order_index; // comes from r->order[order_index]
363  union
364  {
365     sro_dp dp;
366     sro_wp wp;
367     sro_cp cp;
368     sro_syzcomp syzcomp;
369     sro_syz syz;
370  } data;
371};
372
373#ifdef HAVE_PLURAL
374struct nc_struct
375{
376  short ref;
377  nc_type type;
378  ring basering; // the ring C,D,.. live in
379  matrix C;
380  matrix D;
381  matrix *MT;
382  matrix COM;
383  int *MTsize;
384  int IsSkewConstant; /* indicates whethere coeffs C_ij are all equal */
385  /* effective together with nc_type=nc_skew */
386};
387#endif
388
389struct sip_sring
390{
391  idhdl      idroot; /* local objects */
392  int*       order;  /* array of orderings */
393  int*       block0; /* starting pos.*/
394  int*       block1; /* ending pos.*/
395  char**     parameter; /* names of parameters */
396  number     minpoly;
397  int**      wvhdl;  /* array of weight vectors */
398  char **    names;  /* array of variable names */
399
400  unsigned long options; /* ring dependent options */
401
402  // what follows below here should be set by rComplete, _only_
403  long      *ordsgn;  /* array of +/- 1 (or 0) for comparing monomials */
404                       /*  ExpL_Size entries*/
405
406  // is NULL for lp or N == 1, otherwise non-NULL (with OrdSize > 0 entries) */
407  sro_ord*   typ;   /* array of orderings + sizes, OrdSize entries */
408
409  ideal      qideal; /* extension to the ring structure: qring */
410
411
412  int      *VarOffset;
413  int*     firstwv;
414
415  struct omBin_s*   PolyBin; /* Bin from where monoms are allocated */
416  short      ch;     /* characteristic */
417  short      float_len; /* additional char-flags */
418  short      float_len2; /* additional char-flags */
419
420  short      N;      /* number of vars */
421
422  short      P;      /* number of pars */
423  short      OrdSgn; /* 1 for polynomial rings, -1 otherwise */
424
425  short     firstBlockEnds;
426
427
428  BOOLEAN   VectorOut;
429  BOOLEAN   ShortOut;
430  BOOLEAN   CanShortOut;
431  BOOLEAN   LexOrder;
432  // TRUE if the monomial ordering has polynomial and power series blocks
433  BOOLEAN   MixedOrder;
434  // 1 for lex ordering (except ls), -1 otherwise
435  BOOLEAN   ComponentOrder;
436
437
438  // what follows below here should be set by rComplete, _only_
439  // contains component, but no weight fields in E */
440  short      ExpL_Size; // size of exponent vector in long
441  short      CmpL_Size; // portions which need to be compared
442  /* number of long vars in exp vector:
443     long vars are those longs in the exponent vector which are
444     occupied by variables, only */
445  short     VarL_Size;
446
447  short      BitsPerExp; /* number of bits per exponent */
448  short      ExpPerLong; /* maximal number of Exponents per long */
449
450  short      pCompIndex; /* p->exp.e[pCompIndex] is the component */
451  short      pOrdIndex; /* p->exp[pOrdIndex] is pGetOrd(p) */
452
453  short      OrdSize; /* size of ord vector (in sro_ord) */
454
455
456  short      ref; /* reference counter to the ring */
457
458  /* if >= 0, long vars in exp vector are consecutive and start there
459     if <  0, long vars in exp vector are not consecutive */
460  short     VarL_LowIndex;
461  // number of exponents in r->VarL_Offset[0]
462  // is minimal number of exponents in a long var
463  short     MinExpPerLong;
464
465  /* if this is > 0, then NegWeightL_Offset[0..size_1] is index of longs in
466   ExpVector whose values need an offset due to negative weights */
467  short     NegWeightL_Size;
468  /* array of NegWeigtL_Size indicies */
469  int*      NegWeightL_Offset;
470
471  /* array of size VarL_Size,
472     VarL_Offset[i] gets i-th long var in exp vector */
473  int*      VarL_Offset;
474
475  /* mask for getting single exponents */
476  unsigned long bitmask;
477  /* mask used for divisiblity tests */
478  unsigned long divmask;
479
480  p_Procs_s*    p_Procs;
481
482  /* FDeg and LDeg */
483  pFDegProc     pFDeg;
484  pLDegProc     pLDeg;
485
486  /* as it was determined by rComplete */
487  pFDegProc     pFDegOrig;
488  /* and as it was determined before rOptimizeLDeg */
489  pLDegProc     pLDegOrig;
490
491  p_SetmProc    p_Setm;
492  n_Procs_s*    cf;
493  ring          algring;
494#ifdef HAVE_PLURAL
495  nc_struct     *nc;
496#endif
497};
498
499struct sip_sideal
500{
501  poly*  m;
502  long rank;
503  int nrows;
504  int ncols;
505  #define IDELEMS(i) ((i)->ncols)
506  inline int& idelems(void) { return ncols; }
507};
508
509struct sip_smap
510{
511  poly *m;
512  char *preimage;
513  int nrows;
514  int ncols;
515};
516
517struct sideal_list
518{
519  ideal_list next;
520  ideal      d;
521};
522#endif /* __cplusplus */
523
524
525
526/*
527**  7. runtime procedures/global data
528*/
529
530/* 7.1 C-routines : */
531
532
533#ifdef __cplusplus
534extern "C" {
535#endif
536void  m2_end(short i);
537#ifdef __cplusplus
538}
539#endif
540
541/* 7.2 C++-routines : */
542
543#ifdef __cplusplus
544int   inits(void);
545int   IsPrime(int i);
546#ifdef buildin_rand
547extern int siSeed;
548int siRand();
549#endif
550#endif
551
552/*the general set of std-options --> kutil.cc */
553extern BITSET test;
554/*the general set of verbose-options --> febase.cc */
555#ifdef __cplusplus
556extern "C" BITSET verbose;
557#else
558extern BITSET verbose;
559#endif
560/*debugging the bison grammar --> grammar.cc*/
561#ifdef YYDEBUG
562#if YYDEBUG
563extern int    yydebug;
564#endif
565#endif
566
567extern int      yylineno;
568extern char     my_yylinebuf[80];
569
570#define loop for(;;)
571
572#ifndef ABS
573#define ABS(x) ((x)<0?(-(x)):(x))
574#endif
575
576#if defined(__cplusplus)
577inline int si_max(const int a, const int b)  { return (a>b) ? a : b; }
578inline int si_min(const int a, const int b)  { return (a<b) ? a : b; }
579#if defined(DecAlpha_Linux) || defined(IA64_Linux)
580inline long si_max(const long a, const long b)  { return (a>b) ? a : b; }
581inline long si_min(const long a, const long b)  { return (a<b) ? a : b; }
582#endif
583#else
584#define si_max(A,B) ((A) > (B) ? (A) : (B))
585#define si_min(A,B) ((A) < (B) ? (A) : (B))
586#endif
587
588/*
589**  Set operations (small sets only)
590*/
591
592#define Sy_bit(x)     ((unsigned)1<<(x))
593#define Sy_inset(x,s) ((Sy_bit(x)&(s))?TRUE:FALSE)
594#define BTEST1(a)     Sy_inset((a), test)
595#define BVERBOSE(a)   Sy_inset((a), verbose)
596
597/*
598** defines for BITSETs
599*/
600
601#define V_SHOW_MEM  2
602#define V_YACC      3
603#define V_REDEFINE  4
604#define V_READING   5
605#define V_LOAD_LIB  6
606#define V_DEBUG_LIB 7
607#define V_LOAD_PROC 8
608#define V_DEF_RES   9
609#define V_DEBUG_MEM 10
610#define V_SHOW_USE  11
611#define V_IMAP      12
612#define V_PROMPT    13
613#define V_NSB       14
614#define V_CONTENTSB 15
615#define V_CANCELUNIT 16
616#define V_DEG_STOP  31
617
618
619#define OPT_PROT           0
620#define OPT_REDSB          1
621#define OPT_NOT_BUCKETS    2
622#define OPT_NOT_SUGAR      3
623#define OPT_INTERRUPT      4
624#define OPT_SUGARCRIT      5
625#define OPT_DEBUG          6
626#define OPT_REDTHROUGH     7
627#define OPT_RETURN_SB      9
628#define OPT_FASTHC        10
629#define OPT_OLDSTD        20
630#define OPT_KEEPVARS      21
631#define OPT_STAIRCASEBOUND 22
632#define OPT_MULTBOUND     23
633#define OPT_DEGBOUND      24
634#define OPT_REDTAIL       25
635#define OPT_INTSTRATEGY   26
636#define OPT_INFREDTAIL    28
637#define OPT_SB_1          29
638#define OPT_NOTREGULARITY 30
639#define OPT_WEIGHTM       31
640
641/* define ring dependent options */
642#define TEST_RINGDEP_OPTS \
643 (Sy_bit(OPT_INTSTRATEGY) | Sy_bit(OPT_REDTHROUGH) | Sy_bit(OPT_REDTAIL))
644
645#define TEST_OPT_PROT              BTEST1(OPT_PROT)
646#define TEST_OPT_REDSB             BTEST1(OPT_REDSB)
647#define TEST_OPT_NOT_BUCKETS       BTEST1(OPT_NOT_BUCKETS)
648#define TEST_OPT_NOT_SUGAR         BTEST1(OPT_NOT_SUGAR)
649#define TEST_OPT_SUGARCRIT         BTEST1(OPT_SUGARCRIT)
650#define TEST_OPT_DEBUG             BTEST1(OPT_DEBUG)
651#define TEST_OPT_FASTHC            BTEST1(OPT_FASTHC)
652#define TEST_OPT_INTSTRATEGY       BTEST1(OPT_INTSTRATEGY)
653#define TEST_OPT_RETURN_SB         BTEST1(OPT_RETURN_SB)
654#define TEST_OPT_KEEPVARS          BTEST1(OPT_KEEPVARS)
655#define TEST_OPT_DEGBOUND          BTEST1(OPT_DEGBOUND)
656#define TEST_OPT_MULTBOUND         BTEST1(OPT_MULTBOUND)
657#define TEST_OPT_STAIRCASEBOUND    BTEST1(OPT_STAIRCASEBOUND)
658#define TEST_OPT_REDTAIL           BTEST1(OPT_REDTAIL)
659#define TEST_OPT_INFREDTAIL        BTEST1(OPT_INFREDTAIL)
660#define TEST_OPT_SB_1              BTEST1(OPT_SB_1)
661#define TEST_OPT_NOTREGULARITY     BTEST1(OPT_NOTREGULARITY)
662#define TEST_OPT_WEIGHTM           BTEST1(OPT_WEIGHTM)
663#define TEST_OPT_REDTHROUGH        BTEST1(OPT_REDTHROUGH)
664#define TEST_OPT_OLDSTD            BTEST1(OPT_OLDSTD)
665#define TEST_OPT_CONTENTSB         BVERBOSE(V_CONTENTSB)
666#define TEST_OPT_CANCELUNIT        BVERBOSE(V_CANCELUNIT)
667
668#define TEST_VERB_NSB              BVERBOSE(V_NSB)
669#define TEST_V_DEG_STOP            BVERBOSE(V_DEG_STOP)
670
671
672#ifdef HAVE_LIBPARSER
673#ifdef __cplusplus
674class libstack;
675typedef libstack *  libstackv;
676#endif
677#endif /* HAVE_LIBPARSER */
678
679extern struct omBin_s* MP_INT_bin;
680extern struct omBin_s* char_ptr_bin;
681extern struct omBin_s* ideal_bin;
682extern struct omBin_s* int_bin;
683extern struct omBin_s* poly_bin;
684extern struct omBin_s* void_ptr_bin;
685extern struct omBin_s* indlist_bin;
686extern struct omBin_s* naIdeal_bin;
687extern struct omBin_s* snaIdeal_bin;
688extern struct omBin_s* sm_prec_bin;
689extern struct omBin_s* smprec_bin;
690extern struct omBin_s* sip_sideal_bin;
691extern struct omBin_s* sip_smap_bin;
692extern struct omBin_s* sip_sring_bin;
693extern struct omBin_s* ip_sideal_bin;
694extern struct omBin_s* ip_smap_bin;
695extern struct omBin_s* ip_sring_bin;
696extern struct omBin_s* sleftv_bin;
697
698#ifdef __cplusplus
699union uutypes
700{
701  int           i;
702  ring          uring;
703  poly          p;
704  number        n;
705  ideal         uideal;
706  map           umap;
707  matrix        umatrix;
708  char *        ustring;
709  intvec *      iv;
710  lists         l;
711  si_link       li;
712  package       pack;
713  procinfo *    pinf;
714};
715
716class idrec
717{
718  public:
719  /* !! do not change the first 6 entries !! (see subexpr.h: sleftv) */
720  idhdl      next;
721  char *     id;
722  utypes     data;
723  attr       attribute;
724  BITSET     flag;
725  idtyp      typ;
726
727  short      lev;
728  short      ref;
729
730#define IDNEXT(a)    ((a)->next)
731#define IDTYP(a)     ((a)->typ)
732#define IDFLAG(a)    ((a)->flag)
733#define IDLEV(a)     ((a)->lev)
734#define IDID(a)      ((a)->id)
735#define IDATTR(a)    ((a)->attribute)
736
737#define IDINT(a)    ((a)->data.i)
738#define IDDATA(a)   ((a)->data.ustring)
739#define IDRING(a)   ((a)->data.uring)
740#define IDINTVEC(a) ((a)->data.iv)
741#define IDPOLY(a)   ((a)->data.p)
742#define IDNUMBER(a) ((a)->data.n)
743#define IDIDEAL(a)  (((a)->data).uideal)
744#define IDMATRIX(a) (((a)->data).umatrix)
745#define IDMAP(a)    (((a)->data).umap)
746#define IDSTRING(a) ((a)->data.ustring)
747#define IDLIST(a)   ((a)->data.l)
748#define IDLINK(a)   ((a)->data.li)
749#define IDPACKAGE(a) ((a)->data.pack)
750#define IDPROC(a)   ((a)->data.pinf)
751
752  idrec() { memset(this,0,sizeof(*this)); }
753  idhdl get(const char * s, int lev);
754  idhdl set(char * s, int lev, idtyp t, BOOLEAN init=TRUE);
755  char * String();
756//  ~idrec();
757};
758
759class proc_singular
760{
761public:
762  long   proc_start;       // position where proc is starting
763  long   def_end;          // position where proc header is ending
764  long   help_start;       // position where help is starting
765  long   help_end;         // position where help is starting
766  long   body_start;       // position where proc-body is starting
767  long   body_end;         // position where proc-body is ending
768  long   example_start;    // position where example is starting
769  long   proc_end;         // position where proc is ending
770  int    proc_lineno;
771  int    body_lineno;
772  int    example_lineno;
773  char   *body;
774  long help_chksum;
775};
776
777struct proc_object
778{
779//public:
780  BOOLEAN (*function)(leftv res, leftv v);
781};
782
783union uprocinfodata;
784
785union uprocinfodata
786{
787public:
788  proc_singular  s;        // data of Singular-procedure
789  struct proc_object    o; // pointer to binary-function
790};
791
792typedef union uprocinfodata procinfodata;
793
794typedef enum { LANG_NONE, LANG_TOP, LANG_SINGULAR, LANG_C, LANG_MAX} language_defs;
795// LANG_TOP     : Toplevel package only
796// LANG_SINGULAR:
797// LANG_C       :
798class procinfo
799{
800public:
801  char          *libname;
802  char          *procname;
803#ifdef HAVE_NS
804  package       pack;
805#endif
806  language_defs language;
807  short         ref;
808  char          is_static;        // if set, proc not accessible for user
809  char          trace_flag;
810  procinfodata  data;
811};
812
813#endif
814
815#endif
816
Note: See TracBrowser for help on using the repository browser.