home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / DCFVBA.ZIP / DCFVBA.C < prev    next >
Text File  |  1990-05-07  |  3KB  |  88 lines

  1. /**
  2. *** This will convert an HPPCL datastream into a file that can be uploaded
  3. *** into a VBA MVS file.  This allows mainframe documentation to be created
  4. *** on a PC using the word processor of choice.  That can then be uploaded
  5. *** to the host.
  6. ***
  7. *** This code supports only underscore, normal and boldface Courier 10 point.
  8. *** An attempt to do any other highlighting will produce an error message.
  9. ***
  10. **/
  11.  
  12. #include <stdio.h>
  13. #include <stdlib.h>
  14. #include <string.h>
  15. #include "dcfvba.h"
  16.  
  17. /**
  18. ***  Define global variables
  19. **/
  20.  
  21. int      line_length = MAXLINE; /* Max length of a line */
  22. FILE     *pcl_file;             /* Input file */
  23. FILE     *vba_file;             /* Output file */
  24. STRING   line = "";             /* Buffer for holding a line */
  25. char     current[2];            /* Buffer for next input character */
  26. long     row = 1;               /* Input row (or line number) */
  27. int      underscore = 0;        /* Is underscore on? */
  28. int      italics = 0;           /* Is italics on? */
  29. int      bold = 0;              /* Is bold on? */
  30. int      column = 0;            /* Input column */
  31. int      lmargin = 0;           /* Left margin */
  32. int      rmargin = 255;         /* Right margin */
  33. int      actual_vpos = 1;       /* Actual line number on the output page */
  34. int      logical_vpos = 1;      /* Theoretical line number on output page */
  35. double   pitch = 10.0;          /* Pitch of the font */
  36. double   lpi = 6.0;             /* Lines per inch */
  37.  
  38. /**
  39. *** +-----------------------------------------------------------------------+
  40. *** |                               Mainline                                |
  41. *** +-----------------------------------------------------------------------+
  42. **/
  43.  
  44. int main(int argc,char *argv[])
  45.    {
  46.  
  47.    /* Print banner */
  48.  
  49.    printf("DCFVBA Version 1.0  Copyright (c) 1990  Gary Murphy\n\n");
  50.  
  51.    parse_command_line(argc,argv);
  52.  
  53.    /* Write out the initial DCF commands */
  54.  
  55.    fputs(".df bold OS RPT 3 TYPE(BOLD OVERSTRUCK)\n",vba_file);
  56.    fputs(".tr ! 40\n",vba_file);
  57.  
  58.    next_char();
  59.    while(!feof(pcl_file))
  60.       {
  61.       if (*current == '°')
  62.          {
  63.          *current = 'o';
  64.          normal_char();
  65.          }
  66.       else
  67.       if (*current == ESCAPE)
  68.          translate_pcl();
  69.       else
  70.       if (*current == LINEFEED)
  71.          new_line();
  72.       else
  73.       if (*current == CARRIAGE_RETURN)
  74.          new_line();
  75.       else
  76.       if (*current == FORMFEED)
  77.          new_page();
  78.       else
  79.          normal_char();
  80.       next_char();
  81.       } /* while */
  82.  
  83.    /* Flush the buffers */
  84.  
  85.    new_line();
  86.    return(0);
  87.    }
  88.