Changeset f1918b in git for Singular/iparith.cc


Ignore:
Timestamp:
Nov 18, 2010, 4:21:59 PM (13 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
cde7084dc141670809afd29cafbd9c571bd9fc3a
Parents:
4138ab2842a81ef497d1f21e1ed50c9133d45a6e
Message:
thre are rules....

git-svn-id: file:///usr/local/Singular/svn/trunk@13659 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/iparith.cc

    r4138ab rf1918b  
    207207
    208208/*=================== operations with 2 args.: static proc =================*/
    209 static BOOLEAN jjWAIT1ST2(leftv res, leftv u, leftv v)
    210 {
    211   lists Lforks = (lists)u->Data();
    212   int t = (int)(long)v->Data();
    213   int i = slStatusSsiL(Lforks, t*1000);
    214   if ( i < 0 ) i = 0;
    215   res->data = (void*)(long)i;
    216   return FALSE;
    217 }
    218 /* returns 1 iff all forks are finished; 0 otherwise */
    219 static BOOLEAN jjWAITALL2(leftv res, leftv u, leftv v)
    220 {
    221   lists Lforks = (lists)u->Data();
    222   int timeout = 1000*(int)(long)v->Data();
    223   lists oneFork=(lists)omAllocBin(slists_bin);
    224   oneFork->Init(1);
    225   int i;
    226   int t = getTimer();
    227   int ret = 1;
    228   for (int j = 0; j <= Lforks->nr; j++)
    229   {
    230     oneFork->m[0].Copy(&Lforks->m[j]);
    231     i = slStatusSsiL(oneFork, timeout);
    232     if (i == 1)
    233     {
    234       timeout = timeout - getTimer() + t;
    235     }
    236     else { ret = 0; j = Lforks->nr+1; /* terminate the for loop */ }
    237     omFreeSize((ADDRESS)oneFork->m,sizeof(sleftv));
    238   }
    239   omFreeBin((ADDRESS)oneFork, slists_bin);
    240   res->data = (void*)(long)ret;
    241   return FALSE;
    242 }
     209/* must be ordered: first operations for chars (infix ops),
     210 * then alphabetically */
    243211
    244212static BOOLEAN jjOP_IV_I(leftv res, leftv u, leftv v)
     
    23402308  setFlag(res,FLAG_STD); v->flag=0;
    23412309  return FALSE;
     2310}
     2311static BOOLEAN jjLOAD2(leftv res, leftv u,leftv v)
     2312{
     2313  return jjLOAD(res, v,TRUE);
    23422314}
    23432315static BOOLEAN jjLOAD_E(leftv res, leftv v, leftv u)
     
    37083680  return FALSE;
    37093681}
     3682static BOOLEAN jjWAIT1ST2(leftv res, leftv u, leftv v)
     3683{
     3684  lists Lforks = (lists)u->Data();
     3685  int t = (int)(long)v->Data();
     3686  int i = slStatusSsiL(Lforks, t*1000);
     3687  if ( i < 0 ) i = 0;
     3688  res->data = (void*)(long)i;
     3689  return FALSE;
     3690}
     3691static BOOLEAN jjWAITALL2(leftv res, leftv u, leftv v)
     3692{
     3693/* returns 1 iff all forks are finished; 0 otherwise */
     3694  lists Lforks = (lists)u->Data();
     3695  int timeout = 1000*(int)(long)v->Data();
     3696  lists oneFork=(lists)omAllocBin(slists_bin);
     3697  oneFork->Init(1);
     3698  int i;
     3699  int t = getTimer();
     3700  int ret = 1;
     3701  for (int j = 0; j <= Lforks->nr; j++)
     3702  {
     3703    oneFork->m[0].Copy(&Lforks->m[j]);
     3704    i = slStatusSsiL(oneFork, timeout);
     3705    if (i == 1)
     3706    {
     3707      timeout = timeout - getTimer() + t;
     3708    }
     3709    else { ret = 0; j = Lforks->nr+1; /* terminate the for loop */ }
     3710    omFreeSize((ADDRESS)oneFork->m,sizeof(sleftv));
     3711  }
     3712  omFreeBin((ADDRESS)oneFork, slists_bin);
     3713  res->data = (void*)(long)ret;
     3714  return FALSE;
     3715}
    37103716static BOOLEAN jjWEDGE(leftv res, leftv u, leftv v)
    37113717{
     
    37213727
    37223728/*=================== operations with 1 arg.: static proc =================*/
    3723 
    3724 BOOLEAN jjWAIT1ST1(leftv res, leftv a)
    3725 {
    3726   lists Lforks = (lists)a->Data();
    3727   int i = slStatusSsiL(Lforks, -1);
    3728   while (i <= 0) i = slStatusSsiL(Lforks, 10000000); /* redo this all 10 seconds */
    3729   res->data = (void*)(long)i;
    3730   return FALSE;
    3731 }
    3732 
    3733 BOOLEAN jjWAITALL1(leftv res, leftv a)
    3734 {
    3735   lists Lforks = (lists)a->Data();
    3736   lists oneFork=(lists)omAllocBin(slists_bin);
    3737   oneFork->Init(1);
    3738   int i;
    3739   for (int j = 0; j <= Lforks->nr; j++)
    3740   {
    3741     oneFork->m[0].Copy(&Lforks->m[j]);
    3742     i = slStatusSsiL(oneFork, -1);
    3743     while (i != 1) i = slStatusSsiL(oneFork, 10000000); /* redo this all 10 seconds */
    3744     omFreeSize((ADDRESS)oneFork->m,sizeof(sleftv));
    3745   }
    3746   omFreeBin((ADDRESS)oneFork, slists_bin);
    3747   return FALSE;
    3748 }
     3729/* must be ordered: first operations for chars (infix ops),
     3730 * then alphabetically */
    37493731
    37503732static BOOLEAN jjDUMMY(leftv res, leftv u)
     
    44584440  }
    44594441  return FALSE;
     4442}
     4443static BOOLEAN jjLOAD1(leftv res, leftv v)
     4444{
     4445  return jjLOAD(res, v,FALSE);
    44604446}
    44614447static BOOLEAN jjLISTRING(leftv res, leftv v)
     
    50895075  return FALSE;
    50905076}
     5077BOOLEAN jjWAIT1ST1(leftv res, leftv a)
     5078{
     5079  lists Lforks = (lists)a->Data();
     5080  int i = slStatusSsiL(Lforks, -1);
     5081  while (i <= 0) i = slStatusSsiL(Lforks, 10000000); /* redo this all 10 seconds */
     5082  res->data = (void*)(long)i;
     5083  return FALSE;
     5084}
     5085
     5086BOOLEAN jjWAITALL1(leftv res, leftv a)
     5087{
     5088  lists Lforks = (lists)a->Data();
     5089  lists oneFork=(lists)omAllocBin(slists_bin);
     5090  oneFork->Init(1);
     5091  int i;
     5092  for (int j = 0; j <= Lforks->nr; j++)
     5093  {
     5094    oneFork->m[0].Copy(&Lforks->m[j]);
     5095    i = slStatusSsiL(oneFork, -1);
     5096    while (i != 1) i = slStatusSsiL(oneFork, 10000000); /* redo this all 10 seconds */
     5097    omFreeSize((ADDRESS)oneFork->m,sizeof(sleftv));
     5098  }
     5099  omFreeBin((ADDRESS)oneFork, slists_bin);
     5100  return FALSE;
     5101}
     5102
    50915103#ifdef HAVE_FANS
    50925104static BOOLEAN jjCONERAYS1(leftv res, leftv v)
     
    52345246}*/
    52355247#endif /* HAVE_FANS */
    5236 static BOOLEAN jjLOAD1(leftv res, leftv v)
    5237 {
    5238   return jjLOAD(res, v,iiOp==LIB_CMD);
    5239 }
    52405248static BOOLEAN jjLOAD(leftv res, leftv v, BOOLEAN autoexport)
    52415249{
     
    55135521}
    55145522/*=================== operations with 3 args.: static proc =================*/
     5523/* must be ordered: first operations for chars (infix ops),
     5524 * then alphabetically */
    55155525static BOOLEAN jjBRACK_S(leftv res, leftv u, leftv v,leftv w)
    55165526{
     
    67546764
    67556765/*=================== operations with many arg.: static proc =================*/
     6766/* must be ordered: first operations for chars (infix ops),
     6767 * then alphabetically */
    67566768static BOOLEAN jjBREAK0(leftv res, leftv v)
    67576769{
     
    79207932
    79217933/*=================== operations with 2 args. ============================*/
     7934/* must be ordered: first operations for chars (infix ops),
     7935 * then alphabetically */
    79227936
    79237937BOOLEAN iiExprArith2(leftv res, leftv a, int op, leftv b, BOOLEAN proccall)
     
    81338147
    81348148/*==================== operations with 1 arg. ===============================*/
     8149/* must be ordered: first operations for chars (infix ops),
     8150 * then alphabetically */
    81358151
    81368152BOOLEAN iiExprArith1(leftv res, leftv a, int op)
     
    83268342
    83278343/*=================== operations with 3 args. ============================*/
     8344/* must be ordered: first operations for chars (infix ops),
     8345 * then alphabetically */
    83288346
    83298347BOOLEAN iiExprArith3(leftv res, int op, leftv a, leftv b, leftv c)
     
    85388556}
    85398557/*==================== operations with many arg. ===============================*/
     8558/* must be ordered: first operations for chars (infix ops),
     8559 * then alphabetically */
    85408560
    85418561BOOLEAN jjANY2LIST(leftv res, leftv v, int cnt)
Note: See TracChangeset for help on using the changeset viewer.