Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

249 lines
6.6 KiB

  1. /*=========================================================================
  2. *
  3. * LPR.H : Master Header file for PPR
  4. *
  5. *-------------------------------------------------------------------------
  6. *
  7. * Possible defines (differences mostly in network connections):
  8. *
  9. * DOS - DOS 3.x
  10. * OS2 - OS/2
  11. * X86 - 286 Xenix
  12. * (default) - SUN Xenix
  13. *
  14. * Normal combinations:
  15. *
  16. * if DOS || OS2 || X86
  17. * non-68k
  18. * else
  19. * 68k
  20. * endif
  21. *
  22. * if DOS || OS2
  23. * non-Xenix
  24. * else
  25. * Xenix
  26. * endif
  27. *
  28. * Currenently active code, is only being compiled for DOS and OS/2.
  29. * Support for other platforms is untested.
  30. *
  31. **************************************************************************/
  32. #define VERSION "2.3a" // Current Version number of PPR
  33. #define ANALYST "RobertH" // Current responsible (sic.) programmer
  34. #define COMPANY "Microsoft"
  35. #define CONFIDENTIAL "CONFIDENTIAL"
  36. #define cchArgMax 128
  37. #define cchLineMax 256
  38. # define PRINTER "lpt1"
  39. # define strnxcmp _strnicmp
  40. # define strcmpx _strcmpi
  41. # define SILENT " >NUL"
  42. # define szROBin "rb"
  43. # define szWOBin "wb"
  44. #define DEFAULT "default"
  45. #define OPTS "opts"
  46. #define RESETPRINTER "\033E"
  47. /* [01]o - landscape/portrait (0 - portrait)
  48. #D - lines per inch (8 or 6)
  49. #C - vertical motion index (# 1/48in)
  50. 0p - fixed pitch
  51. #h - pitch
  52. #v point size
  53. #t - type face (0 - line printer; 3 - courier)
  54. These sequences assume that the printer has been reset once before hand.
  55. */
  56. #define BEGINBANNER "\033&l1o6D\033(8U\033(s0p10h12v3T"
  57. #define BEGINPORTRAIT "\033&l0o7.7C\033(8U\033(s0p10h12v3T"
  58. #define SELECTFRONTPAGE "\033&a1G"
  59. #define SELECTNEXTPAGE "\033&a0G"
  60. #define BEGINDUPLEXVERT "\033&l1S"
  61. #define BEGINDUPLEXHOR "\033&l2S"
  62. #define BEGINSIMPLEX "\033&l0S"
  63. #define MOVETOTOP "\033&a1R"
  64. #define rowLJMax 62 /* lines per page on laser jet */
  65. #define colLJMax 175 /* columns per page on laser jet */
  66. #define colLJPortMax 80 /* columns per page in portrait mode */
  67. #define rowLJBanMax 50 /* rows on banner page */
  68. #define colLJBanMax 105 /* columns on banner page */
  69. #define rowLPMax 66 /* lines per page on line printer */
  70. #define colLPMax 132 /* columns per page on line printer */
  71. #define rowPSMax 62 /* lines per page on laserwriter */
  72. #define colPSMax 170 /* columns per page on laserwriter */
  73. #define colPSPortMax 85 /* columns per page in portrait mode */
  74. #define rowPSBanMax 48 /* rows on banner page */
  75. #define colPSBanMax 115 /* columns on banner page */
  76. /* Note: The following must be at least the maximum
  77. * of all the possible printer values. */
  78. #define rowMax 100 /* number of lines in page image */
  79. #define colMax 200 /* number of columns in page image */
  80. #define cchLNMax 6 /* number of columns for line number */
  81. #define LINUMFORMAT "%5d " /* format to print line number in */
  82. #define colGutDef 5 /* default column of gutter */
  83. #define HT ((char) 9)
  84. #define LF ((char) 10)
  85. #define FF ((char) 12)
  86. #define CR ((char) 13)
  87. #define BS ((char) '\b')
  88. // supported Laserjet symbol sets - used by aszSymSet
  89. #define BEGINLANDUSASCII 0x0000
  90. #define BEGINLANDROMAN8 0x0001
  91. #define BEGINLANDIBMPC 0x0002 // Not available on early models ?
  92. #if !defined (ERROR_ALREADY_ASSIGNED)
  93. #define ERROR_ALREADY_ASSIGNED 85
  94. #endif
  95. /* return index of beginning col of column icol for columns col wide */
  96. #define ColBeginIcol(iCol,col) ((fBorder ? 1 : 0) + (iCol)*(col+1) )
  97. extern int colTab; /* expand tabs every colTab columns */
  98. extern long lcbOutLPR;
  99. extern char szPName[];
  100. extern char szNet[];
  101. extern char szPass[];
  102. extern char *szPDesc;
  103. extern int cCol;
  104. extern int cCopies;
  105. extern int colGutter;
  106. extern int colText;
  107. extern int colWidth;
  108. extern int colMac;
  109. extern int rowMac;
  110. extern int rowPage;
  111. extern USHORT usSymSet;
  112. extern char *aszSymSet[];
  113. extern char page[rowMax][colMax+1];
  114. extern BOOL fNumber;
  115. extern BOOL fDelete;
  116. extern BOOL fRaw;
  117. extern BOOL fBorder;
  118. extern BOOL fLabel;
  119. extern BOOL fLaser;
  120. extern BOOL fPostScript;
  121. extern BOOL fPSF;
  122. extern char szPSF[];
  123. extern BOOL fPCondensed;
  124. extern BOOL fConfidential;
  125. extern BOOL fVDuplex;
  126. extern BOOL fHDuplex;
  127. extern BOOL fSilent;
  128. extern int cBanner;
  129. extern char chBanner;
  130. extern char *szBanner;
  131. extern char *szStamp;
  132. extern BOOL fForceFF;
  133. extern BOOL fPortrait;
  134. extern BOOL fFirstFile;
  135. /* VARARGS */
  136. void __cdecl Fatal(char *,...);
  137. void __cdecl Error(char *,...);
  138. void PrinterDoOptSz(char *);
  139. char * SzGetSzSz(char *, char *);
  140. /* from lpfile.c */
  141. BOOL FRootPath(char *, char *);
  142. char* __cdecl fgetl(char *, int, FILE *);
  143. FILE * PfileOpen(char *, char *);
  144. char *SzFindPath(char *, char *, char *);
  145. /* from lplow.c*/
  146. void SetupRedir(void);
  147. void ResetRedir(void);
  148. BOOL QueryUserName(char *);
  149. int EndRedir(char *);
  150. int SetPrnRedir(char *, char *);
  151. /* from lpprint.c */
  152. void OutLPR(char *, int);
  153. void OutLPRPS(char *, int);
  154. void OutLPRPS7(char *, int);
  155. BOOL FKeyword(char *);
  156. void InitPrinter(void);
  157. void MyOpenPrinter(void);
  158. void FlushPrinter(void);
  159. void MyClosePrinter(void);
  160. char *SzGetSzSz(char *, char *);
  161. char *SzGetPrnName(char *, char *);
  162. BOOL FParseSz(char *);
  163. void SetupPrinter(void);
  164. /* from lppage.c */
  165. void BannerSz(char *, int);
  166. void SzDateSzTime(char *, char *) ;
  167. void FlushPage(void);
  168. void InitPage(void);
  169. void RestoreTopRow(void);
  170. void PlaceTop(char *, int, int, int);
  171. void PlaceNumber(int);
  172. void LabelPage(void);
  173. BOOL FilenamX(char *, char *);
  174. void AdvancePage(void);
  175. void XoutNonPrintSz(char * );
  176. void LineOut(char *, BOOL);
  177. void RawOut(char *, int);
  178. int FileOut(char *);
  179. /* from lpr.c */
  180. void Abort(void);
  181. char * SzGetArg(char ** , int *, char **[] );
  182. int WGetArg(char **, int *, char **[] , int, char *);
  183. void DoOptSz(char * );
  184. void DoIniOptions();
  185. /* from pspage.c */
  186. void block_flush(char [], int, int);
  187. void VertLine(char, int, int, int);
  188. void HorzLine(char, int, int, int);
  189. void FillRectangle(char, int, int, int, int);
  190. void WriteSzCoord(char *, int, int);
  191. void OutCmpLJ(char * ,int );
  192. void OutEncPS(char *, int);
  193. void OutCmpPS(char *,int );
  194. int CchNoTrail(char [],int);
  195. void OutRectangle(int, int, int, int);
  196.