Annotation of researchv9/jtools/src/Jpic/textgen.c, revision 1.1.1.1

1.1       root        1: #include       <stdio.h>
                      2: #include       "pic.h"
                      3: #include       "y.tab.h"
                      4: 
                      5: struct obj *textgen(s, garb)
                      6: {
                      7:        int i, dx, dy, type;
                      8:        struct obj *p, *ppos;
                      9: 
                     10:        type = 'C';
                     11:        dx = dy = 0;
                     12:        for (i = 0; i < nattr; i++)
                     13:                switch (attr[i].a_type) {
                     14:                case LEFT:
                     15:                        dx -= attr[i].a_val;
                     16:                        break;
                     17:                case RIGHT:
                     18:                        dx += attr[i].a_val;
                     19:                        break;
                     20:                case UP:
                     21:                        dy += attr[i].a_val;
                     22:                        break;
                     23:                case DOWN:
                     24:                        dy -= attr[i].a_val;
                     25:                        break;
                     26:                case AT:
                     27:                        ppos = (struct obj *) attr[i].a_val;
                     28:                        curx = ppos->o_x;
                     29:                        cury = ppos->o_y;
                     30:                        break;
                     31:                case LJUST:
                     32:                        type = 'L';
                     33:                        break;
                     34:                case RJUST:
                     35:                        type = 'R';
                     36:                        break;
                     37:                case SPREAD:
                     38:                        type = 'S';
                     39:                        break;
                     40:                case FILL:
                     41:                        type = 'F';
                     42:                        break;
                     43:                case ABOVE:
                     44:                        type = 'A';
                     45:                        break;
                     46:                case BELOW:
                     47:                        type = 'B';
                     48:                        break;
                     49:                }
                     50:        dprintf("T %c %s\n", type, s);
                     51:        extreme(curx, cury);
                     52:        curx += dx;
                     53:        cury += dy;
                     54:        extreme(curx, cury);
                     55:        p = makenode(TEXT, 2);
                     56:        p->o_val[0] = s;
                     57:        p->o_val[1] = type;
                     58:        return(p);
                     59: }

unix.superglobalmegacorp.com

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