Changeset a88046d in git


Ignore:
Timestamp:
Feb 22, 2011, 3:59:00 PM (13 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
44e1b7f0f7a27c9f7b399a40751abcd38bf57a36
Parents:
f12c61125d77d6d34a5e0a4f7a5f3ab7ebbc0403
Message:
version/option for ssi link

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

Legend:

Unmodified
Added
Removed
  • Singular/newstruct.cc

    rf12c611 ra88046d  
    194194            &&(al->m[nm->pos-1].data!=(void*)0L))
    195195            {
    196               Werror("different ring %lx(data) - %lx(basering)", al->m[nm->pos-1].data,currRing);
     196              Werror("different ring %lx(data) - %lx(basering)",
     197                (long unsigned)(al->m[nm->pos-1].data),(long unsigned)currRing);
    197198              return TRUE;
    198199            }
  • Singular/ssiLink.cc

    rf12c611 ra88046d  
    3939#include <Singular/lists.h>
    4040#include <Singular/ssiLink.h>
     41
     42
     43#define SSI_VERSION 1
    4144
    4245typedef struct
     
    638641      }
    639642    }
     643    // ---------------------------------------------------------------------
    640644    else if (strcmp(mode,"tcp")==0)
    641645    {
     
    686690      close(sockfd);
    687691    }
    688     // stdin or stdout
    689     else if (flag == SI_LINK_READ)
    690     {
    691       d->f_read = stdin;
    692       mode = "r";
    693     }
     692    // no ssi-Link on stdin or stdout
    694693    else
    695694    {
    696       d->f_write = stdout;
    697       mode = "a";
    698     }
    699   }
     695      Werror("invalid mode >>%s<< for ssi",mode);
     696      l->data=NULL;
     697      omFree(d);
     698      return TRUE;
     699    }
     700  }
     701  // =========================================================================
    700702  else /*l->name=NULL*/
    701703  {
     
    776778      SI_LINK_SET_RW_OPEN_P(l);
    777779      close(sockfd);
    778     }
     780      fprintf(d->f_write,"98 %d %d %u %u\n",SSI_VERSION,MAX_TOK,test,verbose);
     781    }
     782    // ----------------------------------------------------------------------
    779783    else if(strcmp(mode,"connect")==0)
    780784    {
     
    815819      }
    816820    }
     821    // ======================================================================
    817822    else
    818823    {
    819       // normal ascii link to a file
     824      // normal link to a file
    820825      FILE *outfile;
    821826      char *filename=l->name;
     
    838843      {
    839844        if (strcmp(l->mode,"r")==0) d->f_read = outfile;
    840         else d->f_write = outfile;
     845        else
     846        {
     847          d->f_write = outfile;
     848          fprintf(d->f_write,"98 %d %d %u %u\n",SSI_VERSION,MAX_TOK,test,verbose);
     849        }
    841850      }
    842851      else
     
    975984             res->data=ssiReadIntvec(d);
    976985             break;
     986    // ------------
     987    case 98: // version
     988             {
     989                int n98_v,n98_m;
     990                BITSET n98_o1,n98_o2;
     991                fscanf(d->f_read,"%d %d %u %u\n",&n98_v,&n98_m,&n98_o1,&n98_o2);
     992                if ((n98_v!=SSI_VERSION) ||(n98_m!=MAX_TOK))
     993                {
     994                  Print("incompatible versions of ssi: %d/%d vs %d/%d",
     995                                  SSI_VERSION,MAX_TOK,n98_v,n98_m);
     996                }
     997                test=n98_o1;
     998                verbose=n98_o2;
     999                break;
     1000             }
    9771001    case 99: ssiClose(l); exit(0);
    9781002    case 0: if (feof(d->f_read))
     
    12751299// 17 intvec <len> ...
    12761300//
     1301// 98: verify version: <ssi-version> <MAX_TOK> <OPT1> <OPT2>
    12771302// 99: quit Singular
Note: See TracChangeset for help on using the changeset viewer.