Annotation of researchv10no/libplot/lib4014/subr.c, revision 1.1

1.1     ! root        1: #include <stdio.h>
        !             2: #include <math.h>
        !             3: #include "tek.h"
        !             4: #define pHEIGHT 3120.
        !             5: #define pWIDTH  3120.
        !             6: #define pSMALL    0.2
        !             7: struct penvir E[9] = {
        !             8: { 0, 0,
        !             9: 0., 0., 1., 1., pWIDTH, pHEIGHT, 0., 0.,
        !            10: pSMALL, 1., 31, 0., '`', '`'},
        !            11: { 0, 0,
        !            12: 0., 0., 1., 1., pWIDTH, pHEIGHT, 0., 0.,
        !            13: pSMALL, 1., 31, 0., '`', '`'},
        !            14: { 0, 0,
        !            15: 0., 0., 1., 1., pWIDTH, pHEIGHT, 0., 0.,
        !            16: pSMALL, 1., 31, 0., '`', '`'},
        !            17: { 0, 0,
        !            18: 0., 0., 1., 1., pWIDTH, pHEIGHT, 0., 0.,
        !            19: pSMALL, 1., 31, 0., '`', '`'},
        !            20: { 0, 0,
        !            21: 0., 0., 1., 1., pWIDTH, pHEIGHT, 0., 0.,
        !            22: pSMALL, 1., 31, 0., '`', '`'},
        !            23: { 0, 0,
        !            24: 0., 0., 1., 1., pWIDTH, pHEIGHT, 0., 0.,
        !            25: pSMALL, 1., 31, 0., '`', '`'},
        !            26: { 0, 0,
        !            27: 0., 0., 1., 1., pWIDTH, pHEIGHT, 0., 0.,
        !            28: pSMALL, 1., 31, 0., '`', '`'},
        !            29: { 0, 0,
        !            30: 0., 0., 1., 1., pWIDTH, pHEIGHT, 0., 0.,
        !            31: pSMALL, 1., 31, 0., '`', '`'},
        !            32: { 0, 0,
        !            33: 0., 0., 1., 1., pWIDTH, pHEIGHT, 0., 0.,
        !            34: pSMALL, 1., 31, 0., '`', '`'},
        !            35: };
        !            36: struct penvir *e0 = E, *e1 = &E[1];
        !            37: struct penvir *esave;
        !            38: int internal = 0;
        !            39: char   bcolor(s)
        !            40: char   *s;
        !            41: {
        !            42:        register char a;
        !            43:        a = 0;
        !            44:        while (*s != NULL) {
        !            45:                switch (*s) {
        !            46:                case 'l':
        !            47:                        if (!(strncmp(s, "long", 4)))
        !            48:                                a = 'd';
        !            49:                        break;
        !            50:                case 'd':
        !            51:                        if (!(strncmp(s, "dotd", 4)))
        !            52:                                a = 'b';
        !            53:                        else if (!(strncmp(s, "dott", 4)))
        !            54:                                a = 'a';
        !            55:                        else a ='c';    /*dash default-short*/
        !            56:                        break;
        !            57:                case 's':
        !            58:                        if (!(strncmp(s, "solid", 5)))
        !            59:                                a ='`';
        !            60:                        else if (!(strncmp(s, "short", 5)))
        !            61:                                a = 'c';
        !            62:                        break;
        !            63:                case 'G':
        !            64:                        e1->pgap = atoi(s + 1);
        !            65:                        break;
        !            66:                case 'A':
        !            67:                        e1->pslant = (180. - atof(s + 1)) / RADIAN;
        !            68:                        break;
        !            69:                }
        !            70:                while (*++s != NULL)
        !            71:                        if (*s == '/'){
        !            72:                                s++;
        !            73:                                break;
        !            74:                        }
        !            75:        }
        !            76:        return(a);
        !            77: }
        !            78: sscpy(a, b)
        !            79: struct penvir *a, *b;
        !            80: { /* copy 'a' onto 'b' */
        !            81:        b->left = a->left;
        !            82:        b->bottom = a->bottom;
        !            83:        b->xmin = a->xmin;
        !            84:        b->ymin = a->ymin;
        !            85:        b->scalex = a->scalex;
        !            86:        b->scaley = a->scaley;
        !            87:        b->sidex = a->sidex;
        !            88:        b->sidey = a->sidey;
        !            89:        b->copyx = a->copyx;
        !            90:        b->copyy = a->copyy;
        !            91:        b->quantum = a->quantum;
        !            92:        b->grade = a->grade;
        !            93:        b->ppink = a->ppink;
        !            94:        b->pbrush = a->pbrush;
        !            95: }
        !            96: idle(){}
        !            97: #define TRUNC(A) A>0.? A+0.5: A-0.5
        !            98: normx(x)
        !            99: double x;
        !           100: {
        !           101:        double  xx;
        !           102:        int     k;
        !           103:        xx = SCX(x);
        !           104:        k = TRUNC(xx);
        !           105:        return(k);
        !           106: }
        !           107: 
        !           108: normy(y)
        !           109: double y;
        !           110: {
        !           111:        double  yy;
        !           112:        int     k;
        !           113:        yy = SCY(y);
        !           114:        k = TRUNC(yy);
        !           115:        return(k);
        !           116: }
        !           117: ptype(){}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.