home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / UDEL.ZIP / SFPRT.H < prev    next >
Text File  |  1988-08-30  |  8KB  |  134 lines

  1. /****************************************************************************
  2. *   sfdprt.h - standart prt routines.                                       *
  3. *                                               T.  Sandberg                *
  4. *                                               06/04/88                    *
  5. *                                                                           *
  6. ****************************************************************************/
  7.  
  8. #define CPI_10 1
  9. #define CPI_12 2
  10. #define CPI_17 3
  11. #define LPI_6  4
  12. #define LPI_8  5
  13. #define BOLDON 6
  14. #define BOLDOFF 7
  15. #define UNDERLINEON  8
  16. #define UNDERLINEOFF 9
  17. #define DBWON  10
  18. #define DBWOFF 11
  19. #define DRAFT 12
  20. #define DATA  13
  21. #define NLQ   14
  22. #define RESETPRINTER 15
  23. #define NEWPAGE 16
  24.  
  25.  
  26. typedef struct _SFPRTVALUES
  27.                 {
  28.                   int  cpi;        /* printer default char per inch */
  29.                   int  lpi;        /* printer defautl line per inch */
  30.                   int  lpp;        /* line per page                 */
  31.                   int  ff;         /* 0 = no form feed cr used; 1 use ff */
  32.                   char cpi10[11];  /* control string to put printer 10 cpi */
  33.                   char cpi12[11];  /* control string to put printer 12 cpi */
  34.                   char cpi17[11];  /* control string to put printer 17 cpi */
  35.                   char lpi6[11];   /* control string to put printer 6 lpi */
  36.                   char lpi8[11];   /* control string to put printer 8 lpi */
  37.                   char bold_on[11]; /*  bold on */
  38.                   char bold_off[11]; /* bold off */
  39.                   char ul_on[11];  /* under line on */
  40.                   char ul_off[11];  /* under line off */
  41.                   char dbw_on[11]; /* double wide on */
  42.                   char dbw_off[11]; /* dobule wide off */
  43.                   char draft_mode[11];
  44.                   char data_mode[11];
  45.                   char nlq_mode[11];
  46.                   char lppset[12]; /* string to set page length */
  47.                   char reset[11];  /* contorl string to reset printer  */
  48.                   int curentline;  /* current line printed */
  49.                    }
  50. SFPRTVALUES;
  51.  
  52.  
  53. typedef struct _SFAPPVALUES
  54.                 {
  55.                   int  cpi;        /* printer default char per inch */
  56.                   int  lpi;        /* printer defautl line per inch */
  57.                   int  lpp;        /* line per page                 */
  58.                   int  ff;         /* 0 = no form feed cr used; 1 use ff */
  59.                   char lppset[12]; /* string to set page length */
  60.                 }
  61. SFAPPVALUES;
  62.  
  63.  
  64. void sfdos_prt_value(char *env,char *appctl,SFPRTVALUES *pv);
  65. /****************************************************************************
  66. *  sfprt_value    Set printer with application default if found or uses     *
  67. *                    general print defaults.                                *
  68. *                                                                           *
  69. *           parms are                                                       *
  70. *           p_env   = print enviroment variable, will use this to get       *
  71. *                     enviroment value.                                     *
  72. *           a_env   = application enviroment variable.                      *
  73. *           appctl  = application control file name will use env variable   *
  74. *                     to find directory (use file name only unless env is   *
  75. *                     null.                                                 *
  76. *           pv      = printer values used will return the values found and  *
  77. *                     set.                                                  *
  78. *                                                                           *
  79. * NOTE:    This function does everting sfprt_values plus initilize the      *
  80. *          print file.                                                      *
  81. ****************************************************************************/
  82.  
  83.  
  84.  
  85.  
  86. void sfprt_init(FILE *prtfile,char *p_env,char *a_env,
  87.                char *appctl,SFPRTVALUES *pv);
  88. /****************************************************************************
  89. *  sfprt_init    Set printer with application default if found or uses      *
  90. *                    general print defaults.                                *
  91. *                                                                           *
  92. *           parms are                                                       *
  93. *           prtfile = file to be initilized (must be open)                  *
  94. *           p_env   = print enviroment variable, will use this to get       *
  95. *                     enviroment value.                                     *
  96. *           a_env   = application enviroment variable.                      *
  97. *           appctl  = application control file name will use env variable   *
  98. *                     to find directory (use file name only unless env is   *
  99. *                     null.                                                 *
  100. *           pv      = printer values used will return the values found and  *
  101. *                     set.                                                  *
  102. *                                                                           *
  103. * NOTE:    This function does everting sfprt_values plus initilize the      *
  104. *          print file.                                                      *
  105. ****************************************************************************/
  106.  
  107.  
  108.  
  109. void sfprt_function(FILE *prtfile,SFPRTVALUES *pv,int function);
  110. /*****************************************************************************
  111. *  sfprt_function =  send special function to printer file.                  *
  112. *                                                                            *
  113. *      parms are                                                             *
  114. *            prtfile = print file to send special function to. (must be open)*
  115. *            pv      = print contorl values.                                 *
  116. *                      must of called "sfprt_init" or "sfprt_value" first    *
  117. *            control = fuction to be performed accepted values are           *
  118. *                       10CPI change printer to 10 char per inch             *
  119. *                       12CPI change printer to 12 char per inch             *
  120. *                       17CPI change printer to 17 char per inch             *
  121. *                       6LPI  change printer to 6 lines per inch             *
  122. *                       8LPI  change printer to 8 lines per inch             *
  123. *                       BOLDON  set printer to print bold characters         *
  124. *                       BOLDOFF set printer bold off                         *
  125. *                       UNDERLINEON  under line on                           *
  126. *                       UNDERLINEOFF under line off                          *
  127. *                       DBWON  double wide on                                *
  128. *                       DBWOFF double wide off                               *
  129. *                       DRAFT set printer to draft mode                      *
  130. *                       DATA  set printer to data processing mode            *
  131. *                       NLQ   set printer to NLQ mode                        *
  132. *                                                                            *
  133. *****************************************************************************/
  134.