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

1.1       root        1: #include       <stdio.h>
                      2: #include       "pic.h"
                      3: #include       "y.tab.h"
                      4: 
                      5: troffgen(s)    /* save away a string of troff commands */
                      6: char *s;
                      7: {
                      8:        if (strncmp(s, ".PS", 3) == 0)
                      9:                yyerror(".PS found inside .PS/.PE");
                     10:        savetext(CENTER, s);    /* use the existing text mechanism */
                     11:        makenode(TROFF, 0);
                     12: }
                     13: 
                     14: savetext(t, s) /* record text elements for current object */
                     15: int t;
                     16: char *s;
                     17: {
                     18:        switch (t) {
                     19:        case CENTER:    t = 'C'; break;
                     20:        case LJUST:     t = 'L'; break;
                     21:        case RJUST:     t = 'R'; break;
                     22:        case SPREAD:    t = 'S'; break;
                     23:        case FILL:      t = 'F'; break;
                     24:        case ABOVE:     t = 'A'; break;
                     25:        case BELOW:     t = 'B'; break;
                     26:        }
                     27:        if (ntext >= MAXTEXT) {
                     28:                yyerror("too many text strings (%d)\n", ntext);
                     29:                exit(1);
                     30:        }
                     31:        text[ntext].t_type = t;
                     32:        text[ntext].t_val = s;
                     33:        dprintf("saving %c text %s at %d\n", t, s, ntext);
                     34:        ntext++;
                     35: }

unix.superglobalmegacorp.com

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