source: git/Singular/misc.cc @ 1db74ad

spielwiese
Last change on this file since 1db74ad was 1db74ad, checked in by Hans Schönemann <hannes@…>, 14 years ago
option qringNF git-svn-id: file:///usr/local/Singular/svn/trunk@12471 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 18.1 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  {"contentSB",Sy_bit(V_CONTENTSB), ~Sy_bit(V_CONTENTSB)  },
236  {"cancelunit",Sy_bit(V_CANCELUNIT),~Sy_bit(V_CANCELUNIT)},
237  {"modpsolve",Sy_bit(V_MODPSOLVSB),~Sy_bit(V_MODPSOLVSB)},
238  {"geometricSB",Sy_bit(V_UPTORADICAL),~Sy_bit(V_UPTORADICAL)},
239  {"findMonomials",Sy_bit(V_FINDMONOM),~Sy_bit(V_FINDMONOM)},
240  {"coefStrat",Sy_bit(V_COEFSTRAT), ~Sy_bit(V_COEFSTRAT)},
241  {"qringNF",  Sy_bit(V_QRING),     ~Sy_bit(V_QRING)},
242/*special for "none" and also end marker for showOption:*/
243  {"ne",         0,          0 }
244};
245
246BOOLEAN setOption(leftv res, leftv v)
247{
248  const char *n;
249  do
250  {
251    if (v->Typ()==STRING_CMD)
252    {
253      n=(const char *)v->CopyD(STRING_CMD);
254    }
255    else
256    {
257      if (v->name==NULL)
258        return TRUE;
259      if (v->rtyp==0)
260      {
261        n=v->name;
262        v->name=NULL;
263      }
264      else
265      {
266        n=omStrDup(v->name);
267      }
268    }
269
270    int i;
271
272    if(strcmp(n,"get")==0)
273    {
274      intvec *w=new intvec(2);
275      (*w)[0]=test;
276      (*w)[1]=verbose;
277      res->rtyp=INTVEC_CMD;
278      res->data=(void *)w;
279      goto okay;
280    }
281    if(strcmp(n,"set")==0)
282    {
283      if((v->next!=NULL)
284      &&(v->next->Typ()==INTVEC_CMD))
285      {
286        v=v->next;
287        intvec *w=(intvec*)v->Data();
288        test=(*w)[0];
289        verbose=(*w)[1];
290#if 0
291        if (TEST_OPT_INTSTRATEGY && (currRing!=NULL)
292        && rField_has_simple_inverse()
293#ifdef HAVE_RINGS
294        && !rField_is_Ring(currRing)
295#endif
296        ) {
297          test &=~Sy_bit(OPT_INTSTRATEGY);
298        }
299#endif
300        goto okay;
301      }
302    }
303    if(strcmp(n,"none")==0)
304    {
305      test=0;
306      verbose=0;
307      goto okay;
308    }
309    for (i=0; (i==0) || (optionStruct[i-1].setval!=0); i++)
310    {
311      if (strcmp(n,optionStruct[i].name)==0)
312      {
313        if (optionStruct[i].setval & validOpts)
314        {
315          test |= optionStruct[i].setval;
316          // optOldStd disables redthrough
317          if (optionStruct[i].setval == Sy_bit(OPT_OLDSTD))
318            test &= ~Sy_bit(OPT_REDTHROUGH);
319        }
320        else
321          Warn("cannot set option");
322#if 0
323        if (TEST_OPT_INTSTRATEGY && (currRing!=NULL)
324        && rField_has_simple_inverse()
325#ifdef HAVE_RINGS
326        && !rField_is_Ring(currRing)
327#endif
328        ) {
329          test &=~Sy_bit(OPT_INTSTRATEGY);
330        }
331#endif
332        goto okay;
333      }
334      else if ((strncmp(n,"no",2)==0)
335      && (strcmp(n+2,optionStruct[i].name)==0))
336      {
337        if (optionStruct[i].setval & validOpts)
338        {
339          test &= optionStruct[i].resetval;
340        }
341        else
342          Warn("cannot clear option");
343        goto okay;
344      }
345    }
346    for (i=0; (i==0) || (verboseStruct[i-1].setval!=0); i++)
347    {
348      if (strcmp(n,verboseStruct[i].name)==0)
349      {
350        verbose |= verboseStruct[i].setval;
351        #ifdef YYDEBUG
352        #if YYDEBUG
353        /*debugging the bison grammar --> grammar.cc*/
354        extern int    yydebug;
355        if (BVERBOSE(V_YACC)) yydebug=1;
356        else                  yydebug=0;
357        #endif
358        #endif
359        goto okay;
360      }
361      else if ((strncmp(n,"no",2)==0)
362      && (strcmp(n+2,verboseStruct[i].name)==0))
363      {
364        verbose &= verboseStruct[i].resetval;
365        #ifdef YYDEBUG
366        #if YYDEBUG
367        /*debugging the bison grammar --> grammar.cc*/
368        extern int    yydebug;
369        if (BVERBOSE(V_YACC)) yydebug=1;
370        else                  yydebug=0;
371        #endif
372        #endif
373        goto okay;
374      }
375    }
376    Werror("unknown option `%s`",n);
377  okay:
378    if (currRing != NULL)
379      currRing->options = test & TEST_RINGDEP_OPTS;
380    omFree((ADDRESS)n);
381    v=v->next;
382  } while (v!=NULL);
383  #ifdef HAVE_TCL
384    if (tclmode)
385    {
386      BITSET tmp;
387      int i;
388      StringSetS("");
389      if ((test!=0)||(verbose!=0))
390      {
391        tmp=test;
392        if(tmp)
393        {
394          for (i=0; optionStruct[i].setval!=0; i++)
395          {
396            if (optionStruct[i].setval & test)
397            {
398              StringAppend(" %s",optionStruct[i].name);
399              tmp &=optionStruct[i].resetval;
400            }
401          }
402        }
403        tmp=verbose;
404        if (tmp)
405        {
406          for (i=0; verboseStruct[i].setval!=0; i++)
407          {
408            if (verboseStruct[i].setval & tmp)
409            {
410              StringAppend(" %s",verboseStruct[i].name);
411              tmp &=verboseStruct[i].resetval;
412            }
413          }
414        }
415        PrintTCLS('O',StringAppendS(""));
416        StringSetS("");
417      }
418      else
419      {
420        PrintTCLS('O'," ");
421      }
422    }
423  #endif
424    // set global variable to show memory usage
425    if (BVERBOSE(V_SHOW_MEM)) om_sing_opt_show_mem = 1;
426    else om_sing_opt_show_mem = 0;
427  return FALSE;
428}
429
430char * showOption()
431{
432  int i;
433  BITSET tmp;
434
435  StringSetS("//options:");
436  if ((test!=0)||(verbose!=0))
437  {
438    tmp=test;
439    if(tmp)
440    {
441      for (i=0; optionStruct[i].setval!=0; i++)
442      {
443        if (optionStruct[i].setval & test)
444        {
445          StringAppend(" %s",optionStruct[i].name);
446          tmp &=optionStruct[i].resetval;
447        }
448      }
449      for (i=0; i<32; i++)
450      {
451        if (tmp & Sy_bit(i)) StringAppend(" %d",i);
452      }
453    }
454    tmp=verbose;
455    if (tmp)
456    {
457      for (i=0; verboseStruct[i].setval!=0; i++)
458      {
459        if (verboseStruct[i].setval & tmp)
460        {
461          StringAppend(" %s",verboseStruct[i].name);
462          tmp &=verboseStruct[i].resetval;
463        }
464      }
465      for (i=1; i<32; i++)
466      {
467        if (tmp & Sy_bit(i)) StringAppend(" %d",i+32);
468      }
469    }
470    return omStrDup(StringAppendS(""));
471  }
472  else
473    return omStrDup(StringAppendS(" none"));
474}
475
476char * versionString()
477{
478  char* str = StringSetS("");
479  StringAppend("Singular for %s version %s (%d-%lu)  %s\nwith\n",
480               S_UNAME, S_VERSION1, SINGULAR_VERSION,
481               feVersionId,singular_date);
482  StringAppendS("\t");
483#ifdef HAVE_FACTORY
484              StringAppend("factory(%s),", factoryVersion);
485              StringAppend("libfac(%s,%s),\n\t",libfac_version,libfac_date);
486#endif
487#if defined (__GNU_MP_VERSION) && defined (__GNU_MP_VERSION_MINOR)
488              StringAppend("GMP(%d.%d),",__GNU_MP_VERSION,__GNU_MP_VERSION_MINOR);
489#else
490              StringAppendS("GMP(1.3),");
491#endif
492#ifdef HAVE_NTL
493#include "NTL/version.h"
494              StringAppend("NTL(%s),",NTL_VERSION);
495#endif
496#ifdef HAVE_MPSR
497              StringAppend("MP(%s),",MP_VERSION);
498#endif
499#if SIZEOF_VOIDP == 8
500              StringAppendS("64bit,");
501#else
502              StringAppendS("32bit,");
503#endif
504#if defined(HAVE_DYN_RL)
505              if (fe_fgets_stdin==fe_fgets_dummy)
506                StringAppendS("no input,");
507              else if (fe_fgets_stdin==fe_fgets)
508                StringAppendS("fgets,");
509              if (fe_fgets_stdin==fe_fgets_stdin_drl)
510                StringAppendS("dynamic readline,");
511              #ifdef HAVE_FEREAD
512              else if (fe_fgets_stdin==fe_fgets_stdin_emu)
513                StringAppendS("emulated readline,");
514              #endif
515              else
516                StringAppendS("unknown fgets method,");
517#else
518  #if defined(HAVE_READLINE) && !defined(FEREAD)
519              StringAppendS("static readline,");
520  #else
521    #ifdef HAVE_FEREAD
522              StringAppendS("emulated readline,");
523    #else
524              StringAppendS("fgets,");
525    #endif
526  #endif
527#endif
528#ifdef HAVE_PLURAL
529              StringAppendS("Plural,");
530#endif
531#ifdef HAVE_DBM
532              StringAppendS("DBM,\n\t");
533#else
534              StringAppendS("\n\t");
535#endif
536#ifdef HAVE_DYNAMIC_LOADING
537              StringAppendS("dynamic modules,");
538#endif
539              if (p_procs_dynamic) StringAppendS("dynamic p_Procs,");
540#ifdef TEST
541              StringAppendS("TESTs,");
542#endif
543#if YYDEBUG
544              StringAppendS("YYDEBUG=1,");
545#endif
546#ifdef HAVE_ASSUME
547             StringAppendS("ASSUME,");
548#endif
549#ifdef MDEBUG
550              StringAppend("MDEBUG=%d,",MDEBUG);
551#endif
552#ifdef OM_CHECK
553              StringAppend("OM_CHECK=%d,",OM_CHECK);
554#endif
555#ifdef OM_TRACK
556              StringAppend("OM_TRACK=%d,",OM_TRACK);
557#endif
558#ifdef OM_NDEBUG
559              StringAppendS("OM_NDEBUG,");
560#endif
561#ifdef PDEBUG
562              StringAppendS("PDEBUG,");
563#endif
564#ifdef KDEBUG
565              StringAppendS("KDEBUG,");
566#endif
567#ifndef __OPTIMIZE__
568              StringAppendS("-g,");
569#endif
570#ifdef HAVE_EIGENVAL
571              StringAppendS("eigenvalues,");
572#endif
573#ifdef HAVE_GMS
574              StringAppendS("Gauss-Manin system,");
575#endif
576#ifdef HAVE_RATGRING
577              StringAppendS("ratGB,");
578#endif
579              StringAppend("random=%d\n",siRandomStart);
580              StringAppend("\tCC=%s,\n\tCXX=%s"
581#ifdef __GNUC__
582              "(" __VERSION__ ")"
583#endif
584              "\n",CC,CXX);
585              feStringAppendResources(0);
586              feStringAppendBrowsers(0);
587              StringAppendS("\n");
588              return str;
589}
590
591#ifdef PDEBUG
592#if (OM_TRACK > 2) && defined(OM_TRACK_CUSTOM)
593void p_SetRingOfLeftv(leftv l, ring r)
594{
595  switch(l->rtyp)
596  {
597    case INT_CMD:
598    case BIGINT_CMD:
599    case IDHDL:
600      break;
601    case POLY_CMD:
602    case VECTOR_CMD:
603    {
604      poly p=(poly)l->data;
605      while(p!=NULL) { p_SetRingOfLm(p,r); pIter(p); }
606      break;
607    }
608    case IDEAL_CMD:
609    case MODUL_CMD:
610    case MATRIX_CMD:
611    {
612      ideal I=(ideal)l->data;
613      int i;
614      for(i=IDELEMS(I)-1;i>=0;i--)
615      {
616        poly p=I->m[i];
617        while(p!=NULL) { p_SetRingOfLm(p,r); pIter(p); }
618      }
619      break;
620    }
621    case COMMAND:
622    {
623      command d=(command)l->data;
624      p_SetRingOfLeftv(&d->arg1, r);
625      if (d->argc>1) p_SetRingOfLeftv(&d->arg2, r);
626      if (d->argc>2) p_SetRingOfLeftv(&d->arg3, r);
627      break;
628    }
629    default:
630     printf("type %d not yet implementd in p_SetRingOfLeftv\n",l->rtyp);
631     break;
632  }
633}
634#endif
635#endif
636
637void listall(int showproc)
638{
639      idhdl hh=basePack->idroot;
640      PrintS("====== Top ==============\n");
641      while (hh!=NULL)
642      {
643        if (showproc || (IDTYP(hh)!=PROC_CMD))
644        {
645          if (IDDATA(hh)==(void *)currRing) PrintS("(R)");
646          else if (IDDATA(hh)==(void *)currPack) PrintS("(P)");
647          else PrintS("   ");
648          Print("::%s, typ %s level %d data %lx",
649                 IDID(hh),Tok2Cmdname(IDTYP(hh)),IDLEV(hh),(long)IDDATA(hh));
650          if ((IDTYP(hh)==RING_CMD)
651          || (IDTYP(hh)==QRING_CMD))
652            Print(" ref: %d\n",IDRING(hh)->ref);
653          else
654            PrintLn();
655        }
656        hh=IDNEXT(hh);
657      }
658      hh=basePack->idroot;
659      while (hh!=NULL)
660      {
661        if (IDDATA(hh)==(void *)basePack)
662          Print("(T)::%s, typ %s level %d data %lx\n",
663          IDID(hh),Tok2Cmdname(IDTYP(hh)),IDLEV(hh),(long)IDDATA(hh));
664        else
665        if ((IDTYP(hh)==RING_CMD)
666        || (IDTYP(hh)==QRING_CMD)
667        || (IDTYP(hh)==PACKAGE_CMD))
668        {
669          Print("====== %s ==============\n",IDID(hh));
670          idhdl h2=IDRING(hh)->idroot;
671          while (h2!=NULL)
672          {
673            if (showproc || (IDTYP(h2)!=PROC_CMD))
674            {
675              if ((IDDATA(h2)==(void *)currRing)
676              && ((IDTYP(h2)==RING_CMD)||(IDTYP(h2)==QRING_CMD)))
677                PrintS("(R)");
678              else if (IDDATA(h2)==(void *)currPack) PrintS("(P)");
679              else PrintS("   ");
680              Print("%s::%s, typ %s level %d data %lx\n",
681              IDID(hh),IDID(h2),Tok2Cmdname(IDTYP(h2)),IDLEV(h2),(long)IDDATA(h2));
682            }
683            h2=IDNEXT(h2);
684          }
685        }
686        hh=IDNEXT(hh);
687      }
688      Print("currRing:%lx, currPack:%lx,basePack:%lx\n",(long)currRing,(long)currPack,(long)basePack);
689      iiCheckPack(currPack);
690}
691#ifndef NDEBUG
692void checkall()
693{
694      idhdl hh=basePack->idroot;
695      while (hh!=NULL)
696      {
697        omCheckAddr(hh);
698        omCheckAddr((ADDRESS)IDID(hh));
699        if (RingDependend(IDTYP(hh))) Print("%s typ %d in Top\n",IDID(hh),IDTYP(hh));
700        hh=IDNEXT(hh);
701      }
702      hh=basePack->idroot;
703      while (hh!=NULL)
704      {
705        if (IDTYP(hh)==PACKAGE_CMD)
706        {
707          idhdl h2=IDPACKAGE(hh)->idroot;
708          while (h2!=NULL)
709          {
710            omCheckAddr(h2);
711            omCheckAddr((ADDRESS)IDID(h2));
712            if (RingDependend(IDTYP(h2))) Print("%s typ %d in %s\n",IDID(h2),IDTYP(h2),IDID(hh));
713            h2=IDNEXT(h2);
714          }
715        }
716        hh=IDNEXT(hh);
717      }
718}
719#endif
720
721#include <sys/types.h>
722#include <sys/stat.h>
723#include <unistd.h>
724
725extern "C"
726int singular_fstat(int fd, struct stat *buf)
727{
728  return fstat(fd,buf);
729}
730
Note: See TracBrowser for help on using the repository browser.