source: git/kernel/structs.h @ 8c5988

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