home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1996 February / PCWK0296.iso / sharewar / dos / program / gs300sr1 / gs300sr1.exe / DOS_.H < prev    next >
C/C++ Source or Header  |  1994-07-27  |  3KB  |  78 lines

  1. /* Copyright (C) 1991, 1992 Aladdin Enterprises.  All rights reserved.
  2.   
  3.   This file is part of Aladdin Ghostscript.
  4.   
  5.   Aladdin Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author
  6.   or distributor accepts any responsibility for the consequences of using it,
  7.   or for whether it serves any particular purpose or works at all, unless he
  8.   or she says so in writing.  Refer to the Aladdin Ghostscript Free Public
  9.   License (the "License") for full details.
  10.   
  11.   Every copy of Aladdin Ghostscript must include a copy of the License,
  12.   normally in a plain ASCII text file named PUBLIC.  The License grants you
  13.   the right to copy, modify and redistribute Aladdin Ghostscript, but only
  14.   under certain conditions described in the License.  Among other things, the
  15.   License requires that the copyright notice and this notice be preserved on
  16.   all copies.
  17. */
  18.  
  19. /* dos_.h */
  20. /* Generic MS-DOS interface */
  21.  
  22. /* This file is needed because the various DOS compilers */
  23. /* provide slightly different procedures for interfacing to DOS and */
  24. /* the I/O hardware, and because the Watcom compiler is 32-bit. */
  25. #include <dos.h>
  26. #if defined(__WATCOMC__) || defined(_MSC_VER)
  27.  
  28. /* ---------------- Microsoft C/C++, all models; */
  29. /* ---------------- Watcom compiler, 32-bit flat model. */
  30. /* ---------------- inp/outp prototypes are in conio.h, not dos.h. */
  31.  
  32. #  include <conio.h>
  33. #  define inport(px) inpw(px)
  34. #  define inportb(px) inp(px)
  35. #  define outport(px,w) outpw(px,w)
  36. #  define outportb(px,b) outp(px,b)
  37. #  define enable() _enable()
  38. #  define disable() _disable()
  39. #  define PTR_OFF(ptr) ((ushort)(uint)(ptr))
  40. /* Define the structure and procedures for file enumeration. */
  41. #define ff_name name
  42. #define dos_findfirst(n,b) _dos_findfirst(n, _A_NORMAL | _A_RDONLY, b)
  43. #define dos_findnext(b) _dos_findnext(b)
  44.  
  45. /* Define things that differ between Watcom and Microsoft. */
  46. #  ifdef __WATCOMC__
  47. #    define MK_PTR(seg,off) (((seg) << 4) + (off))
  48. #    define int86 int386
  49. #    define int86x int386x
  50. #    define rshort w
  51. #    define ff_struct_t struct find_t
  52. #  else
  53. #    define MK_PTR(seg,off) (((ulong)(seg) << 16) + (off))
  54. #    define cputs _cputs
  55. #    define fdopen _fdopen
  56. #    define O_BINARY _O_BINARY
  57. #    define REGS _REGS
  58. #    define rshort x
  59. #    define ff_struct_t struct _find_t
  60. #    define stdprn _stdprn
  61. #  endif
  62.  
  63. #else            /* not Watcom or Microsoft */
  64.  
  65. /* ---------------- Borland compiler, 16:16 pseudo-segmented model. */
  66. /* ---------------- ffblk is in dir.h, not dos.h. */
  67. #include <dir.h>
  68. #  define MK_PTR(seg,off) MK_FP(seg,off)
  69. #  define PTR_OFF(ptr) FP_OFF(ptr)
  70. /* Define the regs union tag for short registers. */
  71. #  define rshort x
  72. /* Define the structure and procedures for file enumeration. */
  73. #define ff_struct_t struct ffblk
  74. #define dos_findfirst(n,b) findfirst(n, b, 0)
  75. #define dos_findnext(b) findnext(b)
  76.  
  77. #endif
  78.