Changeset e9ad8a6 in git


Ignore:
Timestamp:
Jun 2, 1998, 5:30:06 PM (26 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
3e51af9f276f204e3b6cfcf1258c17b8f270f019
Parents:
98aa53fd19f83e591c2dccae346010e080a9f7bc
Message:
* hannes:introduced /* */ comments, some code cleanups


git-svn-id: file:///usr/local/Singular/svn/trunk@2016 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
Singular
Files:
26 edited

Legend:

Unmodified
Added
Removed
  • Singular/ChangeLog

    r98aa53 re9ad8a6  
     1Tue Jun  2 17:28:48 MET DST 1998 hannes
     2        * introduced /* */ comments
     3        * some code cleanups
    14Fri May 29 17:00:27 MET DST 1998 hannes
    25        * change res to nres (cmd), resu to res(standard.lib)
  • Singular/comm.h

    r98aa53 re9ad8a6  
    103103typedef class skstdLink * stdLink;
    104104
    105 class skstdLink 
     105class skstdLink
    106106{
    107107public:
     
    146146  LSet Warteliste;
    147147  int Wartelistemax, Wartelistel;
    148   int aktuell;         // Index des Polynoms in l, das als nächstes verarbeitet wird. 
     148  int aktuell;         // Index des Polynoms in l, das als nächstes verarbeitet wird.
    149149
    150150  int      procnum;
  • Singular/febase.cc

    r98aa53 re9ad8a6  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: febase.cc,v 1.36 1998-05-25 13:04:54 Singular Exp $ */
     4/* $Id: febase.cc,v 1.37 1998-06-02 15:29:51 Singular Exp $ */
    55/*
    66* ABSTRACT: i/o system
     
    119119#define SINGULAR_RELATIVE_DATA_DIR "../share/Singular"
    120120
    121 static char* SearchPath = NULL;
    122 static char* ExpandedExecutable = NULL;
     121static char* feSearchPath = NULL;
     122static char* feExpandedExecutable = NULL;
    123123
    124124char* feGetExpandedExecutable(const char* argv0)
    125125{
    126   if (ExpandedExecutable == NULL)
     126  if (feExpandedExecutable == NULL)
    127127  {
    128128    if (argv0 != NULL)
    129       ExpandedExecutable = find_executable(argv0);
    130   }
    131   return ExpandedExecutable;
     129      feExpandedExecutable = find_executable(argv0);
     130  }
     131  return feExpandedExecutable;
    132132}
    133133
     
    152152    return temp2;
    153153  }
    154   else 
     154  else
    155155    return NULL;
    156156}
     
    160160// Env-variables + Relative Data Dir + Burned-in data dir
    161161char* feGetSearchPath(const char* argv0)
    162 {   
    163   if (SearchPath == NULL)
     162{
     163  if (feSearchPath == NULL)
    164164  {
    165165    char *env = NULL, *sibbling = NULL, *path;
    166166    int plength = 0, tmp;
    167  
     167
    168168#ifdef MSDOS
    169169    env=getenv("SPATH");
     
    171171    env=getenv("SINGULARPATH");
    172172#endif
    173  
     173
    174174    if (env != NULL)
    175175      plength = strlen(env) + 1;
     
    177177    if (argv0 != NULL)
    178178      sibbling = feRemovePathnameHead(feGetExpandedExecutable(argv0));
    179  
     179
    180180    if (sibbling != NULL)
    181181      plength += strlen(sibbling) + strlen(SINGULAR_RELATIVE_DATA_DIR) + 2;
    182  
     182
    183183    plength += strlen(SINGULAR_DATADIR) + 2;
    184  
     184
    185185    path = (char*) AllocL(plength*sizeof(char));
    186     SearchPath = path;
    187  
     186    feSearchPath = path;
     187
    188188    if (env != NULL)
    189189    {
     
    194194      path++;
    195195    }
    196  
     196
    197197    if (sibbling != NULL)
    198198    {
     
    209209      FreeL(sibbling);
    210210    }
    211  
     211
    212212    tmp = strlen(SINGULAR_DATADIR);
    213213    memcpy(path,SINGULAR_DATADIR, tmp);
     
    215215    *path = '\0';
    216216  }
    217   return SearchPath;
     217  return feSearchPath;
    218218}
    219219
     
    268268  FreeL(res);
    269269#else
    270   if (where!=NULL) strcpy(where,path);
    271   if ((*mode=='r') && (path[0]!=DIR_SEP)&&(path[0]!='.')
    272   &&(f==NULL))
     270  if (where!=NULL)
     271    strcpy(where,path);
     272  if ((*mode=='r')
     273  && (path[0]!=DIR_SEP)
     274  && (path[0]!='.')
     275  && (f==NULL))
    273276  {
    274277    char found = 0;
     
    293296          if(!access(s, R_OK)) { found++; break; }
    294297        #else
    295           f=myfopen(s,mode);
     298          f=fopen(s,mode); /* do not need myfopen: we test only the access */
    296299          if (f!=NULL)  { found++; fclose(f); break; }
    297300        #endif
     
    682685  int i;
    683686  BOOLEAN done = FALSE;
    684  
     687
    685688  for (i=0;;i++)
    686689  {
     
    689692    if (mode[i] == 'b') done = TRUE;
    690693  }
    691  
     694
    692695  if (! done)
    693696  {
     
    720723
    721724
    722      
     725
  • Singular/febase.h

    r98aa53 re9ad8a6  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: febase.h,v 1.17 1998-05-25 21:28:31 obachman Exp $ */
     6/* $Id: febase.h,v 1.18 1998-06-02 15:29:52 Singular Exp $ */
    77/*
    88* ABSTRACT
     
    2222*/
    2323#ifndef unix
    24 extern FILE *myfopen(char *path, char *mode); 
     24extern FILE *myfopen(char *path, char *mode);
    2525#else
    2626#define myfopen fopen
     
    6464/* the C++-part: */
    6565
    66 enum   feBufferTypes 
     66enum   feBufferTypes
    6767{
    6868  BT_none  = 0,  // entry level
     
    7676};
    7777
    78 enum   feBufferInputs 
     78enum   feBufferInputs
    7979{
    8080  BI_stdin = 1,
  • Singular/febase.inc

    r98aa53 re9ad8a6  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: febase.inc,v 1.10 1998-05-07 17:53:25 Singular Exp $ */
     4/* $Id: febase.inc,v 1.11 1998-06-02 15:29:53 Singular Exp $ */
    55/*
    66* ABSTRACT: handling of 'voices'
     
    302302  //Print("----------------\n");
    303303  //}
    304   if (currentVoice->oldb!=NULL)
    305   {
    306     myyoldbuffer(currentVoice->oldb);
    307     currentVoice->oldb=NULL;
    308   }
    309   if ((currentVoice->prev==NULL)&&(currentVoice->sw==BI_file))
    310   {
    311     currentVoice->prev=feInitStdin();
    312   }
    313   if (currentVoice->prev!=NULL)
    314   {
    315     //printf("exitVoice typ %d(%s)\n",
    316     //  currentVoice->typ,BT_name[currentVoice->typ]);
    317     if (currentVoice->typ==BT_if)
    318     {
    319       currentVoice->prev->ifsw=2;
    320     }
    321     else
    322     {
    323       currentVoice->prev->ifsw=0;
    324     }
    325     if ((currentVoice->sw == BI_file)
    326     && (currentVoice->files!=NULL))
    327     {
    328       fclose(currentVoice->files);
    329     }
    330     if (currentVoice->filename!=NULL)
    331     {
    332       FreeL((ADDRESS)currentVoice->filename);
    333       currentVoice->filename=NULL;
    334     }
    335     if (currentVoice->buffer!=NULL)
    336     {
    337       FreeL((ADDRESS)currentVoice->buffer);
    338       currentVoice->buffer=NULL;
    339     }
    340     yylineno=currentVoice->prev->curr_lineno;
    341   }
    342   Voice *p=currentVoice->prev;
    343   delete currentVoice;
    344   currentVoice=p;
    345   return currentVoice==0;
     304  if (currentVoice!=NULL)
     305  {
     306    if (currentVoice->oldb!=NULL)
     307    {
     308      myyoldbuffer(currentVoice->oldb);
     309      currentVoice->oldb=NULL;
     310    }
     311    if ((currentVoice->prev==NULL)&&(currentVoice->sw==BI_file))
     312    {
     313      currentVoice->prev=feInitStdin();
     314    }
     315    if (currentVoice->prev!=NULL)
     316    {
     317      //printf("exitVoice typ %d(%s)\n",
     318      //  currentVoice->typ,BT_name[currentVoice->typ]);
     319      if (currentVoice->typ==BT_if)
     320      {
     321        currentVoice->prev->ifsw=2;
     322      }
     323      else
     324      {
     325        currentVoice->prev->ifsw=0;
     326      }
     327      if ((currentVoice->sw == BI_file)
     328      && (currentVoice->files!=NULL))
     329      {
     330        fclose(currentVoice->files);
     331      }
     332      if (currentVoice->filename!=NULL)
     333      {
     334        FreeL((ADDRESS)currentVoice->filename);
     335        currentVoice->filename=NULL;
     336      }
     337      if (currentVoice->buffer!=NULL)
     338      {
     339        FreeL((ADDRESS)currentVoice->buffer);
     340        currentVoice->buffer=NULL;
     341      }
     342      yylineno=currentVoice->prev->curr_lineno;
     343    }
     344    Voice *p=currentVoice->prev;
     345    delete currentVoice;
     346    currentVoice=p;
     347  }
     348  return currentVoice==NULL;
    346349}
    347350
     
    432435int feReadLine(char* b, int l)
    433436{
     437  char *s=NULL;
     438  int offset; /* will not be used if s==NULL*/
    434439  // try to read from the buffer into b, max l chars
    435   if ((currentVoice->buffer!=NULL)
    436   && (currentVoice->buffer[currentVoice->fptr]!='\0'))
    437   {
    438 NewBuff:
    439     int i=0;
    440     int startfptr=currentVoice->fptr;
    441     l--;
    442     loop
    443     {
    444       char c=
    445       b[i]=currentVoice->buffer[currentVoice->fptr];
    446       i++;
    447       if (yy_noeof==noeof_block)
    448       {
    449         if (c<' ')  yylineno++;
    450         else if (c=='}') break;
    451       }
    452       else
    453       {
    454         if ((c<' ') ||
    455         (c==';') ||
    456         (c==')')
    457         )
    458           break;
    459       }         
    460       if (i>=l) break;
     440  if (currentVoice!=NULL)
     441  {
     442    if((currentVoice->buffer!=NULL)
     443    && (currentVoice->buffer[currentVoice->fptr]!='\0'))
     444    {
     445  NewBuff:
     446      int i=0;
     447      int startfptr=currentVoice->fptr;
     448      l--;
     449      loop
     450      {
     451        char c=
     452        b[i]=currentVoice->buffer[currentVoice->fptr];
     453        i++;
     454        if (yy_noeof==noeof_block)
     455        {
     456          if (c<' ')  yylineno++;
     457          else if (c=='}') break;
     458        }
     459        else
     460        {
     461          if ((c<' ') ||
     462          (c==';') ||
     463          (c==')')
     464          )
     465            break;
     466        }         
     467        if (i>=l) break;
     468        currentVoice->fptr++;
     469        if(currentVoice->buffer[currentVoice->fptr]=='\0') break;
     470      }
     471      b[i]='\0';
     472      if (currentVoice->sw==BI_buffer)
     473      {
     474        if (startfptr==0)
     475        {
     476          char *anf=currentVoice->buffer;
     477          char *ss=strchr(anf,'\n');
     478          int len;
     479          if (ss==NULL) len=strlen(anf);
     480          else          len=ss-anf;
     481          char *s=(char *)AllocL(len+2);
     482          strncpy(s,anf,len+2);
     483          s[len+1]='\0';
     484          fePrintEcho(s);
     485          FreeL((ADDRESS)s);
     486        }
     487        else if (/*(startfptr>0) &&*/
     488        (currentVoice->buffer[startfptr-1]=='\n'))
     489        {
     490          char *anf=currentVoice->buffer+startfptr;
     491          char *ss=strchr(anf,'\n');
     492          int len;
     493          if (ss==NULL) len=strlen(anf);
     494          else          len=ss-anf;
     495          char *s=(char *)AllocL(len+2);
     496          strncpy(s,anf,len+2);
     497          s[len+1]='\0';
     498          yylineno++;
     499          fePrintEcho(s);
     500          FreeL((ADDRESS)s);
     501        }
     502      }
    461503      currentVoice->fptr++;
    462       if(currentVoice->buffer[currentVoice->fptr]=='\0') break;
    463     }
    464     b[i]='\0';
    465     if (currentVoice->sw==BI_buffer)
    466     {
    467       if (startfptr==0)
    468       {
    469         char *anf=currentVoice->buffer;
    470         char *ss=strchr(anf,'\n');
    471         int len;
    472         if (ss==NULL) len=strlen(anf);
    473         else          len=ss-anf;
    474         char *s=(char *)AllocL(len+2);
    475         strncpy(s,anf,len+2);
    476         s[len+1]='\0';
    477         fePrintEcho(s);
    478         FreeL((ADDRESS)s);
    479       }
    480       else if (/*(startfptr>0) &&*/
    481       (currentVoice->buffer[startfptr-1]=='\n'))
    482       {
    483         char *anf=currentVoice->buffer+startfptr;
    484         char *ss=strchr(anf,'\n');
    485         int len;
    486         if (ss==NULL) len=strlen(anf);
    487         else          len=ss-anf;
    488         char *s=(char *)AllocL(len+2);
    489         strncpy(s,anf,len+2);
    490         s[len+1]='\0';
    491         yylineno++;
    492         fePrintEcho(s);
    493         FreeL((ADDRESS)s);
    494       }
    495     }
    496     currentVoice->fptr++;
    497     return i;
    498   }
    499   // no buffer there or e-o-buffer or eoln:
    500   if (currentVoice->sw!=BI_buffer)
    501   {
    502     currentVoice->fptr=0;
    503     if (currentVoice->buffer==NULL)
    504       currentVoice->buffer=(char *)AllocL(4096-sizeof(ADDRESS));
    505   }
    506   char *s;
    507   int offset=0;
    508 NewRead:
    509   yylineno++;
    510   if (currentVoice->sw==BI_stdin)
    511   {
    512     feShowPrompt();
    513     s=fe_fgets_stdin(currentVoice->buffer+offset,(4096-1-sizeof(ADDRESS))-offset);
    514   }
    515   else if (currentVoice->sw==BI_file)
    516   {
    517     s=fgets(currentVoice->buffer+offset,(4096-1-sizeof(ADDRESS))-offset,
    518             currentVoice->files);
    519   }
    520   else /* BI_buffer */
    521   {
    522     return 0;
     504      return i;
     505    }
     506    // no buffer there or e-o-buffer or eoln:
     507    if (currentVoice->sw!=BI_buffer)
     508    {
     509      currentVoice->fptr=0;
     510      if (currentVoice->buffer==NULL)
     511        currentVoice->buffer=(char *)AllocL(4096-sizeof(ADDRESS));
     512    }
     513    offset=0;
     514  NewRead:
     515    yylineno++;
     516    if (currentVoice->sw==BI_stdin)
     517    {
     518      feShowPrompt();
     519      s=fe_fgets_stdin(currentVoice->buffer+offset,(4096-1-sizeof(ADDRESS))-offset);
     520    }
     521    else if (currentVoice->sw==BI_file)
     522    {
     523      s=fgets(currentVoice->buffer+offset,(4096-1-sizeof(ADDRESS))-offset,
     524              currentVoice->files);
     525    }
     526    //else /* BI_buffer */ s==NULL  => return 0
     527    //{
     528    //  return 0;
     529    //}
    523530  }
    524531  if (s!=NULL)
     
    544551  /* else if (s==NULL) */
    545552  {
     553    char *err=NULL;
    546554    switch(yy_noeof)
    547555    {
    548       case 0:
    549         return 0;
    550556      case noeof_brace:
    551557      case noeof_block:
    552         WerrorS("premature end of file while reading {...}");
     558        err="{...}";
    553559        break;
    554560      case noeof_asstring:
    555         WerrorS("premature end of file while reading till `.`");
     561        err="till `.`";
    556562        break;
    557563      case noeof_string:
    558         WerrorS("premature end of file while reading string");
     564        err="string";
    559565        break;
    560566      case noeof_bracket:
    561         WerrorS("premature end of file while reading (...)");
     567        err="(...)";
    562568        break;
    563569      case noeof_procname:
    564         WerrorS("premature end of file while reading proc");
     570        err="proc";
    565571        break;
    566     }
     572      case noeof_comment:
     573        err="/*...*/";
     574        break;
     575      default:
     576        break;
     577    }
     578    if (err!=NULL)
     579      Werror("premature end of file while reading %s",err);
    567580    return 0;
    568581  }
  • Singular/fglm.h

    r98aa53 re9ad8a6  
    11// emacs edit mode for this file is -*- C++ -*-
    2 // $Id: fglm.h,v 1.8 1998-04-14 15:28:00 Singular Exp $
     2// $Id: fglm.h,v 1.9 1998-06-02 15:29:54 Singular Exp $
    33
    44/****************************************
    55*  Computer Algebra System SINGULAR     *
    66****************************************/
    7 /* 
     7/*
    88* ABSTRACT - The FGLM-Algorithm
    9 *   The main header file for the fglm algorithm         
     9*   The main header file for the fglm algorithm
    1010*   (See fglm.cc for details)
    1111*/
     
    4141{
    4242public:
    43     int insertions; 
     43    int insertions;
    4444    poly monom;
    45     fglmVector v;   
     45    fglmVector v;
    4646    int var;
    4747    fglmDelem( poly & m, fglmVector mv, int v );
     
    5858// Warning: There is no check, if the ideal is really 0-dimensional and minimal.
    5959// If it is minimal but not reduced, then it returns FALSE, otherwise TRUE.
    60 // Warning: There is no check, if the rings are compatible for fglm (see 
     60// Warning: There is no check, if the rings are compatible for fglm (see
    6161// fglm.cc for functions to check this)
    6262// if switchBack==TRUE, then the procedure sets the ring as currentRing which was
     
    7373// first is the sourceRing, second is the given ideal in sourceRing.
    7474// Returns the groebnerbasis of the sourceIdeal in the currentRing.
    75 // Checks, if the ideal is really a reduced groebner basis of a 
     75// Checks, if the ideal is really a reduced groebner basis of a
    7676// 0-dimensional Ideal. Returns TRUE if an error occoured.
    7777BOOLEAN
  • Singular/fglmgauss.h

    r98aa53 re9ad8a6  
    11// emacs edit mode for this file is -*- C++ -*-
    2 // $Id: fglmgauss.h,v 1.2 1997-10-06 12:19:10 obachman Exp $
     2// $Id: fglmgauss.h,v 1.3 1998-06-02 15:29:54 Singular Exp $
    33
    44/****************************************
    55*  Computer Algebra System SINGULAR     *
    66****************************************/
    7 /* 
     7/*
    88* ABSTRACT - header file for the gauss - reducer
    99*            (used by fglm)
     
    1818class gaussElem;
    1919
    20 class gaussReducer 
     20class gaussReducer
    2121{
    2222private:
    2323    int size;
    24     int max; 
    25     gaussElem * elems; 
     24    int max;
     25    gaussElem * elems;
    2626    BOOLEAN * isPivot;
    2727    int * perm;
     
    3232    gaussReducer( int dimen );
    3333    ~gaussReducer();
    34    
     34
    3535    // reduce returns TRUE, if v reduces to 0, FALSE otherwise;
    3636    BOOLEAN reduce( fglmVector v );
    3737
    3838    // if a vector does not reduce to zero, then it can be stored as a new gauss
    39     // vector. 
     39    // vector.
    4040    // Has to be called after reduce!
    4141    void store();
    4242
    4343    // if a vector reduces to zero, then one can get the corresponding fglmVector
    44     // of the linear dependence 
     44    // of the linear dependence
    4545    // Has to be called after reduce!
    4646    fglmVector getDependence();
  • Singular/ipid.h

    r98aa53 re9ad8a6  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: ipid.h,v 1.12 1998-05-04 14:11:38 Singular Exp $ */
     6/* $Id: ipid.h,v 1.13 1998-06-02 15:29:55 Singular Exp $ */
    77/*
    88* ABSTRACT: identfier handling
     
    4242#ifdef RDEBUG
    4343  short      no; /* unique id for rings */
    44 #endif 
     44#endif
    4545};
    4646
  • Singular/kstd1.h

    r98aa53 re9ad8a6  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: kstd1.h,v 1.5 1998-05-14 13:04:17 Singular Exp $ */
     6/* $Id: kstd1.h,v 1.6 1998-06-02 15:29:55 Singular Exp $ */
    77/*
    88* ABSTRACT
     
    2828lists TraceStd(leftv,int , ideal F, ideal Q, tHomog h, intvec ** w,intvec *hilb=NULL,
    2929          int syzComp=0,int newIdeal=0);
    30 #endif         
     30#endif
    3131
    3232/* the following global data are defined in kutil.cc */
  • Singular/libparse.h

    r98aa53 re9ad8a6  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: libparse.h,v 1.6 1998-05-31 15:42:24 krueger Exp $ */
     6/* $Id: libparse.h,v 1.7 1998-06-02 15:29:56 Singular Exp $ */
    77/*
    88* ABSTRACT: lib parsing
     
    1717                                 char *procname, int line, long pos,
    1818                                 BOOLEAN pstatic = FALSE);
    19 int yylplex(char *libname, char *libfile, lib_style_types *lib_style, 
     19int yylplex(char *libname, char *libfile, lib_style_types *lib_style,
    2020            lp_modes=LOAD_LIB);
    2121void reinit_yylp();
     
    4242#  endif
    4343
    44 #endif /* LIBPARSE_H */ 
     44#endif /* LIBPARSE_H */
    4545
    4646
  • Singular/longrat.h

    r98aa53 re9ad8a6  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: longrat.h,v 1.9 1998-05-27 17:14:07 Singular Exp $ */
     6/* $Id: longrat.h,v 1.10 1998-06-02 15:29:56 Singular Exp $ */
    77/*
    88* ABSTRACT: computation with long rational numbers
     
    2020#else
    2121#  define HAVE_LIBGMP1
    22 #endif 
     22#endif
    2323#endif
    2424
  • Singular/misc.cc

    r98aa53 re9ad8a6  
    9090void m2_end(short i)
    9191{
    92   if (i==0)
     92  #ifdef HAVE_TCL
     93  if (tclmode)
     94    PrintTCL('Q',0,NULL);
     95  #endif
     96  if (i<=0)
    9397  {
    9498    #ifdef HAVE_TCL
    95     if (tclmode)
    96       PrintTCL('Q',0,NULL);
    97     else
     99    if (!tclmode)
    98100    #endif
    99       printf("Auf Wiedersehen.\n");
     101      if (BVERBOSE(0))
     102      {
     103        if (i==0)
     104          printf("Auf Wiedersehen.\n");
     105        else
     106          printf("\n$Bye.\n");
     107      }
     108    #ifndef macintosh
     109      #ifdef HAVE_FEREAD
     110        #ifdef HAVE_ATEXIT
     111          fe_reset_input_mode();
     112        #else
     113          fe_reset_input_mode(0,NULL);
     114        #endif
     115      #else
     116        #ifdef HAVE_READLINE
     117          fe_reset_input_mode();
     118        #endif
     119      #endif
     120    #endif
     121    #ifdef sun
     122      #ifndef __svr4__
     123        _cleanup();
     124        _exit(0);
     125      #endif
     126    #endif
     127    exit(0);
    100128  }
    101129  else
    102130  {
    103131    #ifdef HAVE_TCL
    104     if (tclmode)
    105       PrintTCL('Q',0,NULL);
    106     else
     132    if (!tclmode)
    107133    #endif
    108134      printf("\nhalt %d\n",i);
  • Singular/mmemory.h

    r98aa53 re9ad8a6  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: mmemory.h,v 1.8 1998-04-28 08:39:40 obachman Exp $ */
     6/* $Id: mmemory.h,v 1.9 1998-06-02 15:29:58 Singular Exp $ */
    77/*
    88* ABSTRACT
     
    1717
    1818#include "mod2.h"
    19  
     19
    2020#ifdef DO_DEEP_PROFILE
    2121extern void _memcpyW(void* p1, void* p2, long l);
    22 #define  memcpyW(p1, p2, l) _memcpyW((void*) p1, (void*) p2, (long) l) 
    23 #else                                                                   
     22#define  memcpyW(p1, p2, l) _memcpyW((void*) p1, (void*) p2, (long) l)
     23#else
    2424#define memcpyW(p1, p2, l)                      \
    2525do                                              \
     
    4040while(0)
    4141#endif
    42  
     42
    4343
    4444void mmSpecializeBlock( size_t );
     
    4848#ifdef HAVE_SBRK
    4949int mmMemPhysical( void );
    50 #endif 
     50#endif
    5151
    5252#define mstrdup mmStrdup
  • Singular/mpsr.h

    r98aa53 re9ad8a6  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: mpsr.h,v 1.9 1998-05-25 21:28:32 obachman Exp $ */
     4/* $Id: mpsr.h,v 1.10 1998-06-02 15:29:58 Singular Exp $ */
    55/***************************************************************
    66 *
     
    102102#else
    103103    nSetChar(rg->ch, complete, rg->parameter,rg->P);
    104 #endif   
     104#endif
    105105    pChangeRing(rg->N, rg->OrdSgn, rg->order, rg->block0, rg->block1,
    106106                rg->wvhdl);
     
    138138#define MPSR_QUIT_STRING    "MPtcp:quit"
    139139
    140 // some handy Macros for error handlings 
     140// some handy Macros for error handlings
    141141#ifdef MPSR_DEBUG
    142142
     
    250250}                                                   \
    251251while (0)
    252 #undef mpsr_assume   
     252#undef mpsr_assume
    253253#define mpsr_assume(cond) ((void) 0)
    254254
  • Singular/mpsr_Get.h

    r98aa53 re9ad8a6  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: mpsr_Get.h,v 1.2 1997-04-09 12:20:02 Singular Exp $ */
     4/* $Id: mpsr_Get.h,v 1.3 1998-06-02 15:29:59 Singular Exp $ */
    55/***************************************************************
    66 *
     
    3333 ***************************************************************/
    3434
    35 // the data structure which functions as external data 
     35// the data structure which functions as external data
    3636typedef struct mpsr_sleftv
    3737{
     
    7171                                               MPT_Node_pt node,
    7272                                               mpsr_leftv mlv,
    73                                                short quote); 
     73                                               short quote);
    7474extern mpsr_Status_t mpsr_GetOperatorLeftv(MP_Link_pt link,
    7575                                         MPT_Node_pt node,
    7676                                         mpsr_leftv mlv,
    77                                          short quote); 
     77                                         short quote);
    7878extern MPT_Status_t mpsr_GetExternalData(MP_Link_pt link,
    7979                                         MPT_Arg_t  *odata,
     
    8686 *
    8787 ***************************************************************/
    88 inline BOOLEAN NodeCheck(MPT_Node_pt node, MP_NodeType_t type, 
     88inline BOOLEAN NodeCheck(MPT_Node_pt node, MP_NodeType_t type,
    8989                        MP_DictTag_t dtag, MP_Common_t cv)
    9090{
  • Singular/mpsr_Put.h

    r98aa53 re9ad8a6  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: mpsr_Put.h,v 1.6 1998-01-16 14:29:56 krueger Exp $ */
     4/* $Id: mpsr_Put.h,v 1.7 1998-06-02 15:29:59 Singular Exp $ */
    55/***************************************************************
    66 *
     
    1111 * Change History (most recent first):
    1212 *  o 1/97 obachman
    13  *    Updated putting routines to MP and MPP v1.1 
     13 *    Updated putting routines to MP and MPP v1.1
    1414 *
    1515 ***************************************************************/
     
    3131 *
    3232 ***************************************************************/
    33 // some often used flags settings for annotations 
     33// some often used flags settings for annotations
    3434#define MP_AnnotReqValTree                                  \
    3535(MP_AnnotRequired | MP_AnnotValuated | MP_AnnotTreeScope)
     
    170170{
    171171  command cmd = (command) v->Data();
    172  
     172
    173173  typecheck(v, COMMAND);
    174174  if (cmd->op == PROC_CMD)
  • Singular/ndbm.cc

    r98aa53 re9ad8a6  
    55//**************************************************************************/
    66//
    7 // $Id: ndbm.cc,v 1.9 1998-04-09 11:47:13 pohl Exp $
     7// $Id: ndbm.cc,v 1.10 1998-06-02 15:30:00 Singular Exp $
    88//
    99//**************************************************************************/
     
    144144{
    145145  long hash;
    146  
     146
    147147  hash = dcalchash(key);
    148148  for (db->dbm_hmask=0;; db->dbm_hmask=(db->dbm_hmask<<1)+1) {
     
    233233  }
    234234  return (0);
    235  
     235
    236236split:
    237237  if (key.dsize+dat.dsize+3*sizeof(short) >= PBLKSIZ) {
     
    279279dbm_firstkey(DBM *db)
    280280{
    281  
     281
    282282  db->dbm_blkptr = 0L;
    283283  db->dbm_keyptr = 0;
     
    290290  struct stat statb;
    291291  datum item;
    292  
     292
    293293  if (dbm_error(db) || fstat(db->dbm_pagf, &statb) < 0)
    294294                goto err;
     
    348348  long bn;
    349349  register b, i, n;
    350        
     350
    351351
    352352  if (db->dbm_bitno > db->dbm_maxbno)
     
    398398
    399399  sp = (short *)buf;
    400   if ((unsigned)n >= sp[0]) {
     400  if ((unsigned)n >= (unsigned)sp[0])
     401  {
    401402    item.dptr = NULL;
    402403    item.dsize = 0;
     
    483484  register long hashl;
    484485  register int hashi;
    485  
     486
    486487  hashl = 0;
    487488  hashi = 0;
     
    504505{
    505506  register short *sp, *sp1;
    506   register i1, i2;
     507  register int i1, i2;
    507508
    508509  sp = (short *)buf;
    509510  i2 = sp[0];
    510   if ((unsigned)n >= i2 || (n & 1))
     511  if ((unsigned)n >= (unsigned)i2 || (n & 1))
    511512    return (0);
    512   if (n == i2-2) {
     513  if (n == i2-2)
     514  {
    513515    sp[0] -= 2;
    514516    return (1);
  • Singular/polys-comp.h

    r98aa53 re9ad8a6  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: polys-comp.h,v 1.7 1998-04-30 15:29:34 obachman Exp $ */
     6/* $Id: polys-comp.h,v 1.8 1998-06-02 15:30:01 Singular Exp $ */
    77
    88/***************************************************************
     
    2525}                                                           \
    2626while(0)
    27  
     27
    2828#define _pMonComp_otEXPCOMP_nwONE(p1, p2, d, actionD, actionE)  \
    2929do                                                              \
     
    5252}                                                           \
    5353while(0)
    54  
     54
    5555#define _pMonComp_otEXPCOMP_nwTWO(p1, p2, d, actionD, actionE)  \
    5656do                                                              \
     
    7070}                                                               \
    7171while(0)
    72  
     72
    7373#define _pMonComp_otEXP_nwEVEN(p1, p2, length, d, actionD, actionE) \
    7474do                                                                  \
     
    114114}                                                                   \
    115115while(0)
    116  
     116
    117117#define _pMonComp_otEXPCOMP_nwEVEN(p1, p2, length, d, actionD, actionE) \
    118118do                                                                      \
     
    145145}                                                                       \
    146146while(0)
    147  
     147
    148148#define _pMonComp_otEXPCOMP_nwODD(p1, p2, length, d, actionD, actionE)  \
    149149do                                                                      \
     
    222222while(0)
    223223
    224  
     224
    225225#else //  ! WORDS_BIGENDIAN
    226226
     
    233233}                                                                           \
    234234while(0)
    235  
     235
    236236#define _pMonComp_otEXPCOMP_nwONE(p1, p2, d, actionD, actionE)              \
    237237do                                                                          \
     
    260260}                                                           \
    261261while(0)
    262  
     262
    263263#define _pMonComp_otEXPCOMP_nwTWO(p1, p2, d, actionD, actionE)  \
    264264do                                                              \
     
    280280}                                                               \
    281281while(0)
    282  
     282
    283283#define _pMonComp_otEXP_nwEVEN(p1, p2, length, d, actionD, actionE) \
    284284do                                                                  \
     
    323323}                                                                   \
    324324while(0)
    325  
     325
    326326#define _pMonComp_otEXPCOMP_nwEVEN(p1, p2, length, d, actionD, actionE) \
    327327do                                                                      \
     
    354354}                                                                       \
    355355while(0)
    356  
     356
    357357#define _pMonComp_otEXPCOMP_nwODD(p1, p2, length, d, actionD, actionE)  \
    358358do                                                                      \
     
    403403}                                                                   \
    404404while(0)
    405  
     405
    406406#define _pMonComp_otEXPCOMP_nwGEN(p1, p2, length, d, actionD, actionE) \
    407407do                                                                      \
  • Singular/polys-impl.h

    r98aa53 re9ad8a6  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: polys-impl.h,v 1.21 1998-03-23 22:51:03 obachman Exp $ */
     6/* $Id: polys-impl.h,v 1.22 1998-06-02 15:30:02 Singular Exp $ */
    77
    88/***************************************************************
     
    142142  VarHighIndex = nvars - 1;
    143143#else //  ! WORDS_BIGENDIAN
    144   temp *= sizeof(long)/sizeof(Exponent_t); 
     144  temp *= sizeof(long)/sizeof(Exponent_t);
    145145  VarHighIndex = temp -1;
    146146  VarLowIndex = temp - nvars;
     
    153153  pGetVarIndicies_Lex(nvars,pVarOffset,pVarCompIndex,   \
    154154                      pVarLowIndex,pVarHighIndex)
    155  
     155
    156156
    157157
     
    170170  VarHighIndex = nvars-1;
    171171#else //  ! WORDS_BIGENDIAN
    172   temp *= sizeof(long)/sizeof(Exponent_t); 
     172  temp *= sizeof(long)/sizeof(Exponent_t);
    173173  VarHighIndex = temp -1;
    174174  VarLowIndex = temp - nvars;
     
    511511  p1->coef = p2->coef;
    512512  p1->Order = Order;
    513  
     513
    514514  for (;;)
    515515  {
     
    554554  const unsigned long* s2 = (unsigned long*) &(b->exp[0]);
    555555#endif
    556  
     556
    557557  for (;;)
    558558  {
     
    625625/***************************************************************
    626626 *
    627  * Routines which implement low-level manipulations/operations 
     627 * Routines which implement low-level manipulations/operations
    628628 * on exponents and "are allowed" to access single exponetns
    629629 *
  • Singular/polys.h

    r98aa53 re9ad8a6  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: polys.h,v 1.14 1998-05-28 16:50:51 Singular Exp $ */
     6/* $Id: polys.h,v 1.15 1998-06-02 15:30:02 Singular Exp $ */
    77/*
    88* ABSTRACT - all basic methods to manipulate polynomials
     
    7676
    7777// Gets/Sets Component field w.r.t. of polys of global ring
    78 #define pSetComp(p,k)       _pSetComp(p,k)   
     78#define pSetComp(p,k)       _pSetComp(p,k)
    7979#define pGetComp(p)         _pGetComp(p)
    8080#define pIncrComp(p)        _pIncrComp(p)
     
    8484
    8585// Gets/Sets Component field w.r.t. of polys of ring r
    86 #define pRingSetComp(r,p,k)       _pRingSetComp(r,p,k)   
     86#define pRingSetComp(r,p,k)       _pRingSetComp(r,p,k)
    8787#define pRingGetComp(r,p)         _pRingGetComp(r,p)
    8888
     
    9696
    9797// Increments/decrements ith exponent by one
    98 #define pIncrExp(p,i)       _pIncrExp(p,i)   
    99 #define pDecrExp(p,i)       _pDecrExp(p,i)   
     98#define pIncrExp(p,i)       _pIncrExp(p,i)
     99#define pDecrExp(p,i)       _pDecrExp(p,i)
    100100
    101101// Gets Difference and sum of ith Exponent of m1, m2
     
    104104
    105105// Adds/Substracts v to/from the ith Exponent
    106 #define pAddExp(p,i,v)      _pAddExp(p,i,v) 
    107 #define pSubExp(p,i,v)      _pSubExp(p,i,v) 
     106#define pAddExp(p,i,v)      _pAddExp(p,i,v)
     107#define pSubExp(p,i,v)      _pSubExp(p,i,v)
    108108#define pMultExp(p,i,v)     _pMultExp(p,i,v)
    109109
     
    209209
    210210// return TRUE, if exponent and component of Lm(p1) and Lm(p2) are equal,
    211 // FALSE otherwise; 
     211// FALSE otherwise;
    212212#define pEqual(p1, p2) _pEqual(p1, p2) // Assumes p1 != NULL & p2 != NULL
    213213inline BOOLEAN pLmEqual(poly p1, poly p2) // no assumptions
     
    265265void      pCleardenom(poly p);
    266266
    267 // homogenizes p by multiplying certain powers of the varnum-th variable 
     267// homogenizes p by multiplying certain powers of the varnum-th variable
    268268poly      pHomogen (poly p, int varnum);
    269  
     269
    270270// replaces the maximal powers of the leading monomial of p2 in p1 by
    271271// the same powers of n, utility for dehomogenization
  • Singular/ring.h

    r98aa53 re9ad8a6  
    77* ABSTRACT - the interpreter related ring operations
    88*/
    9 /* $Id: ring.h,v 1.14 1998-05-28 16:50:54 Singular Exp $ */
     9/* $Id: ring.h,v 1.15 1998-06-02 15:30:03 Singular Exp $ */
    1010
    1111/* includes */
     
    7171{
    7272  rOrderType_General = 0, // non-simple ordering as specified by currRing
    73   rOrderType_CompExp,     // simple ordering, component has priority 
     73  rOrderType_CompExp,     // simple ordering, component has priority
    7474  rOrderType_ExpComp,     // simple ordering, exponent vector has priority
    7575                          // component not compatible with exp-vector order
  • Singular/scanner.l

    r98aa53 re9ad8a6  
    33*  Computer Algebra System SINGULAR     *
    44****************************************/
    5 /* $Id: scanner.l,v 1.12 1998-04-07 08:30:32 Singular Exp $ */
     5/* $Id: scanner.l,v 1.13 1998-06-02 15:30:04 Singular Exp $ */
    66#include <stdio.h>
    77#include <string.h>
     
    2828static char * dupyytext()
    2929{
    30   //int i = strlen((char *)yytext);
    31   //if (i>0) yytext[i-1] = '\0';
    3230  if (yyleng>0) yytext[yyleng-1] = '\0';
    3331  return mstrdup((char *)yytext);
     
    4038  if (i>0)
    4139  {
    42     yytext[i-1] = '\0';
    43     strcpy( rc, (char *)yytext );
     40    strncpy( rc, (char *)yytext, i-1 );
    4441  }
    4542  else
     43  {
    4644    i++;
     45  }
    4746  rc[i-1] = '\n';
    4847  rc[i] = '\n';
     
    9392\/\/[^\n]*               { }
    9493^#![^\n]*                { }
     94"/*"                     {
     95                           yy_noeof=noeof_comment;
     96                           loop
     97                           {
     98                             register int c;
     99                             while ( (c = yyinput()) != '*' && c != EOF );
     100                             if ( c == '*' )
     101                             {
     102                               while ( (c = yyinput()) == '*' );
     103                               if ( c == '/' ) break; /* found the end */
     104                             }
     105                             else
     106                             {
     107                               break;
     108                             }
     109                           }
     110                           yy_noeof=0;
     111                         }
    95112pause[ \t\n]*[\.;]       { fePause(); }
    96113while                    { blocknest = 0; yy_noeof = noeof_brace; BEGIN(brace);
     
    254271                         }
    255272\$                       {
    256                            #ifdef HAVE_TCL
    257                            if (tclmode)
    258                              PrintTCL('Q',0,NULL);
    259                            else
    260                            #endif
    261                            { if (BVERBOSE(0)) printf("\n$Bye.\n"); }
    262                            #ifndef macintosh
    263                              #ifdef HAVE_FEREAD
    264                                #ifdef HAVE_ATEXIT
    265                                  fe_reset_input_mode();
    266                                #else
    267                                  fe_reset_input_mode(0,NULL);
    268                                #endif
    269                              #else
    270                                #ifdef HAVE_READLINE
    271                                  fe_reset_input_mode();
    272                                #endif
    273                              #endif
    274                            #endif
    275                            #ifdef sun
    276                            #ifndef __svr4__
    277                            _cleanup();
    278                            _exit(0);
    279                            #endif
    280                            #endif
    281                            exit(0);
     273                           m2_end(-1);
    282274                         }
    283275(quit|exit)[ \t\n]*[\.;]?  {
    284                            #ifdef HAVE_TCL
    285                              if (tclmode)
    286                                PrintTCL('Q',0,NULL);
    287                              else
    288                            #endif
    289276                           #ifdef MM_STAT
    290277                           mmStat(-500);
    291                            #endif
    292                            { if (BVERBOSE(0)) printf("\nAuf Wiedersehen.\n"); }
    293                            #ifndef macintosh
    294                              #ifdef HAVE_FEREAD
    295                                #ifdef HAVE_ATEXIT
    296                                  fe_reset_input_mode();
    297                                #else
    298                                  fe_reset_input_mode(0,NULL);
    299                                #endif
    300                              #else
    301                                #ifdef HAVE_READLINE
    302                                  fe_reset_input_mode();
    303                                #endif
    304                              #endif
    305278                           #endif
    306279                           #ifdef MDEBUG
     
    309282                             #endif
    310283                           #endif
    311                            #ifdef sun
    312                            #ifndef __svr4__
    313                            _cleanup();
    314                            _exit(0);
    315                            #endif
    316                            #endif
    317                            exit(0);
     284                           m2_end(0);
    318285                         }
    319286
  • Singular/silink.h

    r98aa53 re9ad8a6  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: silink.h,v 1.8 1997-08-12 17:14:43 Singular Exp $ */
     6/* $Id: silink.h,v 1.9 1998-06-02 15:30:04 Singular Exp $ */
    77/*
    88* ABSTRACT: general interface to links
     
    3838{
    3939  si_link_extension m; // methods
    40   char *mode;   
    41   char *name;          // used for filename and/or further specs 
     40  char *mode;
     41  char *name;          // used for filename and/or further specs
    4242  void *data;          // the link itself
    4343  BITSET flags;        // 0=close open = 1: read = 2: write = 3
  • Singular/spSpolyLoop.h

    r98aa53 re9ad8a6  
    1717spSpolyLoopProc spGetSpolyLoop(ring r, rOrderType_t ot, BOOLEAN homog);
    1818
    19 inline spSpolyLoopProc spGetSpolyLoop(ring r, int modrank, int syzComp, 
     19inline spSpolyLoopProc spGetSpolyLoop(ring r, int modrank, int syzComp,
    2020                                      BOOLEAN homog)
    2121{
     
    2525inline spSpolyLoopProc spGetSpolyLoop(ring r, kStrategy strat)
    2626{
    27   return spGetSpolyLoop(r, spGetOrderType(r, strat->ak, strat->syzComp), 
    28                         ((strat->homog && strat->kModW==NULL && 
     27  return spGetSpolyLoop(r, spGetOrderType(r, strat->ak, strat->syzComp),
     28                        ((strat->homog && strat->kModW==NULL &&
    2929                          ! rHasSimpleLexOrder(r))));
    3030}
     
    3232inline spSpolyLoopProc spGetSpolyLoop(ring r, kStrategy strat, int syzComp)
    3333{
    34   return spGetSpolyLoop(r, spGetOrderType(r, strat->ak, syzComp), 
    35                         ((strat->homog && strat->kModW==NULL && 
     34  return spGetSpolyLoop(r, spGetOrderType(r, strat->ak, syzComp),
     35                        ((strat->homog && strat->kModW==NULL &&
    3636                          ! rHasSimpleLexOrder(r))));
    3737}
  • Singular/structs.h

    r98aa53 re9ad8a6  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: structs.h,v 1.11 1998-04-28 09:39:27 pohl Exp $ */
     6/* $Id: structs.h,v 1.12 1998-06-02 15:30:05 Singular Exp $ */
    77/*
    88* ABSTRACT
     
    2929  noeof_asstring,
    3030  noeof_block,
    31   noeof_string,
    3231  noeof_bracket,
    33   noeof_procname
     32  noeof_comment,
     33  noeof_procname,
     34  noeof_string
    3435};
    3536
  • Singular/tok.h

    r98aa53 re9ad8a6  
    77* ABSTRACT: token for interpreter, as types; general macros
    88*/
    9 /* $Id: tok.h,v 1.17 1998-05-19 18:08:41 Singular Exp $ */
     9/* $Id: tok.h,v 1.18 1998-06-02 15:30:06 Singular Exp $ */
    1010
    1111#ifndef MYYSTYPE
     
    2929#endif
    3030
    31 #if defined(__cplusplus) 
     31#if defined(__cplusplus)
    3232inline int max(const int a, const int b)  { return (a>b) ? a : b; }
    3333inline int min(const int a, const int b)  { return (a<b) ? a : b; }
Note: See TracChangeset for help on using the changeset viewer.