URI:
       tfunny.c - plan9port - [fork] Plan 9 from user space
  HTML git clone git://src.adamsgaard.dk/plan9port
   DIR Log
   DIR Files
   DIR Refs
   DIR README
   DIR LICENSE
       ---
       tfunny.c (718B)
       ---
            1 #include "e.h"
            2 #include "y.tab.h"
            3 
            4 extern int Funnyps;
            5 extern double Funnyht, Funnybase;
            6 
            7 void funny(int n)
            8 {
            9         char *f = 0;
           10 
           11         yyval = salloc();
           12         switch (n) {
           13         case SUM:
           14                 f = lookup(deftbl, "sum_def")->cval; break;
           15         case UNION:
           16                 f = lookup(deftbl, "union_def")->cval; break;
           17         case INTER:        /* intersection */
           18                 f = lookup(deftbl, "inter_def")->cval; break;
           19         case PROD:
           20                 f = lookup(deftbl, "prod_def")->cval; break;
           21         default:
           22                 ERROR "funny type %d in funny", n FATAL;
           23         }
           24         printf(".ds %d %s\n", (int)yyval, f);
           25         eht[yyval] = EM(1.0, ps+Funnyps) - EM(Funnyht, ps);
           26         ebase[yyval] = EM(Funnybase, ps);
           27         dprintf(".\tS%d <- %s; h=%g b=%g\n",
           28                 (int)yyval, f, eht[yyval], ebase[yyval]);
           29         lfont[yyval] = rfont[yyval] = ROM;
           30 }