source: git/kernel/structs.h @ fc5095

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