source: git/kernel/structs.h @ 7567b0

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