source: git/Singular/misc_ip.cc @ 6e0750

spielwiese
Last change on this file since 6e0750 was 8d38c87, checked in by Hans Schönemann <hannes@…>, 14 years ago
Singular/misc.cc ->Singular/misc_ip.cc git-svn-id: file:///usr/local/Singular/svn/trunk@12669 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 18.2 KB
Line 
1/****************************************
2*  Computer Algebra System SINGULAR     *
3****************************************/
4/*
5* ABSTRACT:
6*/
7
8#include <string.h>
9#include <unistd.h>
10#include <stdio.h>
11#include <stddef.h>
12#include <stdlib.h>
13#include <time.h>
14
15#include "mod2.h"
16#include <mylimits.h>
17#include "omalloc.h"
18#include "structs.h"
19#include "tok.h"
20#include "options.h"
21#include "febase.h"
22#include "cntrlc.h"
23#include "page.h"
24#include "ipid.h"
25#include "ipshell.h"
26#include "kstd1.h"
27#include "subexpr.h"
28#include "timer.h"
29#include "intvec.h"
30#include "ring.h"
31#include "omSingularConfig.h"
32#include "p_Procs.h"
33/* Needed for debug Version of p_SetRingOfLeftv, Oliver */
34#ifdef PDEBUG
35#include "p_polys.h"
36#endif
37#include "version.h"
38
39#include "static.h"
40#ifdef HAVE_STATIC
41#undef HAVE_DYN_RL
42#endif
43
44#define SI_DONT_HAVE_GLOBAL_VARS
45
46//#ifdef HAVE_LIBPARSER
47//#  include "libparse.h"
48//#endif /* HAVE_LIBPARSER */
49
50#ifdef HAVE_FACTORY
51#include <factory.h>
52// libfac:
53  extern const char * libfac_version;
54  extern const char * libfac_date;
55#endif
56
57/* version strings */
58#include <si_gmp.h>
59#ifdef HAVE_MPSR
60#include <MP_Config.h>
61#endif
62
63/*2
64* initialize components of Singular
65*/
66int inits(void)
67{
68  int t;
69/*4 signal handler:*/
70  init_signals();
71/*4 randomize: */
72  t=initTimer();
73  /*t=(int)time(NULL);*/
74  if (t==0) t=1;
75#ifdef HAVE_RTIMER
76  initRTimer();
77#endif
78#ifdef buildin_rand
79  siSeed=t;
80#else
81  srand((unsigned int)t);
82#endif
83#ifdef HAVE_FACTORY
84  factoryseed(t);
85#endif
86/*4 private data of other modules*/
87  memset(&sLastPrinted,0,sizeof(sleftv));
88  sLastPrinted.rtyp=NONE;
89  return t;
90}
91
92/*2
93* the renice routine for very large jobs
94* works only on unix machines,
95* testet on : linux, HP 9.0
96*
97*#include <sys/times.h>
98*#include <sys/resource.h>
99*extern "C" int setpriority(int,int,int);
100*void very_nice()
101*{
102*#ifndef NO_SETPRIORITY
103*  setpriority(PRIO_PROCESS,0,19);
104*#endif
105*  sleep(10);
106*}
107*/
108
109void singular_example(char *str)
110{
111  assume(str!=NULL);
112  char *s=str;
113  while (*s==' ') s++;
114  char *ss=s;
115  while (*ss!='\0') ss++;
116  while (*ss<=' ')
117  {
118    *ss='\0';
119    ss--;
120  }
121  idhdl h=IDROOT->get(s,myynest);
122  if ((h!=NULL) && (IDTYP(h)==PROC_CMD))
123  {
124    char *lib=iiGetLibName(IDPROC(h));
125    if((lib!=NULL)&&(*lib!='\0'))
126    {
127      Print("// proc %s from lib %s\n",s,lib);
128      s=iiGetLibProcBuffer(IDPROC(h), 2);
129      if (s!=NULL)
130      {
131        if (strlen(s)>5)
132        {
133          iiEStart(s,IDPROC(h));
134          return;
135        }
136        else omFree((ADDRESS)s);
137      }
138    }
139  }
140  else
141  {
142    char sing_file[MAXPATHLEN];
143    FILE *fd=NULL;
144    char *res_m=feResource('m', 0);
145    if (res_m!=NULL)
146    {
147      sprintf(sing_file, "%s/%s.sing", res_m, s);
148      fd = feFopen(sing_file, "r");
149    }
150    if (fd != NULL)
151    {
152
153      int old_echo = si_echo;
154      int length, got;
155      char* s;
156
157      fseek(fd, 0, SEEK_END);
158      length = ftell(fd);
159      fseek(fd, 0, SEEK_SET);
160      s = (char*) omAlloc((length+20)*sizeof(char));
161      got = fread(s, sizeof(char), length, fd);
162      fclose(fd);
163      if (got != length)
164      {
165        Werror("Error while reading file %s", sing_file);
166        omFree(s);
167      }
168      else
169      {
170        s[length] = '\0';
171        strcat(s, "\n;return();\n\n");
172        si_echo = 2;
173        iiEStart(s, NULL);
174        si_echo = old_echo;
175      }
176    }
177    else
178    {
179      Werror("no example for %s", str);
180    }
181  }
182}
183
184
185struct soptionStruct
186{
187  const char * name;
188  unsigned   setval;
189  unsigned   resetval;
190};
191
192struct soptionStruct optionStruct[]=
193{
194  {"prot",         Sy_bit(OPT_PROT),           ~Sy_bit(OPT_PROT)   },
195  {"redSB",        Sy_bit(OPT_REDSB),          ~Sy_bit(OPT_REDSB)   },
196  {"notBuckets",   Sy_bit(OPT_NOT_BUCKETS),    ~Sy_bit(OPT_NOT_BUCKETS)   },
197  {"notSugar",     Sy_bit(OPT_NOT_SUGAR),      ~Sy_bit(OPT_NOT_SUGAR)   },
198  {"interrupt",    Sy_bit(OPT_INTERRUPT),      ~Sy_bit(OPT_INTERRUPT)   },
199  {"sugarCrit",    Sy_bit(OPT_SUGARCRIT),      ~Sy_bit(OPT_SUGARCRIT)   },
200  {"teach",     Sy_bit(OPT_DEBUG),          ~Sy_bit(OPT_DEBUG)  },
201  /* 9 return SB in syz, quotient, intersect */
202  {"returnSB",     Sy_bit(OPT_RETURN_SB),      ~Sy_bit(OPT_RETURN_SB)  },
203  {"fastHC",       Sy_bit(OPT_FASTHC),         ~Sy_bit(OPT_FASTHC)  },
204  /* 11-19 sort in L/T */
205  {"staircaseBound",Sy_bit(OPT_STAIRCASEBOUND),~Sy_bit(OPT_STAIRCASEBOUND)  },
206  {"multBound",    Sy_bit(OPT_MULTBOUND),      ~Sy_bit(OPT_MULTBOUND)  },
207  {"degBound",     Sy_bit(OPT_DEGBOUND),       ~Sy_bit(OPT_DEGBOUND)  },
208  /* 25 no redTail(p)/redTail(s) */
209  {"redTail",      Sy_bit(OPT_REDTAIL),        ~Sy_bit(OPT_REDTAIL)  },
210  {"redThrough",   Sy_bit(OPT_REDTHROUGH),     ~Sy_bit(OPT_REDTHROUGH)  },
211  {"lazy",         Sy_bit(OPT_OLDSTD),         ~Sy_bit(OPT_OLDSTD)  },
212  {"intStrategy",  Sy_bit(OPT_INTSTRATEGY),    ~Sy_bit(OPT_INTSTRATEGY)  },
213  {"infRedTail",   Sy_bit(OPT_INFREDTAIL),     ~Sy_bit(OPT_INFREDTAIL)  },
214  /* 30: use not regularity for syz */
215  {"notRegularity",Sy_bit(OPT_NOTREGULARITY),  ~Sy_bit(OPT_NOTREGULARITY)  },
216  {"weightM",      Sy_bit(OPT_WEIGHTM),        ~Sy_bit(OPT_WEIGHTM)  },
217/*special for "none" and also end marker for showOption:*/
218  {"ne",           0,                          0 }
219};
220
221struct soptionStruct verboseStruct[]=
222{
223  {"mem",      Sy_bit(V_SHOW_MEM),  ~Sy_bit(V_SHOW_MEM)   },
224  {"yacc",     Sy_bit(V_YACC),      ~Sy_bit(V_YACC)       },
225  {"redefine", Sy_bit(V_REDEFINE),  ~Sy_bit(V_REDEFINE)   },
226  {"reading",  Sy_bit(V_READING),   ~Sy_bit(V_READING)    },
227  {"loadLib",  Sy_bit(V_LOAD_LIB),  ~Sy_bit(V_LOAD_LIB)   },
228  {"debugLib", Sy_bit(V_DEBUG_LIB), ~Sy_bit(V_DEBUG_LIB)  },
229  {"loadProc", Sy_bit(V_LOAD_PROC), ~Sy_bit(V_LOAD_PROC)  },
230  {"defRes",   Sy_bit(V_DEF_RES),   ~Sy_bit(V_DEF_RES)    },
231  {"usage",    Sy_bit(V_SHOW_USE),  ~Sy_bit(V_SHOW_USE)   },
232  {"Imap",     Sy_bit(V_IMAP),      ~Sy_bit(V_IMAP)       },
233  {"prompt",   Sy_bit(V_PROMPT),    ~Sy_bit(V_PROMPT)     },
234  {"length",   Sy_bit(V_LENGTH),    ~Sy_bit(V_LENGTH)     },
235  {"notWarnSB",Sy_bit(V_NSB),       ~Sy_bit(V_NSB)        },
236  {"contentSB",Sy_bit(V_CONTENTSB), ~Sy_bit(V_CONTENTSB)  },
237  {"cancelunit",Sy_bit(V_CANCELUNIT),~Sy_bit(V_CANCELUNIT)},
238  {"modpsolve",Sy_bit(V_MODPSOLVSB),~Sy_bit(V_MODPSOLVSB)},
239  {"geometricSB",Sy_bit(V_UPTORADICAL),~Sy_bit(V_UPTORADICAL)},
240  {"findMonomials",Sy_bit(V_FINDMONOM),~Sy_bit(V_FINDMONOM)},
241  {"coefStrat",Sy_bit(V_COEFSTRAT), ~Sy_bit(V_COEFSTRAT)},
242  {"qringNF",  Sy_bit(V_QRING),     ~Sy_bit(V_QRING)},
243/*special for "none" and also end marker for showOption:*/
244  {"ne",         0,          0 }
245};
246
247BOOLEAN setOption(leftv res, leftv v)
248{
249  const char *n;
250  do
251  {
252    if (v->Typ()==STRING_CMD)
253    {
254      n=(const char *)v->CopyD(STRING_CMD);
255    }
256    else
257    {
258      if (v->name==NULL)
259        return TRUE;
260      if (v->rtyp==0)
261      {
262        n=v->name;
263        v->name=NULL;
264      }
265      else
266      {
267        n=omStrDup(v->name);
268      }
269    }
270
271    int i;
272
273    if(strcmp(n,"get")==0)
274    {
275      intvec *w=new intvec(2);
276      (*w)[0]=test;
277      (*w)[1]=verbose;
278      res->rtyp=INTVEC_CMD;
279      res->data=(void *)w;
280      goto okay;
281    }
282    if(strcmp(n,"set")==0)
283    {
284      if((v->next!=NULL)
285      &&(v->next->Typ()==INTVEC_CMD))
286      {
287        v=v->next;
288        intvec *w=(intvec*)v->Data();
289        test=(*w)[0];
290        verbose=(*w)[1];
291#if 0
292        if (TEST_OPT_INTSTRATEGY && (currRing!=NULL)
293        && rField_has_simple_inverse()
294#ifdef HAVE_RINGS
295        && !rField_is_Ring(currRing)
296#endif
297        ) {
298          test &=~Sy_bit(OPT_INTSTRATEGY);
299        }
300#endif
301        goto okay;
302      }
303    }
304    if(strcmp(n,"none")==0)
305    {
306      test=0;
307      verbose=0;
308      goto okay;
309    }
310    for (i=0; (i==0) || (optionStruct[i-1].setval!=0); i++)
311    {
312      if (strcmp(n,optionStruct[i].name)==0)
313      {
314        if (optionStruct[i].setval & validOpts)
315        {
316          test |= optionStruct[i].setval;
317          // optOldStd disables redthrough
318          if (optionStruct[i].setval == Sy_bit(OPT_OLDSTD))
319            test &= ~Sy_bit(OPT_REDTHROUGH);
320        }
321        else
322          Warn("cannot set option");
323#if 0
324        if (TEST_OPT_INTSTRATEGY && (currRing!=NULL)
325        && rField_has_simple_inverse()
326#ifdef HAVE_RINGS
327        && !rField_is_Ring(currRing)
328#endif
329        ) {
330          test &=~Sy_bit(OPT_INTSTRATEGY);
331        }
332#endif
333        goto okay;
334      }
335      else if ((strncmp(n,"no",2)==0)
336      && (strcmp(n+2,optionStruct[i].name)==0))
337      {
338        if (optionStruct[i].setval & validOpts)
339        {
340          test &= optionStruct[i].resetval;
341        }
342        else
343          Warn("cannot clear option");
344        goto okay;
345      }
346    }
347    for (i=0; (i==0) || (verboseStruct[i-1].setval!=0); i++)
348    {
349      if (strcmp(n,verboseStruct[i].name)==0)
350      {
351        verbose |= verboseStruct[i].setval;
352        #ifdef YYDEBUG
353        #if YYDEBUG
354        /*debugging the bison grammar --> grammar.cc*/
355        extern int    yydebug;
356        if (BVERBOSE(V_YACC)) yydebug=1;
357        else                  yydebug=0;
358        #endif
359        #endif
360        goto okay;
361      }
362      else if ((strncmp(n,"no",2)==0)
363      && (strcmp(n+2,verboseStruct[i].name)==0))
364      {
365        verbose &= verboseStruct[i].resetval;
366        #ifdef YYDEBUG
367        #if YYDEBUG
368        /*debugging the bison grammar --> grammar.cc*/
369        extern int    yydebug;
370        if (BVERBOSE(V_YACC)) yydebug=1;
371        else                  yydebug=0;
372        #endif
373        #endif
374        goto okay;
375      }
376    }
377    Werror("unknown option `%s`",n);
378  okay:
379    if (currRing != NULL)
380      currRing->options = test & TEST_RINGDEP_OPTS;
381    omFree((ADDRESS)n);
382    v=v->next;
383  } while (v!=NULL);
384  #ifdef HAVE_TCL
385    if (tclmode)
386    {
387      BITSET tmp;
388      int i;
389      StringSetS("");
390      if ((test!=0)||(verbose!=0))
391      {
392        tmp=test;
393        if(tmp)
394        {
395          for (i=0; optionStruct[i].setval!=0; i++)
396          {
397            if (optionStruct[i].setval & test)
398            {
399              StringAppend(" %s",optionStruct[i].name);
400              tmp &=optionStruct[i].resetval;
401            }
402          }
403        }
404        tmp=verbose;
405        if (tmp)
406        {
407          for (i=0; verboseStruct[i].setval!=0; i++)
408          {
409            if (verboseStruct[i].setval & tmp)
410            {
411              StringAppend(" %s",verboseStruct[i].name);
412              tmp &=verboseStruct[i].resetval;
413            }
414          }
415        }
416        PrintTCLS('O',StringAppendS(""));
417        StringSetS("");
418      }
419      else
420      {
421        PrintTCLS('O'," ");
422      }
423    }
424  #endif
425    // set global variable to show memory usage
426    if (BVERBOSE(V_SHOW_MEM)) om_sing_opt_show_mem = 1;
427    else om_sing_opt_show_mem = 0;
428  return FALSE;
429}
430
431char * showOption()
432{
433  int i;
434  BITSET tmp;
435
436  StringSetS("//options:");
437  if ((test!=0)||(verbose!=0))
438  {
439    tmp=test;
440    if(tmp)
441    {
442      for (i=0; optionStruct[i].setval!=0; i++)
443      {
444        if (optionStruct[i].setval & test)
445        {
446          StringAppend(" %s",optionStruct[i].name);
447          tmp &=optionStruct[i].resetval;
448        }
449      }
450      for (i=0; i<32; i++)
451      {
452        if (tmp & Sy_bit(i)) StringAppend(" %d",i);
453      }
454    }
455    tmp=verbose;
456    if (tmp)
457    {
458      for (i=0; verboseStruct[i].setval!=0; i++)
459      {
460        if (verboseStruct[i].setval & tmp)
461        {
462          StringAppend(" %s",verboseStruct[i].name);
463          tmp &=verboseStruct[i].resetval;
464        }
465      }
466      for (i=1; i<32; i++)
467      {
468        if (tmp & Sy_bit(i)) StringAppend(" %d",i+32);
469      }
470    }
471    return omStrDup(StringAppendS(""));
472  }
473  else
474    return omStrDup(StringAppendS(" none"));
475}
476
477char * versionString()
478{
479  char* str = StringSetS("");
480  StringAppend("Singular for %s version %s (%d-%lu)  %s\nwith\n",
481               S_UNAME, S_VERSION1, SINGULAR_VERSION,
482               feVersionId,singular_date);
483  StringAppendS("\t");
484#ifdef HAVE_FACTORY
485              StringAppend("factory(%s),", factoryVersion);
486              StringAppend("libfac(%s,%s),\n\t",libfac_version,libfac_date);
487#endif
488#if defined (__GNU_MP_VERSION) && defined (__GNU_MP_VERSION_MINOR)
489              StringAppend("GMP(%d.%d),",__GNU_MP_VERSION,__GNU_MP_VERSION_MINOR);
490#else
491              StringAppendS("GMP(1.3),");
492#endif
493#ifdef HAVE_NTL
494#include "NTL/version.h"
495              StringAppend("NTL(%s),",NTL_VERSION);
496#endif
497#ifdef HAVE_MPSR
498              StringAppend("MP(%s),",MP_VERSION);
499#endif
500#if SIZEOF_VOIDP == 8
501              StringAppendS("64bit,");
502#else
503              StringAppendS("32bit,");
504#endif
505#if defined(HAVE_DYN_RL)
506              if (fe_fgets_stdin==fe_fgets_dummy)
507                StringAppendS("no input,");
508              else if (fe_fgets_stdin==fe_fgets)
509                StringAppendS("fgets,");
510              if (fe_fgets_stdin==fe_fgets_stdin_drl)
511                StringAppendS("dynamic readline,");
512              #ifdef HAVE_FEREAD
513              else if (fe_fgets_stdin==fe_fgets_stdin_emu)
514                StringAppendS("emulated readline,");
515              #endif
516              else
517                StringAppendS("unknown fgets method,");
518#else
519  #if defined(HAVE_READLINE) && !defined(FEREAD)
520              StringAppendS("static readline,");
521  #else
522    #ifdef HAVE_FEREAD
523              StringAppendS("emulated readline,");
524    #else
525              StringAppendS("fgets,");
526    #endif
527  #endif
528#endif
529#ifdef HAVE_PLURAL
530              StringAppendS("Plural,");
531#endif
532#ifdef HAVE_DBM
533              StringAppendS("DBM,\n\t");
534#else
535              StringAppendS("\n\t");
536#endif
537#ifdef HAVE_DYNAMIC_LOADING
538              StringAppendS("dynamic modules,");
539#endif
540              if (p_procs_dynamic) StringAppendS("dynamic p_Procs,");
541#ifdef TEST
542              StringAppendS("TESTs,");
543#endif
544#if YYDEBUG
545              StringAppendS("YYDEBUG=1,");
546#endif
547#ifdef HAVE_ASSUME
548             StringAppendS("ASSUME,");
549#endif
550#ifdef MDEBUG
551              StringAppend("MDEBUG=%d,",MDEBUG);
552#endif
553#ifdef OM_CHECK
554              StringAppend("OM_CHECK=%d,",OM_CHECK);
555#endif
556#ifdef OM_TRACK
557              StringAppend("OM_TRACK=%d,",OM_TRACK);
558#endif
559#ifdef OM_NDEBUG
560              StringAppendS("OM_NDEBUG,");
561#endif
562#ifdef PDEBUG
563              StringAppendS("PDEBUG,");
564#endif
565#ifdef KDEBUG
566              StringAppendS("KDEBUG,");
567#endif
568#ifndef __OPTIMIZE__
569              StringAppendS("-g,");
570#endif
571#ifdef HAVE_EIGENVAL
572              StringAppendS("eigenvalues,");
573#endif
574#ifdef HAVE_GMS
575              StringAppendS("Gauss-Manin system,");
576#endif
577#ifdef HAVE_RATGRING
578              StringAppendS("ratGB,");
579#endif
580              StringAppend("random=%d\n",siRandomStart);
581              StringAppend("\tCC=%s,\n\tCXX=%s"
582#ifdef __GNUC__
583              "(" __VERSION__ ")"
584#endif
585              "\n",CC,CXX);
586              feStringAppendResources(0);
587              feStringAppendBrowsers(0);
588              StringAppendS("\n");
589              return str;
590}
591
592#ifdef PDEBUG
593#if (OM_TRACK > 2) && defined(OM_TRACK_CUSTOM)
594void p_SetRingOfLeftv(leftv l, ring r)
595{
596  switch(l->rtyp)
597  {
598    case INT_CMD:
599    case BIGINT_CMD:
600    case IDHDL:
601    case DEF_CMD:
602      break;
603    case POLY_CMD:
604    case VECTOR_CMD:
605    {
606      poly p=(poly)l->data;
607      while(p!=NULL) { p_SetRingOfLm(p,r); pIter(p); }
608      break;
609    }
610    case IDEAL_CMD:
611    case MODUL_CMD:
612    case MATRIX_CMD:
613    {
614      ideal I=(ideal)l->data;
615      int i;
616      for(i=IDELEMS(I)-1;i>=0;i--)
617      {
618        poly p=I->m[i];
619        while(p!=NULL) { p_SetRingOfLm(p,r); pIter(p); }
620      }
621      break;
622    }
623    case COMMAND:
624    {
625      command d=(command)l->data;
626      p_SetRingOfLeftv(&d->arg1, r);
627      if (d->argc>1) p_SetRingOfLeftv(&d->arg2, r);
628      if (d->argc>2) p_SetRingOfLeftv(&d->arg3, r);
629      break;
630    }
631    default:
632     printf("type %d not yet implementd in p_SetRingOfLeftv\n",l->rtyp);
633     break;
634  }
635}
636#endif
637#endif
638
639void listall(int showproc)
640{
641      idhdl hh=basePack->idroot;
642      PrintS("====== Top ==============\n");
643      while (hh!=NULL)
644      {
645        if (showproc || (IDTYP(hh)!=PROC_CMD))
646        {
647          if (IDDATA(hh)==(void *)currRing) PrintS("(R)");
648          else if (IDDATA(hh)==(void *)currPack) PrintS("(P)");
649          else PrintS("   ");
650          Print("::%s, typ %s level %d data %lx",
651                 IDID(hh),Tok2Cmdname(IDTYP(hh)),IDLEV(hh),(long)IDDATA(hh));
652          if ((IDTYP(hh)==RING_CMD)
653          || (IDTYP(hh)==QRING_CMD))
654            Print(" ref: %d\n",IDRING(hh)->ref);
655          else
656            PrintLn();
657        }
658        hh=IDNEXT(hh);
659      }
660      hh=basePack->idroot;
661      while (hh!=NULL)
662      {
663        if (IDDATA(hh)==(void *)basePack)
664          Print("(T)::%s, typ %s level %d data %lx\n",
665          IDID(hh),Tok2Cmdname(IDTYP(hh)),IDLEV(hh),(long)IDDATA(hh));
666        else
667        if ((IDTYP(hh)==RING_CMD)
668        || (IDTYP(hh)==QRING_CMD)
669        || (IDTYP(hh)==PACKAGE_CMD))
670        {
671          Print("====== %s ==============\n",IDID(hh));
672          idhdl h2=IDRING(hh)->idroot;
673          while (h2!=NULL)
674          {
675            if (showproc || (IDTYP(h2)!=PROC_CMD))
676            {
677              if ((IDDATA(h2)==(void *)currRing)
678              && ((IDTYP(h2)==RING_CMD)||(IDTYP(h2)==QRING_CMD)))
679                PrintS("(R)");
680              else if (IDDATA(h2)==(void *)currPack) PrintS("(P)");
681              else PrintS("   ");
682              Print("%s::%s, typ %s level %d data %lx\n",
683              IDID(hh),IDID(h2),Tok2Cmdname(IDTYP(h2)),IDLEV(h2),(long)IDDATA(h2));
684            }
685            h2=IDNEXT(h2);
686          }
687        }
688        hh=IDNEXT(hh);
689      }
690      Print("currRing:%lx, currPack:%lx,basePack:%lx\n",(long)currRing,(long)currPack,(long)basePack);
691      iiCheckPack(currPack);
692}
693#ifndef NDEBUG
694void checkall()
695{
696      idhdl hh=basePack->idroot;
697      while (hh!=NULL)
698      {
699        omCheckAddr(hh);
700        omCheckAddr((ADDRESS)IDID(hh));
701        if (RingDependend(IDTYP(hh))) Print("%s typ %d in Top\n",IDID(hh),IDTYP(hh));
702        hh=IDNEXT(hh);
703      }
704      hh=basePack->idroot;
705      while (hh!=NULL)
706      {
707        if (IDTYP(hh)==PACKAGE_CMD)
708        {
709          idhdl h2=IDPACKAGE(hh)->idroot;
710          while (h2!=NULL)
711          {
712            omCheckAddr(h2);
713            omCheckAddr((ADDRESS)IDID(h2));
714            if (RingDependend(IDTYP(h2))) Print("%s typ %d in %s\n",IDID(h2),IDTYP(h2),IDID(hh));
715            h2=IDNEXT(h2);
716          }
717        }
718        hh=IDNEXT(hh);
719      }
720}
721#endif
722
723#include <sys/types.h>
724#include <sys/stat.h>
725#include <unistd.h>
726
727extern "C"
728int singular_fstat(int fd, struct stat *buf)
729{
730  return fstat(fd,buf);
731}
732
Note: See TracBrowser for help on using the repository browser.