source: git/kernel/structs.h @ 61a2d93

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