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.

258 lines
7.5 KiB

  1. /* printer.h
  2. contains the definitions of the functions in _SORT,
  3. _BRUTE, _SPOOL.
  4. */
  5. #ifdef OLDWAY
  6. #define PASCAL
  7. #define LONG long
  8. #define NULL 0
  9. #define TRUE 1
  10. #define FALSE 0
  11. #define ERROR (-1)
  12. #define FAR far
  13. #define NEAR near
  14. #define VOID void
  15. #define REGISTER register
  16. /* file IO flags */
  17. #define O_RDONLY 0x0000
  18. #define O_WRONLY 0x0001
  19. #define O_RDWR 0x0002
  20. #define O_APPEND 0x0008 /* writes done at eof */
  21. #define OF_REOPEN 0x8000
  22. #define OF_EXIST 0x4000
  23. #define OF_PROMPT 0x2000
  24. #define OF_CREATE 0x1000
  25. #define OF_CANCEL 0x0800
  26. #define OF_VERIFY 0x0400
  27. #define OF_DELETE 0x0200
  28. #define O_TEXT 0x4000 /* file mode is text (translated) */
  29. #define O_BINARY 0x8000 /* file mode is binary (untranslated) */
  30. #define SP_CREATE O_WRONLY | OF_CREATE
  31. #define SP_OPEN O_RDONLY | OF_EXIST
  32. #define SP_REOPEN O_RDWR | OF_REOPEN | OF_PROMPT | OF_CANCEL
  33. typedef int (FAR * FARPROC)();
  34. typedef int (NEAR * NEARPROC)();
  35. typedef unsigned LONG DWORD;
  36. typedef DWORD (FAR * DWORDFARPROC)();
  37. typedef unsigned short int WORD;
  38. typedef unsigned char BYTE;
  39. typedef WORD HANDLE;
  40. typedef HANDLE HWND;
  41. typedef HANDLE HDC;
  42. typedef WORD ATOM;
  43. typedef int BOOLEAN;
  44. typedef char *NEARP;
  45. typedef char FAR *FARP;
  46. typedef HANDLE GLOBALHANDLE;
  47. typedef HANDLE LOCALHANDLE;
  48. typedef unsigned char *PSTR;
  49. typedef unsigned char far *LPSTR;
  50. typedef short BOOL;
  51. typedef long FAR *LPLONG;
  52. #define MAX(a,b) ((a)>(b)?(a):(b))
  53. #define MIN(a,b) ((a)<=(b)?(a):(b))
  54. #define ABS(x) (((x) >= 0) ? (x) : (-(x)))
  55. #define LWORD(x) ((short)((x)&0xFFFF))
  56. #define HWORD(y) ((short)(((y)>>16)&0xFFFF))
  57. #define MAKELONG(h,l) ((long)(((WORD)l)|(((long)h)<<16)))
  58. #define LOBYTE(w) ((BYTE)w)
  59. #define HIBYTE(w) (((WORD)w >> 8) & 0xff)
  60. #define MAKEPOINT(l) (*((POINT *)&l))
  61. /* Interface to global memory manager */
  62. #define GMEM_SHAREALL 0x2000
  63. #define GMEM_FIXED 0x00
  64. #define GMEM_MOVEABLE 0x02
  65. #define GMEM_ZEROINIT 0x40
  66. #define GMEM_DISCARDABLE 0x0F00
  67. #define GHND (GMEM_MOVEABLE | GMEM_ZEROINIT)
  68. #define GPTR (GMEM_FIXED | GMEM_ZEROINIT)
  69. /* Interface to local memory manager */
  70. #define LMEM_FIXED 0x0000
  71. #define LMEM_MOVEABLE 0x0002
  72. #define LMEM_NOCOMPACT 0x0010
  73. #define LMEM_NODISCARD 0x0020
  74. #define LMEM_ZEROINIT 0x0040
  75. #define LMEM_MODIFY 0x0080
  76. #define LMEM_DISCARDABLE 0x0F00
  77. /* Exported procedures for KERNEL module */
  78. /* Spooler escapes */
  79. #define SE_JOBTIME 0x0001 /* time out for printer */
  80. #define SE_SETCALLBACK 0x0002 /* set callback function */
  81. #define SE_MARKCALLBACK 0x0003 /* write mark for call back */
  82. /* Exported procedures for KERNEL module */
  83. VOID far PASCAL FatalExit( int );
  84. HANDLE far PASCAL LoadModule(LPSTR, LPSTR);
  85. VOID far PASCAL FreeModule(HANDLE);
  86. HANDLE far PASCAL GetModuleHandle(FARP);
  87. FARPROC far PASCAL GetProcAddress(HANDLE, FARP);
  88. HANDLE far PASCAL GlobalAlloc( WORD, DWORD );
  89. HANDLE far PASCAL GlobalReAlloc( HANDLE, DWORD, WORD );
  90. HANDLE far PASCAL GlobalFree( HANDLE );
  91. FARP far PASCAL GlobalLock( HANDLE );
  92. BOOL far PASCAL GlobalUnlock( HANDLE );
  93. LONG far PASCAL GlobalSize( HANDLE );
  94. LONG far PASCAL GlobalFlags( HANDLE );
  95. /* task scheduler routines */
  96. extern void far PASCAL Yield(void);
  97. extern BOOL far PASCAL WaitEvent(HANDLE);
  98. extern BOOL far PASCAL PostEvent(HANDLE);
  99. extern HANDLE far PASCAL GetCurrentTask(void);
  100. short FAR PASCAL GetProfileString(LPSTR, LPSTR, LPSTR, LPSTR, short);
  101. BOOL FAR PASCAL WriteProfileString( LPSTR, LPSTR, LPSTR );
  102. /* Interface to the resource manager */
  103. HANDLE FAR PASCAL FindResource( HANDLE, LPSTR, LPSTR );
  104. HANDLE FAR PASCAL LoadResource( HANDLE, HANDLE );
  105. BOOL FAR PASCAL FreeResource( HANDLE );
  106. char FAR * FAR PASCAL LockResource( HANDLE );
  107. FARPROC FAR PASCAL SetResourceHandler( HANDLE, LPSTR, FARPROC );
  108. HANDLE FAR PASCAL AllocResource( HANDLE, HANDLE, DWORD );
  109. WORD FAR PASCAL SizeofResource( HANDLE, HANDLE );
  110. int FAR PASCAL AccessResource( HANDLE, HANDLE );
  111. #define WM_INITDIALOG 0x0110
  112. #define WM_COMMAND 0x0111
  113. #define WM_ENDDIALOG 0x0088
  114. #define WM_SPOOLERSTATUS 0x002a /* ;Internal */
  115. #define PR_JOBSTATUS 0x0000
  116. typedef struct
  117. {
  118. BYTE cBytes; /* length of structure */
  119. BYTE fFixedDisk; /* non-zero if file located on non- */
  120. /* removeable media */
  121. WORD nErrCode; /* DOS error code if OpenFile fails */
  122. BYTE reserved[ 4 ];
  123. BYTE szPathName[ 128 ];
  124. } OFSTRUCT;
  125. typedef OFSTRUCT FAR * LPOFSTRUCT;
  126. int FAR PASCAL OpenFile( LPSTR, LPOFSTRUCT, WORD );
  127. BYTE FAR PASCAL GetTempDrive( BYTE );
  128. int far PASCAL OpenPathname( LPSTR, int );
  129. int far PASCAL DeletePathname( LPSTR );
  130. int far PASCAL _lopen( LPSTR, int );
  131. void far PASCAL _lclose( int );
  132. int far PASCAL _lcreat( LPSTR, int );
  133. BOOL far PASCAL _ldelete( LPSTR );
  134. WORD far PASCAL _ldup( int );
  135. LONG far PASCAL _llseek( int, long, int );
  136. WORD far PASCAL _lread( int, LPSTR, int );
  137. WORD far PASCAL _lwrite( int, LPSTR, int );
  138. int far PASCAL lstrcmp( LPSTR, LPSTR );
  139. LPSTR far PASCAL lstrcpy( LPSTR, LPSTR );
  140. LPSTR far PASCAL lstrcat( LPSTR, LPSTR );
  141. int far PASCAL lstrlen( LPSTR );
  142. LPSTR far PASCAL lstrbscan( LPSTR, LPSTR );
  143. LPSTR far PASCAL lstrbskip( LPSTR, LPSTR );
  144. /* new Escape support */
  145. #define GETEXTENDEDTEXTMETRICS 256
  146. #define GETEXTENTTABLE 257
  147. #define EXTTEXTOUT 512
  148. #else
  149. #define NOATOM
  150. #define NOGDI
  151. #define NOGDICAPMASKS
  152. #define NOMETAFILE
  153. #define NOMSG
  154. #define NORASTEROPS
  155. #define NOSCROLL
  156. #define NOSOUND
  157. #define NOSYSMETRICS
  158. #define NOTEXTMETRIC
  159. #define NOWH
  160. #define NOCOMM
  161. #define NOKANJI
  162. #include "Windows.h"
  163. #include "winexp.h"
  164. #undef NOATOM
  165. #undef NOGDI
  166. #undef NOGDICAPMASKS
  167. #undef NOMETAFILE
  168. #undef NOMSG
  169. #undef NORASTEROPS
  170. #undef NOSCROLL
  171. #undef NOSOUND
  172. #undef NOSYSMETRICS
  173. #undef NOTEXTMETRIC
  174. #undef NOWH
  175. #undef NOCOMM
  176. #undef NOKANJI
  177. #define NOPTRC /* don't allow gdidefs.inc to redef these */
  178. #define PTTYPE POINT
  179. #endif /* OLDWAY */
  180. /* GDI internal routines */
  181. short FAR PASCAL SetEnvironment(LPSTR, LPSTR, WORD);
  182. short FAR PASCAL GetEnvironment(LPSTR, LPSTR, WORD);
  183. /* _SORT export routines */
  184. HANDLE FAR PASCAL CreatePQ(short);
  185. short FAR PASCAL MinPQ(HANDLE);
  186. short FAR PASCAL ExtractPQ(HANDLE);
  187. short FAR PASCAL InsertPQ(HANDLE, short, short);
  188. short FAR PASCAL SizePQ(HANDLE, short);
  189. void FAR PASCAL DeletePQ(HANDLE);
  190. /* _SPOOL export routines */
  191. HANDLE FAR PASCAL OpenJob(LPSTR, LPSTR, HANDLE);
  192. short FAR PASCAL StartSpoolPage(HANDLE);
  193. short FAR PASCAL EndSpoolPage(HANDLE);
  194. short FAR PASCAL WriteSpool(HANDLE, LPSTR, short);
  195. short FAR PASCAL CloseJob(HANDLE);
  196. short FAR PASCAL DeleteJob(HANDLE, short);
  197. short FAR PASCAL WriteDialog(HANDLE, LPSTR, short);
  198. short FAR PASCAL WriteMark(HANDLE, LPSTR, short);
  199. BOOL FAR PASCAL AddFileSpoolJob(LPSTR, LPSTR, BOOL, LPSTR);
  200. BOOL FAR PASCAL SpoolEscape(HANDLE, short, short, LPSTR, LPSTR);
  201. long FAR PASCAL QueryJob(HANDLE, short);
  202. short FAR PASCAL QueryAbort(HANDLE, short);
  203. /* _SPOOL constants for queryjob */
  204. #define SP_QUERYVALIDJOB 30
  205. #define SP_QUERYDISKAVAIL 0x1004
  206. #define USA_COUNTRYCODE 1
  207. #define PQERROR (-1)