URI:
       tsubr.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
       ---
       tsubr.c (2027B)
       ---
            1 #include "mplot.h"
            2 #define pSMALL    0.5
            3 struct penvir  E[9] = {
            4 { 0., 1024., 0., 0., 1., -1.,1024., -1024., 0., 0., pSMALL, 1., 1, 0.,1, DBlack, DWhite},
            5 { 0., 1024., 0., 0., 1., -1.,1024., -1024., 0., 0., pSMALL, 1., 1, 0.,1, DBlack, DWhite},
            6 { 0., 1024., 0., 0., 1., -1.,1024., -1024., 0., 0., pSMALL, 1., 1, 0.,1, DBlack, DWhite},
            7 { 0., 1024., 0., 0., 1., -1.,1024., -1024., 0., 0., pSMALL, 1., 1, 0.,1, DBlack, DWhite},
            8 { 0., 1024., 0., 0., 1., -1.,1024., -1024., 0., 0., pSMALL, 1., 1, 0.,1, DBlack, DWhite},
            9 { 0., 1024., 0., 0., 1., -1.,1024., -1024., 0., 0., pSMALL, 1., 1, 0.,1, DBlack, DWhite},
           10 { 0., 1024., 0., 0., 1., -1.,1024., -1024., 0., 0., pSMALL, 1., 1, 0.,1, DBlack, DWhite},
           11 { 0., 1024., 0., 0., 1., -1.,1024., -1024., 0., 0., pSMALL, 1., 1, 0.,1, DBlack, DWhite}
           12 };
           13 struct penvir *e0 = E, *e1 = &E[1], *esave;
           14 int
           15 bcolor(char *s){
           16         while (*s != 0) {
           17                 switch (*s) {
           18                 case '0': case '1': case '2': case '3': case '4':
           19                 case '5': case '6': case '7': case '8': case '9':
           20                         return strtoul(s, 0, 0);
           21                 case 'k':  case 'z':        /* zero was old name for kblack */
           22                         return(DBlack);
           23                 case 'r':
           24                         return(DRed);
           25                 case 'g':
           26                         return(DGreen);
           27                 case 'b':
           28                         return(DBlue);
           29                 case 'm':
           30                         return(DMagenta);
           31                 case 'y':
           32                         return(DYellow);
           33                 case 'c':
           34                         return(DCyan);
           35                 case 'w':
           36                         return(DWhite);
           37                 case 'R':
           38                         return(atoi(s + 1));
           39                 case 'G':
           40                         e1->pgap = atof(s + 1);
           41                         return(-1);
           42                 case 'A':
           43                         e1->pslant = (180. - atof(s + 1)) / RADIAN;
           44                         return(-1);
           45                 }
           46                 while (*++s != 0)
           47                         if (*s == '/') {
           48                                 s++;
           49                                 break;
           50                         }
           51         }
           52         return DBlack;
           53 }
           54 void sscpy(struct penvir *a, struct penvir *b){ /* copy 'a' onto 'b' */
           55         b->left = a->left;
           56         b->bottom = a->bottom;
           57         b->xmin = a->xmin;
           58         b->ymin = a->ymin;
           59         b->scalex = a->scalex;
           60         b->scaley = a->scaley;
           61         b->sidex = a->sidex;
           62         b->sidey = a->sidey;
           63         b->copyx = a->copyx;
           64         b->copyy = a->copyy;
           65         b->quantum = a->quantum;
           66         b->grade = a->grade;
           67         b->pmode = a->pmode;
           68         b->foregr = a->foregr;
           69         b->backgr = a->backgr;
           70 }
           71 void idle(void){}
           72 
           73 void ptype(char *s){USED(s);}