home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 443.lha / pcl2english_v2.0 / amp.c < prev    next >
C/C++ Source or Header  |  1990-12-02  |  15KB  |  746 lines

  1. /* $RCSfile: amp.c,v $  $Revision: 2.0 $ */
  2.  
  3. #include <stdio.h>
  4. #include "gdefs.h"
  5. #include "externals.h"
  6. #include "protos.h"
  7.  
  8. extern FILE *ifile,*ofile;
  9.  
  10. static char    *macro_func[] =
  11. {
  12.     "Start macro definition",
  13.     "Stop macro definition",
  14.     "Execute macro",
  15.     "Call macro",
  16.     "Enable auto macro overlay",
  17.     "Disable auto macro overlay",
  18.     "Delete all macros",
  19.     "Delete all temporary macros",
  20.     "Delete macro",
  21.     "Make macro temporary",
  22.     "Make macro permanent",
  23. };
  24.  
  25. static char    *eol[] =
  26. {
  27.     "CR=CR; LF=LF; FF=FF",
  28.     "CR=CR+LF; LF=LF; FF=FF",
  29.     "CR=CR; LF=CR+LF; FF=CR+FF",
  30.     "CR=CR+LF; LF=CR+LF; FF=CR+FF",
  31. };
  32.  
  33. static char    *paper[] =
  34. {
  35.     "Eject Page",
  36.     "Default. (LaserJet=Input Cassette,  IIP=MP tray)",
  37.     "Manual Feed",
  38.     "Manual Envelope Feed",
  39.     "Lower Tray",
  40.     "???",
  41.     "Envelope Feeder",
  42. };
  43.  
  44. static char    *perf[] =
  45. {
  46.     "disable",
  47.     "enable",
  48. };
  49.  
  50. static char    *orient[] =
  51. {
  52.     "Portrait",
  53.     "Landscape",
  54. };
  55.  
  56. static char    *offset[] =
  57. {
  58.     "Set stacking position to default",
  59.     "Toggle stacking position",
  60. };
  61.  
  62. static char    *pitch[] =
  63. {
  64.     "Default (80 chars per line, printer specific)",
  65.     "Expanded (ThinkJet)",
  66.     "Compressed (16-21 cpi, printer specific)",
  67.     "Expanded-Compressed (10-11 cpi, printer specific)",
  68.     "18 cpi, 144 cpl (PaintJet)",
  69. };
  70.  
  71. static char    *print_mode[] =
  72. {
  73.     "Left to right unidirectional text printing",
  74.     "Bidirectional text printing",
  75.     "Right to left unidirectional text printing",
  76.     "Transparency (PaintJet)",
  77.     "???",
  78.     "Text Scale OFF",
  79.     "Text Scale ON (put 66 lines on page)",
  80. };
  81.  
  82. static char    *color[] =
  83. {
  84.     "Black (default)",
  85.     "Red",
  86.     "Green",
  87.     "Yellow",
  88.     "Blue",
  89.     "Magenta",
  90.     "Cyan",
  91.     "White (no text)",
  92. };
  93.  
  94. static char    *wrap[] =
  95. {
  96.     "enabled",
  97.     "disabled",
  98. };
  99.  
  100. static char    *underline[] =
  101. {
  102.     "enable fixed",
  103.     "single fixed",
  104.     "double fixed",
  105.     "single float",
  106.     "double float",
  107. };
  108.  
  109. static char    *enh_ctl[] =
  110. {
  111.     "Line-by-line ON",
  112.     "Line-by-line OFF",
  113. };
  114.  
  115. static char    *page_side[] =
  116. {
  117.     "Next",
  118.     "Front",
  119.     "Back",
  120. };
  121.  
  122. static char    *duplex[] =
  123. {
  124.     "Simplex",
  125.     "Duplex long-edge binding",
  126.     "Duplex short-edge binding",
  127. };
  128.  
  129. void decode_ampersand(void)        /* <Esc>& */
  130. {
  131.     int         start_pos;
  132.     int         stop_pos;
  133.     int         i;
  134.     int         done;
  135.     char     c1,c2,c3;
  136.  
  137.     c1 = esc_string[1];
  138.     c2 = esc_string[2];
  139.     c3 = esc_string[3];
  140.     if (c2 == 'a') {
  141.         start_pos = stop_pos = 3;
  142.         done = FALSE;
  143.         while (done == FALSE) {
  144.             get_num(&stop_pos,0);
  145.             c3 = esc_string[stop_pos];
  146.             print_sub_string(2, start_pos, stop_pos);
  147.             switch (c3) {
  148.                 case 'c':
  149.                 case 'C':
  150.                     if (plus) {
  151.                         if (is_float) {
  152.                             fprintf(ofile,
  153.                                 "Move cursor right %d.%s columns\n",
  154.                                 num, fraction);
  155.                         }
  156.                         else {
  157.                             fprintf(ofile,
  158.                                 "Move cursor right %d columns\n",num);
  159.                         }
  160.                         current_col += num;
  161.                     }
  162.                     else if (minus) {
  163.                         if (is_float) {
  164.                             fprintf(ofile,
  165.                                 "Move cursor left %d.%s columns\n",
  166.                                 -num, fraction);
  167.                         }
  168.                         else {
  169.                             fprintf(ofile,
  170.                                 "Move cursor left %d columns\n",-num);
  171.                         }
  172.                         current_col += num;
  173.                         if (current_col < 0){
  174.                             current_col = 0;
  175.                         }
  176.                     }
  177.                     else {
  178.                         if (is_float) {
  179.                             fprintf(ofile,
  180.                                 "Move cursor to column %d.%s.  ",
  181.                                 num, fraction);
  182.                             fprintf(ofile,"First column is column 0\n");
  183.                         }
  184.                         else {
  185.                             fprintf(ofile,"Move cursor to column %d.  ",num);
  186.                             fprintf(ofile,"First column is column 0\n");
  187.                         }
  188.                         current_col = num;
  189.                         if (current_col < 0){
  190.                             current_col = 0;
  191.                         }
  192.                     }
  193.                     break;
  194.                     case 'g':
  195.                     case 'G':
  196.                         fprintf(ofile,
  197.                             "Page side selection (LaserJet IID) = ");
  198.                         if ((num >= 0) && (num <= 2)) {
  199.                             fprintf(ofile,"%s %s\n",page_side[num],"side");
  200.                         }
  201.                         else {
  202.                             fprintf(ofile,questions);
  203.                         }
  204.                         break;
  205.                 case 'h':
  206.                 case 'H':
  207.                     if (plus) {
  208.                         fprintf(ofile,"Move cursor right %d/720 inch\n",num);
  209.                     }
  210.                     else if (minus) {
  211.                         fprintf(ofile,"Move cursor left %d/720 inch\n",-num);
  212.                     }
  213.                     else {
  214.                         fprintf(ofile,
  215.                             "Move cursor to %d/720 inch from left print limit.\n",
  216.                             num);
  217.                     }
  218.                     break;
  219.                 case 'l':
  220.                 case 'L':
  221.                     fprintf(ofile,"Set left margin to %d (columns).  ", num);
  222.                     fprintf(ofile,"First column is 0\n");
  223.                     if ((num >= 0) && (num <= last_col)) {
  224.                         first_col = num;
  225.                     }
  226.                     else {
  227.                         indent(1);
  228.                         fprintf(ofile,
  229.                             "WARNING!!!  There may be a problem setting this margin\n");
  230.                     }
  231.                     break;
  232.                 case 'm':
  233.                 case 'M':
  234.                     fprintf(ofile,"Set right margin to %d (columns)\n",num);
  235.                     if ((num > 0) && (num >= first_col)) {
  236.                         last_col = num;
  237.                     }
  238.                     else {
  239.                         indent(1);
  240.                         fprintf(ofile,
  241.                             "WARNING!!!  There may be a problem setting this margin\n");
  242.                     }
  243.                     break;
  244.                 case 'r':
  245.                 case 'R':
  246.                     if (plus) {
  247.                         if (is_float) {
  248.                             fprintf(ofile,
  249.                                 "Move cursor down %d.%s rows\n",
  250.                                 num, fraction);
  251.                         }
  252.                         else {
  253.                             fprintf(ofile,"Move cursor down %d rows\n",num);
  254.                         }
  255.                     }
  256.                     else if (minus) {
  257.                         if (is_float) {
  258.                             fprintf(ofile,
  259.                                 "Move cursor up %d.%s rows\n",
  260.                                 -num, fraction);
  261.                         }
  262.                         else {
  263.                             fprintf(ofile,"Move cursor up %d rows\n",-num);
  264.                         }
  265.                     }
  266.                     else {
  267.                         if (is_float) {
  268.                             fprintf(ofile,"Move cursor to row %d.%s.  ",
  269.                                 num, fraction);
  270.                             fprintf(ofile,
  271.                                 "First row from top margin is row 0\n");
  272.                         }
  273.                         else {
  274.                             fprintf(ofile,
  275.                                 "Move cursor to row %d.  ",num);
  276.                             fprintf(ofile,
  277.                                 "First row from top margin is row 0\n");
  278.                         }
  279.                     }
  280.                     break;
  281.                 case 'v':
  282.                 case 'V':
  283.                     if (plus) {
  284.                         fprintf(ofile,"Move cursor down %d/720 inch\n",num);
  285.                     }
  286.                     else if (minus) {
  287.                         fprintf(ofile,"Move cursor up %d/720 inch\n",-num);
  288.                     }
  289.                     else {
  290.                         fprintf(ofile,
  291.                             "Move cursor to %d/720 inch from top margin.\n",
  292.                             num);
  293.                     }
  294.                     break;
  295.                 default:
  296.                     fprintf(ofile,"%s",bad_esc);
  297.                     break;
  298.             }
  299.             stop_pos++;
  300.             start_pos = stop_pos;
  301.             if (esc_string[start_pos] == 0) {
  302.                 done = TRUE;
  303.             }
  304.         }
  305.     }
  306.     else if (c2 == 'd') {
  307.         start_pos = stop_pos = 3;
  308.         done = FALSE;
  309.         while (done == FALSE) {
  310.             c3 = esc_string[stop_pos];
  311.             if (c3 == '@') {
  312.                 print_sub_string(2, start_pos, stop_pos);
  313.                 fprintf(ofile,"Disable Underline\n");
  314.                 done = TRUE;
  315.             }
  316.             else {
  317.                 get_num(&stop_pos,0);
  318.                 c3 = esc_string[stop_pos];
  319.                 print_sub_string(2, start_pos, stop_pos);
  320.                 switch (c3) {
  321.                     case 'd':
  322.                     case 'D':
  323.                         fprintf(ofile,"Underline control = ");
  324.                         if ((num >= 0) && (num <= 4)) {
  325.                             fprintf(ofile,"%s\n",underline[num]);
  326.                         }
  327.                         else {
  328.                             fprintf(ofile,questions);
  329.                         }
  330.                         break;
  331.                     default:
  332.                         fprintf(ofile,"%s",bad_esc);
  333.                         break;
  334.                 }
  335.             }
  336.             stop_pos++;
  337.             start_pos = stop_pos;
  338.             if (esc_string[start_pos] == 0) {
  339.                 done = TRUE;
  340.             }
  341.         }
  342.     }
  343.     else if (c2 == 'f') {
  344.         start_pos = stop_pos = 3;
  345.         done = FALSE;
  346.         while (done == FALSE) {
  347.             get_num(&stop_pos,0);
  348.             c3 = esc_string[stop_pos];
  349.             print_sub_string(2, start_pos, stop_pos);
  350.             switch (c3) {
  351.                 case 's':
  352.                 case 'S':
  353.                     if (num == 0) {
  354.                         fprintf(ofile,"Push (store) current position\n");
  355.                     }
  356.                     else if (num == 1) {
  357.                         fprintf(ofile,"Pop (restore) last pushed position\n");
  358.                     }
  359.                     else {
  360.                         fprintf(ofile,"Push/Pop control ");
  361.                         fprintf(ofile,questions);
  362.                     }
  363.                     break;
  364.                 case 'x':
  365.                 case 'X':
  366.                     fprintf(ofile,"Macro control = ");
  367.                     if ((num >= 0) && (num <= 10)) {
  368.                         fprintf(ofile,"%s\n",macro_func[num]);
  369.                     }
  370.                     else {
  371.                         fprintf(ofile,questions);
  372.                     }
  373.                     break;
  374.                 case 'y':
  375.                 case 'Y':
  376.                     fprintf(ofile,"Macro ID # = %d\n",num);
  377.                     break;
  378.                 default:
  379.                     fprintf(ofile,"%s",bad_esc);
  380.                     break;
  381.             }
  382.             stop_pos++;
  383.             start_pos = stop_pos;
  384.             if (esc_string[start_pos] == 0) {
  385.                 done = TRUE;
  386.             }
  387.         }
  388.     }
  389.     else if (c2 == 'k') {
  390.         start_pos = stop_pos = 3;
  391.         done = FALSE;
  392.         while (done == FALSE) {
  393.             get_num(&stop_pos,0);
  394.             c3 = esc_string[stop_pos];
  395.             print_sub_string(2, start_pos, stop_pos);
  396.             switch (c3) {
  397.                 case 'e':
  398.                 case 'E':
  399.                     fprintf(ofile,"Enhancement (underlining) control = ");
  400.                     if ((num >= 0) && (num <= 1)) {
  401.                         fprintf(ofile,"%s\n",enh_ctl[num]);
  402.                     }
  403.                     else {
  404.                         fprintf(ofile,questions);
  405.                     }
  406.                     break;
  407.                 case 'f':
  408.                 case 'F':
  409.                     fprintf(ofile,"SI/SO control = ");
  410.                     if ((num >= 0) && (num <= 1)) {
  411.                         fprintf(ofile,"%s\n",enh_ctl[num]);
  412.                     }
  413.                     else {
  414.                         fprintf(ofile,questions);
  415.                     }
  416.                     break;
  417.                 case 'g':
  418.                 case 'G':
  419.                     fprintf(ofile,"Line termination.  ");
  420.                     if ((num >= 0) && (num <= 3)) {
  421.                         fprintf(ofile,"%s\n",eol[num]);
  422.                     }
  423.                     else {
  424.                         fprintf(ofile,questions);
  425.                     }
  426.                     break;
  427.                 case 'h':
  428.                 case 'H':
  429.                     fprintf(ofile,"Set Horizontal Motion Index (HMI) to ");
  430.                     if ((num >= 0) && (num <= 126)) {
  431.                         fprintf(ofile,"%d/120 inch\n",num);
  432.                     }
  433.                     else {
  434.                         fprintf(ofile,questions);
  435.                     }
  436.                     break;
  437.                 case 's':
  438.                 case 'S':
  439.                     fprintf(ofile,"Print pitch = ");
  440.                     if ((num >= 0) && (num <= 4)) {
  441.                         fprintf(ofile,"%s\n",pitch[num]);
  442.                     }
  443.                     else {
  444.                         fprintf(ofile,questions);
  445.                     }
  446.                     break;
  447.                 case 'w':
  448.                 case 'W':
  449.                     fprintf(ofile,"Print mode = ");
  450.                     if ((num >= 0) && (num <= 6)) {
  451.                         fprintf(ofile,"%s\n",print_mode[num]);
  452.                     }
  453.                     else {
  454.                         fprintf(ofile,questions);
  455.                     }
  456.                     break;
  457.                 default:
  458.                     fprintf(ofile,"%s",bad_esc);
  459.                     break;
  460.             }
  461.             stop_pos++;
  462.             start_pos = stop_pos;
  463.             if (esc_string[start_pos] == 0) {
  464.                 done = TRUE;
  465.             }
  466.         }
  467.     }
  468.     else if (c2 == 'l') {
  469.         start_pos = stop_pos = 3;
  470.         done = FALSE;
  471.         while (done == FALSE) {
  472.             get_num(&stop_pos,0);
  473.             c3 = esc_string[stop_pos];
  474.             print_sub_string(2, start_pos, stop_pos);
  475.             switch (c3) {
  476.                 case 'a':
  477.                 case 'A':
  478.                     fprintf(ofile,"Job (page) size = ");
  479.                     switch (num) {
  480.                         case 0:
  481.                             fprintf(ofile,"Default\n");
  482.                             break;
  483.                         case 1:
  484.                             fprintf(ofile,"Executive\n");
  485.                             break;
  486.                         case 2:
  487.                             fprintf(ofile,"Letter\n");
  488.                             break;
  489.                         case 3:
  490.                             fprintf(ofile,"Legal\n");
  491.                             break;
  492.                         case 26:
  493.                             fprintf(ofile,"A4\n");
  494.                             break;
  495.                         case 80:
  496.                             fprintf(ofile,"Monarch Envelope\n");
  497.                             break;
  498.                         case 81:
  499.                             fprintf(ofile,"COM 10 Envelope\n");
  500.                             break;
  501.                         case 90:
  502.                             fprintf(ofile,"DL Envelope\n");
  503.                             break;
  504.                         case 91:
  505.                             fprintf(ofile,"C5 Envelope\n");
  506.                             break;
  507.                         default:
  508.                             fprintf(ofile,questions);
  509.                             break;
  510.                     }
  511.                     break;
  512.                 case 'c':
  513.                 case 'C':
  514.                     fprintf(ofile,"Set Vertical Motion Index (VMI) to ");
  515.                     if ((num >= 0) && (num <= 126)) {
  516.                         fprintf(ofile,"%d/48 inch\n",num);
  517.                     }
  518.                     else {
  519.                         fprintf(ofile,questions);
  520.                     }
  521.                     break;
  522.                 case 'd':
  523.                 case 'D':
  524.                     fprintf(ofile,"Lines per inch = ");
  525.                     switch (num) {
  526.                         case 1:
  527.                         case 2:
  528.                         case 4:
  529.                         case 6:
  530.                         case 8:
  531.                         case 12:
  532.                         case 16:
  533.                         case 24:
  534.                         case 48:
  535.                             fprintf(ofile,"%d\n",num);
  536.                             break;
  537.                         default:
  538.                             fprintf(ofile,
  539.                                 "??? %d not supported.  Command ignored.\n",
  540.                                 num);
  541.                             break;
  542.                     }
  543.                     break;
  544.                 case 'e':
  545.                 case 'E':
  546.                     fprintf(ofile,"Top margin = %d lines.  ", num);
  547.                     fprintf(ofile,"Text length defaults to:\n");
  548.                     indent(5);
  549.                     fprintf(ofile,"page_length - top_margin - half_inch\n");
  550.                     if (num < 2) {
  551.                         indent(5);
  552.                         fprintf(ofile,"Avoid using values of 0 and 1.\n");
  553.                     }
  554.                     break;
  555.                 case 'f':
  556.                 case 'F':
  557.                     if (num == 0) {
  558.                         fprintf(ofile,"Default text length\n");
  559.                     }
  560.                     else {
  561.                         fprintf(ofile,"Text length = %d lines\n",num);
  562.                     }
  563.                     break;
  564.                 case 'h':
  565.                 case 'H':
  566.                     fprintf(ofile,"Paper source = ");
  567.                     if ((num >= 0) && (num <= 6)) {
  568.                         fprintf(ofile,"%s\n",paper[num]);
  569.                     }
  570.                     else {
  571.                         fprintf(ofile,questions);
  572.                     }
  573.                     break;
  574.                 case 'l':
  575.                 case 'L':
  576.                     fprintf(ofile,"Perforation skip ");
  577.                     if ((num >= 0) && (num <= 1)) {
  578.                         fprintf(ofile,"%s\n",perf[num]);
  579.                     }
  580.                     else {
  581.                         fprintf(ofile,questions);
  582.                     }
  583.                     break;
  584.                 case 'o':
  585.                 case 'O':
  586.                     fprintf(ofile,"Orientation = ");
  587.                     if ((num >= 0) && (num <= 1)) {
  588.                         fprintf(ofile,"%s\n",orient[num]);
  589.                     }
  590.                     else {
  591.                         fprintf(ofile,questions);
  592.                     }
  593.                     break;
  594.                 case 'p':
  595.                 case 'P':
  596.                     fprintf(ofile,"Text length = ");
  597.                     if ((num >= 5) && (num <= 128)) {
  598.                         fprintf(ofile,"%d lines\n",num);
  599.                     }
  600.                     else {
  601.                         fprintf(ofile,out_of_range,num);
  602.                     }
  603.                     break;
  604.                 case 's':
  605.                 case 'S':
  606.                     fprintf(ofile,"Simplex/Duplex print (LaserJet IID) = ");
  607.                     if ((num >= 0) && (num <= 2)) {
  608.                         fprintf(ofile,"%s\n",duplex[num]);
  609.                     }
  610.                     else {
  611.                         fprintf(ofile,questions);
  612.                     }
  613.                     break;
  614.                 case 't':
  615.                 case 'T':
  616.                     fprintf(ofile,"Job offset control (LaserJet 500+).\n");
  617.                     indent(5);
  618.                     if ((num >= 0) && (num <= 1)) {
  619.                         fprintf(ofile,"%s\n",offset[num]);
  620.                     }
  621.                     else {
  622.                         fprintf(ofile,questions);
  623.                     }
  624.                     break;
  625.                 case 'u':
  626.                 case 'U':
  627.                     fprintf(ofile,
  628.                         "Long edge offset registration = %d/720 inch\n",num);
  629.                     break;
  630.                 case 'x':
  631.                 case 'X':
  632.                     fprintf(ofile,"Number of copies = ");
  633.                     if ((num >= 1) && (num <= 99)) {
  634.                         fprintf(ofile,"%d\n",num);
  635.                     }
  636.                     else {
  637.                         fprintf(ofile,out_of_range,num);
  638.                     }
  639.                     break;
  640.                 case 'z':
  641.                 case 'Z':
  642.                     fprintf(ofile,
  643.                         "Short (top) edge offset registration = %d/720 inch\n",
  644.                         num);
  645.                     break;
  646.                 default:
  647.                     fprintf(ofile,"%s",bad_esc);
  648.                     break;
  649.             }
  650.             stop_pos++;
  651.             start_pos = stop_pos;
  652.             if (esc_string[start_pos] == 0) {
  653.                 done = TRUE;
  654.             }
  655.         }
  656.     }
  657.     else if (c2 == 'p') {
  658.         start_pos = stop_pos = 3;
  659.         done = FALSE;
  660.         while (done == FALSE) {
  661.             get_num(&stop_pos,0);
  662.             c3 = esc_string[stop_pos];
  663.             print_sub_string(2, start_pos, stop_pos);
  664.             switch (c3) {
  665.                 case 'X':    /* Can't have 'x' */
  666.                     fprintf(ofile,"Transparent print data for next ");
  667.                     fprintf(ofile,"%d characters\n",num);
  668.                     for (i=0; i<num; i++) {
  669.                         c1 = getc(ifile);
  670.                     }
  671.                     done = TRUE;
  672.                     break;
  673.                 default:
  674.                     fprintf(ofile,"%s",bad_esc);
  675.                     break;
  676.             }
  677.             stop_pos++;
  678.             start_pos = stop_pos;
  679.             if (esc_string[start_pos] == 0) {
  680.                 done = TRUE;
  681.             }
  682.         }
  683.     }
  684.     else if (c2 == 's') {
  685.         start_pos = stop_pos = 3;
  686.         done = FALSE;
  687.         while (done == FALSE) {
  688.             get_num(&stop_pos,0);
  689.             c3 = esc_string[stop_pos];
  690.             print_sub_string(2, start_pos, stop_pos);
  691.             switch (c3) {
  692.                 case 'c':
  693.                 case 'C':
  694.                     fprintf(ofile,"End of line wrap ");
  695.                     if ((num >= 0) && (num <= 1)) {
  696.                         fprintf(ofile,"%s\n",wrap[num]);
  697.                     }
  698.                     else {
  699.                         fprintf(ofile,questions);
  700.                     }
  701.                     break;
  702.                 default:
  703.                     fprintf(ofile,"%s",bad_esc);
  704.                     break;
  705.             }
  706.             stop_pos++;
  707.             start_pos = stop_pos;
  708.             if (esc_string[start_pos] == 0) {
  709.                 done = TRUE;
  710.             }
  711.         }
  712.     }
  713.     else if (c2 == 'v') {
  714.         start_pos = stop_pos = 3;
  715.         done = FALSE;
  716.         while (done == FALSE) {
  717.             get_num(&stop_pos,0);
  718.             c3 = esc_string[stop_pos];
  719.             print_sub_string(2, start_pos, stop_pos);
  720.             switch (c3) {
  721.                 case 's':
  722.                 case 'S':
  723.                     fprintf(ofile,"Text color (PaintJet) = ");
  724.                     if ((num >= 0) && (num <= 7)) {
  725.                         fprintf(ofile,"%s\n",color[num]);
  726.                     }
  727.                     else {
  728.                         fprintf(ofile,questions);
  729.                     }
  730.                     break;
  731.                 default:
  732.                     fprintf(ofile,"%s",bad_esc);
  733.                     break;
  734.             }
  735.             stop_pos++;
  736.             start_pos = stop_pos;
  737.             if (esc_string[start_pos] == 0) {
  738.                 done = TRUE;
  739.             }
  740.         }
  741.     }
  742.     else {
  743.         fprintf(ofile,"%s",bad_esc);
  744.     }
  745. }
  746.