home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 2 / 2091 / dt.c next >
Encoding:
C/C++ Source or Header  |  1990-12-28  |  13.2 KB  |  503 lines

  1. /*    Copyright 1985, 1986, 1987, 1988 Chris Lewis
  2.         All Rights Reserved
  3.  
  4.     Permission to copy and further distribute is freely given provided
  5.     this copyright notice remains intact and that this software is not
  6.     sold for profit.
  7.  
  8.     Project:    Generic Troff drivers
  9.     Module:        dt.c
  10.     Author:     Chris Lewis
  11.     Specs:        Ditroff driver
  12.  */
  13.  
  14. #include "defs.h"
  15.  
  16. #ifndef    lint
  17. static char SCCSid[] =
  18.     "@(#)dt.c: 2.3 Copyright 90/10/22 14:52:55 Chris Lewis";
  19. #endif
  20.  
  21. /*    These two tables are always included so that we have the
  22.     official character mapping tables.
  23.  */
  24.  
  25. struct troff2befont dtStdFont[108] = {
  26.  
  27. /*    Note on X-shift, Y-shift and point scale factor:
  28.     The first two are shifts in the baseline position of the
  29.     character, and the third is a multiplier of the point size.
  30.     If they are zero, nothing happens.  If they are non-zero,
  31.     they are first multiplied by .01, then (in the case of the
  32.     shifts), multiplied by the current points to get a shift
  33.     value in TROFF2PS[XY] coordinates.  In the case of point scale
  34.     factor, it is multiplied by <currentpointsize> * .01 and becomes
  35.     the pointsize of the sequence to be emitted.
  36.  */
  37. /*          +-------------------------------- Troff character number
  38.         |
  39.             |    +--------------------------- N: standard fonts
  40.             |    |                            S: symbol font
  41.             |    |                            D: draw macro
  42.             |    |                            n: new font
  43.             |    |
  44.             |    |  +------------------------ X-shift (scaled by point)
  45.             |    |  |                         Note: positive is right.
  46.             |    |  |
  47.             |    |  |  +--------------------- Y-shift (scaled by point)
  48.             |    |  |  |                      Note: positive is up.
  49.             |    |  |  |
  50.             |    |  |  |  +------------------ Point scale factor
  51.             |    |  |  |  |
  52.             |    |  |  |  |   +-------------- Sequence
  53.             |    |  |  |  |   |
  54.             v    v  v  v  v   v */
  55.     /*  0*/    {N, 0, 0, 0, "h"},
  56.     /*  1*/    {N, 0, 0, 0, "t"},
  57.     /*  2*/    {N, 0, 0, 0, "n"},
  58.     /*  3*/    {N, 0, 0, 0, "m"},
  59.     /*  4*/    {N, 0, 0, 0, "l"},
  60.     /*  5*/    {N, 0, 0, 0, "i"},
  61.     /*  6*/    {N, 0, 0, 0, "z"},
  62.     /*  7*/    {N, 0, 0, 0, "s"},
  63.     /*  8*/    {N, 0, 0, 0, "d"},
  64.     /*  9*/    {N, 0, 0, 0, "b"},
  65.     /* 10*/    {N, 0, 0, 0, "x"},
  66.     /* 11*/    {N, 0, 0, 0, "f"},
  67.     /* 12*/    {N, 0, 0, 0, "j"},
  68.     /* 13*/    {N, 0, 0, 0, "u"},
  69.     /* 14*/    {N, 0, 0, 0, "k"},
  70.     /* 15*/    {N, 0, 0, 0, NOC},
  71.     /* 16*/    {N, 0, 0, 0, "p"},
  72.     /* 17*/    {N, 0, 0, 0, "em"},
  73.     /* 18*/    {N, 0, 0, 0, ";"},
  74.     /* 19*/    {N, 0, 0, 0, NOC},
  75.     /* 20*/    {N, 0, 0, 0, "a"},
  76.     /* 21*/    {N, 0, 0, 0, "ru"},
  77.     /* 22*/    {N, 0, 0, 0, "c"},
  78.     /* 23*/    {N, 0, 0, 0, "`"},
  79.     /* 24*/    {N, 0, 0, 0, "e"},
  80.     /* 25*/    {N, 0, 0, 0, "'"},
  81.     /* 26*/    {N, 0, 0, 0, "o"},
  82.     /* 27*/    {N, 0, 0, 0, "14"},
  83.     /* 28*/    {N, 0, 0, 0, "r"},
  84.     /* 29*/    {N, 0, 0, 0, "12"},
  85.     /* 30*/    {N, 0, 0, 0, "v"},
  86.     /* 31*/    {N, 0, 0, 0, "hy"},
  87.     /* 32*/    {N, 0, 0, 0, "w"},
  88.     /* 33*/    {N, 0, 0, 0, "q"},
  89.     /* 34*/    {N, 0, 0, 0, "/"},
  90.     /* 35*/    {N, 0, 0, 0, "."},
  91.     /* 36*/    {N, 0, 0, 0, "g"},
  92.     /* 37*/    {N, 0, 0, 0, "34"},
  93.     /* 38*/    {N, 0, 0, 0, ","},
  94.     /* 39*/    {N, 0, 0, 0, "&"},
  95.     /* 40*/    {N, 0, 0, 0, "y"},
  96.     /* 41*/    {N, 0, 0, 0, NOC},
  97.     /* 42*/    {N, 0, 0, 0, "%"},
  98.     /* 43*/    {N, 0, 0, 0, NOC},
  99.     /* 44*/    {N, 0, 0, 0, "Q"},
  100.     /* 45*/    {N, 0, 0, 0, "T"},
  101.     /* 46*/    {N, 0, 0, 0, "O"},
  102.     /* 47*/    {N, 0, 0, 0, "H"},
  103.     /* 48*/    {N, 0, 0, 0, "N"},
  104.     /* 49*/    {N, 0, 0, 0, "M"},
  105.     /* 50*/    {N, 0, 0, 0, "L"},
  106.     /* 51*/    {N, 0, 0, 0, "R"},
  107.     /* 52*/    {N, 0, 0, 0, "G"},
  108.     /* 53*/    {N, 0, 0, 0, "I"},
  109.     /* 54*/    {N, 0, 0, 0, "P"},
  110.     /* 55*/    {N, 0, 0, 0, "C"},
  111.     /* 56*/    {N, 0, 0, 0, "V"},
  112.     /* 57*/    {N, 0, 0, 0, "E"},
  113.     /* 58*/    {N, 0, 0, 0, "Z"},
  114.     /* 59*/    {N, 0, 0, 0, "D"},
  115.     /* 60*/    {N, 0, 0, 0, "B"},
  116.     /* 61*/    {N, 0, 0, 0, "S"},
  117.     /* 62*/    {N, 0, 0, 0, "Y"},
  118.     /*from here on are actually code 1-45, upper half of font */
  119.     /* 63*/    {N, 0, 0, 0, "F"},
  120.     /* 64*/    {N, 0, 0, 0, "X"},
  121.     /* 65*/    {N, 0, 0, 0, "A"},
  122.     /* 66*/    {N, 0, 0, 0, "W"},
  123.     /* 67*/    {N, 0, 0, 0, "J"},
  124.     /* 68*/    {N, 0, 0, 0, "U"},
  125.     /* 69*/    {N, 0, 0, 0, "K"},
  126.     /* 70*/    {N, 0, 0, 0, "0"},
  127.     /* 71*/    {N, 0, 0, 0, "1"},
  128.     /* 72*/    {N, 0, 0, 0, "2"},
  129.     /* 73*/    {N, 0, 0, 0, "3"},
  130.     /* 74*/    {N, 0, 0, 0, "4"},
  131.     /* 75*/    {N, 0, 0, 0, "5"},
  132.     /* 76*/    {N, 0, 0, 0, "6"},
  133.     /* 77*/    {N, 0, 0, 0, "7"},
  134.     /* 78*/    {N, 0, 0, 0, "8"},
  135.     /* 79*/    {N, 0, 0, 0, "9"},
  136.     /* 80*/    {N, 0, 0, 0, "*"},
  137.     /* 81*/    {N, 0, 0, 0, "-"},
  138.     /* 82*/    {N, 0, 0, 0, "fi"},
  139.     /* 83*/    {N, 0, 0, 0, "fl"},
  140.     /* 84*/    {N, 0, 0, 0, "ff"},
  141.     /* 85*/    {N, 0, 0, 0, "ct"},
  142.     /* 86*/    {N, 0, 0, 0, "Fl"},
  143.     /* 87*/    {N, 0, 0, 0, "Fi"},
  144.     /* 88*/    {N, 0, 0, 0, "("},
  145.     /* 89*/    {N, 0, 0, 0, ")"},
  146.     /* 90*/    {N, 0, 0, 0, "["},
  147.     /* 91*/    {N, 0, 0, 0, "]"},
  148.     /* 92*/    {N, 0, 0, 0, "de"},
  149.     /* 93*/    {N, 0, 0, 0, "dg"},
  150.     /* 94*/    {N, 0, 0, 0, "="},
  151.     /* 95*/    {N, 0, 0, 0, "rg"},
  152.     /* 96*/    {N, 0, 0, 0, ":"},
  153.     /* 97*/    {N, 0, 0, 0, "+"},
  154.     /* 98*/    {N, 0, 0, 0, NOC},
  155.     /* 99*/    {N, 0, 0, 0, "!"},
  156.     /*100*/    {N, 0, 0, 0, "bu"},
  157.     /*101*/    {N, 0, 0, 0, "?"},
  158.     /*102*/    {N, 0, 0, 0, "fm"},
  159.     /*103*/    {N, 0, 0, 0, "|"},
  160.     /*104*/    {N, 0, 0, 0, NOC},
  161.     /*105*/    {N, 0, 0, 0, "co"},
  162.     /*106*/    {N, 0, 0, 0, "sq"},
  163.     /*107*/    {N, 0, 0, 0, "$"}
  164. };
  165.  
  166. struct troff2befont dtSymFont[] = {
  167. /*          +-------------------------------- Troff character number
  168.         |
  169.             |    +--------------------------- N: standard fonts
  170.             |    |                            S: symbol font
  171.             |    |                            D: draw macro
  172.             |    |
  173.             |    |  +------------------------ X-shift (scaled by point)
  174.             |    |  |                         Note: positive is right.
  175.             |    |  |
  176.             |    |  |  +--------------------- Y-shift (scaled by point)
  177.             |    |  |  |                      Note: positive is up.
  178.             |    |  |  |
  179.             |    |  |  |  +------------------ Point scale factor
  180.             |    |  |  |  |
  181.             |    |  |  |  |   +-------------- Sequence
  182.             |    |  |  |  |   |
  183.             |    |  |  |  |   |
  184.             v    v  v  v  v   v */
  185.     /*  0*/    {S, 0, 0, 0, "*q"},
  186.     /*  1*/    {S, 0, 0, 0, "*h"},
  187.     /*  2*/    {S, 0, 0, 0, "*n"},
  188.     /*  3*/    {S, 0, 0, 0, "*m"},
  189.     /*  4*/    {S, 0, 0, 0, "*l"},
  190.     /*  5*/    {S, 0, 0, 0, "*i"},
  191.     /*  6*/    {S, 0, 0, 0, "*z"},
  192.     /*  7*/    {S, 0, 0, 0, "*s"},
  193.     /*  8*/    {S, 0, 0, 0, "*d"},
  194.     /*  9*/    {S, 0, 0, 0, "*b"},
  195.     /* 10*/    {S, 0, 0, 0, "*c"},
  196.     /* 11*/    {S, 0, 0, 0, "*y"},
  197.     /* 12*/    {S, 0, 0, 0, "*f"},
  198.     /* 13*/    {S, 0, 0, 0, "*u"},
  199.     /* 14*/    {S, 0, 0, 0, "*k"},
  200.     /* 15*/    {S, 0, 0, 0, NOC},
  201.     /* 16*/    {S, 0, 0, 0, "*p"},
  202.     /* 17*/    {S, 0, 0, 0, "@"},
  203.     /* 18*/    {S, 0, 0, 0, "da"},
  204.     /* 19*/    {S, 0, 0, 0, NOC},
  205.     /* 20*/    {S, 0, 0, 0, "*a"},
  206.     /* 21*/    {S, 0, 0, 0, "or"},
  207.     /* 22*/    {S, 0, 0, 0, "*x"},
  208.     /* 23*/    {N, 0, 0, 0, "\""},
  209.     /* 24*/    {S, 0, 0, 0, "*e"},
  210.     /* 25*/    {S, 0, 0, 0, "eq"},
  211.     /* 26*/    {S, 0, 0, 0, "*o"},
  212.     /* 27*/    {S, 0, 0, 0, "<-"},
  213.     /* 28*/    {S, 0, 0, 0, "*r"},
  214.     /* 29*/    {S, 0, 0, 0, "ua"},
  215.     /* 30*/    {S, 0, 0, 0, "*t"},
  216.     /* 31*/    {S, 0, 0, 0, "ul"},
  217.     /* 32*/    {N, 0, 0, 0, "\\"},
  218.     /* 33*/    {S, 0, 0, 0, "*Q"},
  219.     /* 34*/    {S, 0, 0, 0, "bs"},
  220.     /* 35*/    {S, 0, 0, 0, "if"},
  221.     /* 36*/    {S, 0, 0, 0, "*g"},
  222.     /* 37*/    {S, 0, 0, 0, "ip"},
  223.     /* 38*/    {S, 0, 0, 0, "pt"},
  224.     /* 39*/    {S, 0, 0, 0, "rh"},
  225.     /* 40*/    {S, 0, 0, 0, "*w"},
  226.     /* 41*/    {S, 0, 0, 0, NOC},
  227.     /* 42*/    {S, 0, 0, 0, "gr"},
  228.     /* 43*/    {S, 0, 0, 0, NOC},
  229.     /* 44*/    {S, 0, 0, 0, "*F"},
  230.     /* 45*/    {S, 0, 0, 0, "*H"},
  231.     /* 46*/    {S, 0, 0, 0, "*W"},
  232.     /* 47*/    {S, 0, 0, 0, "cu"},
  233.     /* 48*/    {S, 0, 0, 0, "rn"},
  234.     /* 49*/    {S, 0, 0, 0, "ts"},
  235.     /* 50*/    {S, 0, 0, 0, "*L"},
  236.     /* 51*/    {S, 0, 0, 0, "mi"},
  237.     /* 52*/    {S, 0, 0, 0, "*G"},
  238.     /* 53*/    {S, 0, 0, 0, "is"},
  239.     /* 54*/    {S, 0, 0, 0, "*P"},
  240.     /* 55*/    {S, 0, 0, 0, "sb"},
  241.     /* 56*/    {S, 0, 0, 0, "sp"},
  242.     /* 57*/    {S, 0, 0, 0, "ap"},
  243.     /* 58*/    {S, 0, 0, 0, "pd"},
  244.     /* 59*/    {S, 0, 0, 0, "*D"},
  245.     /* 60*/    {S, 0, 0, 0, "sr"},
  246.     /* 61*/    {S, 0, 0, 0, "*S"},
  247.     /* 62*/    {S, 0, 0, 0, "~="},
  248.     /* 63*/    {S, 0, 0, 0, ">"},
  249.     /* 64*/    {S, 0, 0, 0, "*C"},
  250.     /* 65*/    {S, 0, 0, 0, "<"},
  251.     /* 66*/    {S, 0, 0, 0, "/"},
  252.     /* 67*/    {S, 0, 0, 0, "ca"},
  253.     /* 68*/    {S, 0, 0, 0, "*U"},
  254.     /* 69*/    {S, 0, 0, 0, "no"},
  255.     /* 70*/    {S, 0, 0, 0, "rc"},
  256.     /* 71*/    {S, 0, 0, 0, "lt"},
  257.     /* 72*/    {S, 0, 0, 0, "bv"},
  258.     /* 73*/    {S, 0, 0, 0, "lk"},
  259.     /* 74*/    {S, 0, 0, 0, "lb"},
  260.     /* 75*/    {S, 0, 0, 0, "rt"},
  261.     /* 76*/    {S, 0, 0, 0, "rk"},
  262.     /* 77*/    {S, 0, 0, 0, "rb"},
  263.     /* 78*/    {S, 0, 0, 0, "rf"},
  264.     /* 79*/    {S, 0, 0, 0, "lf"},
  265.     /* 80*/    {S, 0, 0, 0, "lc"},
  266.     /* 81*/    {S, 0, 0, 0, "mu"},
  267.     /* 82*/    {S, 0, 0, 0, "di"},
  268.     /* 83*/    {S, 0, 0, 0, "+-"},
  269.     /* 84*/    {S, 0, 0, 0, "<="},
  270.     /* 85*/    {S, 0, 0, 0, ">="},
  271.     /* 86*/    {S, 0, 0, 0, "=="},
  272.     /* 87*/    {S, 0, 0, 0, "!="},
  273.     /* 88*/    {S, 0, 0, 0, "{"},
  274.     /* 89*/    {S, 0, 0, 0, "}"},
  275.     /* 90*/    {N, 0, 0, 0, "aa"},
  276.     /* 91*/    {N, 0, 0, 0, "ga"},
  277.     /* 92*/    {S, 0, 0, 0, "^"},
  278.     /* 93*/    {S, 0, 0, 0, "#"},
  279.     /* 94*/    {S, 0, 0, 0, "lh"},
  280.     /* 95*/    {S, 0, 0, 0, "mo"},
  281.     /* 96*/    {N, 0, 0, 0, "~"},
  282.     /* 97*/    {S, 0, 0, 0, "es"},
  283.     /* 98*/    {S, 0, 0, 0, NOC},
  284.     /* 99*/    {N, 0, 0, 0, "dd"},
  285.     /*100*/    {S, 0, 0, 0, "br"},
  286.     /*101*/    {S, 0, 0, 0, "**"},
  287.     /*102*/    {S, 0, 0, 0, "ib"},
  288.     /*103*/    {S, 0, 0, 0, "ci"},
  289.     /*104*/    {S, 0, 0, 0, NOC},
  290.     /*105*/    {S, 0, 0, 0, "pl"},
  291.     /*106*/    {S, 0, 0, 0, "->"},
  292.     /*107*/    {N, 0, 0, 0, "sc"}
  293. };
  294.  
  295. #ifdef    DT
  296. #include "dt.h"
  297.  
  298. #define    USED    01
  299.  
  300. int dtresolution = DTRESOLUTION;
  301.  
  302. dtPage() {
  303.     pagePending = 1;
  304. }
  305.  
  306. static
  307. doPageStart() {
  308.     currentPage++;
  309.     pagePending = 0;
  310.     printf("p%d\n", currentPage);
  311. }
  312.  
  313.  
  314. dtSetFont(font, points)
  315. int font, points; {
  316.     if (lastPoints != points || font != lastFont) {
  317.     if (!(fonttable[font].flags)&USED)
  318.         printf("x font %d %s\n", font+1, fonttable[font].troffName);
  319.     fonttable[font].flags |= USED;
  320.     printf("f%d\n", font+1);
  321.     printf("s%d\n", points);
  322.     lastPoints = points;
  323.     lastFont = font;
  324.     }
  325. }
  326.  
  327. dtChar(x, y, font, points, troffChar, sequence)
  328. long x, y;
  329. int font, points, troffChar;
  330. char *sequence; {
  331.     register int nx = TROFF2DTX(x), ny = TROFF2DTY(y);
  332.     register struct troff2befont *rp;
  333.     if (pagePending) {
  334.     resetState();
  335.     doPageStart();
  336.     }
  337.  
  338.     DBP((D_BEND,"x,y=%d,%d; font=%d, points=%d, tc=%d\n",
  339.     x, y, font, points, troffChar));
  340.  
  341.     if (font == 3) {
  342.     rp = &be->besymfont[troffChar];
  343.     } else {
  344.     rp = &be->bestdfont[troffChar];
  345.     }
  346.  
  347.     switch(rp->t2b_font) {
  348.     /* Only fonts with "N" are subject to font translation */
  349.     case N:
  350.         if (font == 3)
  351.         font = 0;    /* Special chars are Courier */
  352.         else {
  353.         DBP((D_BEND, "dtSetChar %d->%s (%s)\n", font,
  354.             xlatetable[font]->troffName,
  355.             xlatetable[font]->fontName));
  356.         font = xlatetable[font] - fonttable;
  357.         }
  358.         break;
  359.     case S:
  360.         font = 3;
  361.         break;
  362.     case D:
  363.         break;
  364.     default:
  365.     /* Typically used when the R and S fonts don't have the
  366.        character desired, so select the font via the index
  367.        in the fonts.?? file */
  368.         font = rp->t2b_font;
  369.         break;
  370.     }
  371.  
  372.     if (!sequence)
  373.     sequence = rp->t2b_charseq;
  374.  
  375.     if (!sequence) {
  376.     fprintf(stderr, "No coding for %d\n", troffChar);
  377.     return;
  378.     }
  379.  
  380.     /*    We're committed now - the "if" statements avoid floating
  381.     arithmetic on slow machines */
  382.  
  383.     if (rp->t2b_scale) points *= (.01 * rp->t2b_scale);
  384.     if (rp->t2b_xc) nx += points * (.01 * rp->t2b_xc);
  385.     if (rp->t2b_yc) ny += points * (.01 * rp->t2b_yc);
  386.  
  387.     dtSetFont(font, points);
  388. #ifdef    NOTYET
  389.     if (rp->t2b_font == D)
  390.     printf("H%d\nV%d\nc%s\n", nx, ny, sequence);
  391.     else {
  392. #endif
  393.     /* print an nnc sequence if we can...may even be able to avoid
  394.        the newline. */
  395.  
  396.     if (lastYPos == ny &&
  397.         sequence[1] == 0 &&
  398.         lastXPos != -1 &&
  399.         (nx - lastXPos) > 0 && (nx - lastXPos) < 100) {
  400.  
  401.         printf("%02d%c\n",(nx - lastXPos), sequence[0]);
  402.  
  403.     } else {
  404.  
  405.         printf("H%d\n", nx);
  406.  
  407.         if (lastYPos != ny) {
  408.         printf("V%d\n", ny);
  409.         lastYPos = ny;
  410.         }
  411.         if (sequence[1])
  412.         printf("C%s\n", sequence);
  413.         else
  414.         printf("c%s\n", sequence);
  415.     }
  416.     lastXPos = nx;
  417. #ifdef    NOTYET
  418.     }
  419. #endif
  420. }
  421.  
  422. dtProlog() {
  423.     extern char *ctime();
  424.     extern char *strchr();
  425.     extern char nodename[];
  426.     extern char *device;
  427.     char buffer[30];
  428.     long curtime;
  429. #ifdef    OPT
  430.     extern int optimize;
  431.  
  432.     optimize = 0;
  433. #endif
  434.  
  435.     currentPage = 0;
  436.     pagePending = 1;
  437.  
  438.     time(&curtime);
  439.     strcpy(buffer, ctime(&curtime));
  440.     *strchr(buffer, '\n') = '\0';
  441.  
  442.     getnodename();
  443.  
  444. #ifndef    NOCHATTER
  445.     printf("#Title: (stdin)\n");
  446.     printf("#Creator: %s %s\n", progname, shortversion);
  447.     printf("#PsroffVersion: %s\n", version);
  448.     printf("#CreationDate: %s\n", buffer);
  449.     printf("#For: %s\n", username);
  450.     printf("#Pages: (atend)\n");
  451.     printf("#DocumentFonts: (atend)\n");
  452.     printf("#EndComments\n");
  453. #endif
  454.     printf("x T %s\n", device);
  455.     printf("x res %d %d %d\n", dtresolution, 1, 1);
  456.     printf("x init\n");
  457.     doprologs();
  458.  
  459. }
  460.  
  461. dtPassthru(s)
  462. register char *s; {
  463.     printf("x X %s\n", s);
  464. }
  465.  
  466. dtEpilog() {
  467.     printf("x trailer\n");
  468.     printf("x stop\n");
  469. }
  470.  
  471. #ifdef    INSPECIAL
  472. dtDraw(origX, origY, s)
  473. int origX, origY;
  474. register char *s; {
  475.     register int temp, t2;
  476.     DBP((D_CAT, "dtDraw: (%d,%d): %s\n", origX, origY, s));
  477.     printf("H%d\n", TROFF2DTX(origX));
  478.     printf("V%d\n", TROFF2DTY(origY));
  479.     putchar('D');
  480.     putchar(*s);
  481.     s++;
  482.     /* We just pass these thru, scaling them to output resolution */
  483.     for (;*s;s++) {
  484.     if (isspace(*s))
  485.         putchar(' ');
  486.     else if (!isdigit(*s))
  487.         putchar(*s);
  488.     else {
  489.         temp = *s - '0';
  490.         while(isdigit(*(s+1))) {
  491.         temp = temp * 10 + (*++s - '0');
  492.         }
  493.         t2 = temp * dtresolution / TROFFRESOLUTION;
  494.         DBP((D_CAT, "dtDraw (scale): %d -> %d\n", temp, t2));
  495.         printf("%d", t2);
  496.     }
  497.     }
  498.     putchar('\n');
  499. }
  500. #endif
  501.  
  502. #endif /* DT */
  503.