home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / crt / src / msdos.h < prev    next >
C/C++ Source or Header  |  1998-06-17  |  3KB  |  91 lines

  1. /***
  2. *msdos.h - MS-DOS definitions for C runtime
  3. *
  4. *       Copyright (c) 1987-1997, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. *       The file contains the MS-DOS definitions (function request numbers,
  8. *       flags, etc.) used by the C runtime.
  9. *
  10. *       [Internal]
  11. *
  12. ****/
  13.  
  14. #if _MSC_VER > 1000
  15. #pragma once
  16. #endif  /* _MSC_VER > 1000 */
  17.  
  18. #ifndef _INC_MSDOS
  19. #define _INC_MSDOS
  20.  
  21. #ifndef _CRTBLD
  22. /*
  23.  * This is an internal C runtime header file. It is used when building
  24.  * the C runtimes only. It is not to be used as a public header file.
  25.  */
  26. #error ERROR: Use of C runtime library internal header file.
  27. #endif  /* _CRTBLD */
  28.  
  29. /* Stack slop for o.s. system call overhead */
  30.  
  31. #define _STACKSLOP      1024
  32.  
  33. /* __osfile flag values for DOS file handles */
  34.  
  35. #define FOPEN           0x01    /* file handle open */
  36. #define FEOFLAG         0x02    /* end of file has been encountered */
  37. #ifdef _MAC
  38. #define FWRONLY         0x04    /* file handle associated with write only file */
  39. #define FLOCK           0x08    /* file has been successfully locked at least once */
  40. #else  /* _MAC */
  41. #define FCRLF           0x04    /* CR-LF across read buffer (in text mode) */
  42. #define FPIPE           0x08    /* file handle refers to a pipe */
  43. #endif  /* _MAC */
  44. #ifdef _WIN32
  45. #define FNOINHERIT      0x10    /* file handle opened _O_NOINHERIT */
  46. #else  /* _WIN32 */
  47. #define FRDONLY         0x10    /* file handle associated with read only file */
  48. #endif  /* _WIN32 */
  49.  
  50. #define FAPPEND         0x20    /* file handle opened O_APPEND */
  51. #define FDEV            0x40    /* file handle refers to device */
  52. #define FTEXT           0x80    /* file handle is in text mode */
  53.  
  54. /* DOS errno values for setting __doserrno in C routines */
  55.  
  56. #define E_ifunc         1       /* invalid function code */
  57. #define E_nofile        2       /* file not found */
  58. #define E_nopath        3       /* path not found */
  59. #define E_toomany       4       /* too many open files */
  60. #define E_access        5       /* access denied */
  61. #define E_ihandle       6       /* invalid handle */
  62. #define E_arena         7       /* arena trashed */
  63. #define E_nomem         8       /* not enough memory */
  64. #define E_iblock        9       /* invalid block */
  65. #define E_badenv        10      /* bad environment */
  66. #define E_badfmt        11      /* bad format */
  67. #define E_iaccess       12      /* invalid access code */
  68. #define E_idata         13      /* invalid data */
  69. #define E_unknown       14      /* ??? unknown error ??? */
  70. #define E_idrive        15      /* invalid drive */
  71. #define E_curdir        16      /* current directory */
  72. #define E_difdev        17      /* not same device */
  73. #define E_nomore        18      /* no more files */
  74. #define E_maxerr2       19      /* unknown error - Version 2.0 */
  75. #define E_sharerr       32      /* sharing violation */
  76. #define E_lockerr       33      /* locking violation */
  77. #define E_maxerr3       34      /* unknown error - Version 3.0 */
  78.  
  79. /* DOS file attributes */
  80.  
  81. #define A_RO            0x1     /* read only */
  82. #define A_H             0x2     /* hidden */
  83. #define A_S             0x4     /* system */
  84. #define A_V             0x8     /* volume id */
  85. #define A_D             0x10    /* directory */
  86. #define A_A             0x20    /* archive */
  87.  
  88. #define A_MOD   (A_RO+A_H+A_S+A_A)      /* changeable attributes */
  89.  
  90. #endif  /* _INC_MSDOS */
  91.