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

  1. /***
  2. *fcntl.h - file control options used by open()
  3. *
  4. *       Copyright (c) 1985-1997, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. *       This file defines constants for the file control options used
  8. *       by the _open() function.
  9. *       [System V]
  10. *
  11. *       [Public]
  12. *
  13. ****/
  14.  
  15. #if     _MSC_VER > 1000
  16. #pragma once
  17. #endif
  18.  
  19. #ifndef _INC_FCNTL
  20. #define _INC_FCNTL
  21.  
  22. #if     !defined(_WIN32) && !defined(_MAC)
  23. #error ERROR: Only Mac or Win32 targets supported!
  24. #endif
  25.  
  26.  
  27. #define _O_RDONLY       0x0000  /* open for reading only */
  28. #define _O_WRONLY       0x0001  /* open for writing only */
  29. #define _O_RDWR         0x0002  /* open for reading and writing */
  30. #define _O_APPEND       0x0008  /* writes done at eof */
  31.  
  32. #define _O_CREAT        0x0100  /* create and open file */
  33. #define _O_TRUNC        0x0200  /* open and truncate */
  34. #define _O_EXCL         0x0400  /* open only if file doesn't already exist */
  35.  
  36. /* O_TEXT files have <cr><lf> sequences translated to <lf> on read()'s,
  37. ** and <lf> sequences translated to <cr><lf> on write()'s
  38. */
  39.  
  40. #define _O_TEXT         0x4000  /* file mode is text (translated) */
  41. #define _O_BINARY       0x8000  /* file mode is binary (untranslated) */
  42.  
  43. /* macro to translate the C 2.0 name used to force binary mode for files */
  44.  
  45. #define _O_RAW  _O_BINARY
  46.  
  47. /* Open handle inherit bit */
  48.  
  49. #define _O_NOINHERIT    0x0080  /* child process doesn't inherit file */
  50.  
  51. /* Temporary file bit - file is deleted when last handle is closed */
  52.  
  53. #define _O_TEMPORARY    0x0040  /* temporary file bit */
  54.  
  55. /* temporary access hint */
  56.  
  57. #define _O_SHORT_LIVED  0x1000  /* temporary storage file, try not to flush */
  58.  
  59. /* sequential/random access hints */
  60.  
  61. #define _O_SEQUENTIAL   0x0020  /* file access is primarily sequential */
  62. #define _O_RANDOM       0x0010  /* file access is primarily random */
  63.  
  64. #if     !__STDC__ || defined(_POSIX_)
  65. /* Non-ANSI names for compatibility */
  66. #define O_RDONLY        _O_RDONLY
  67. #define O_WRONLY        _O_WRONLY
  68. #define O_RDWR          _O_RDWR
  69. #define O_APPEND        _O_APPEND
  70. #define O_CREAT         _O_CREAT
  71. #define O_TRUNC         _O_TRUNC
  72. #define O_EXCL          _O_EXCL
  73. #define O_TEXT          _O_TEXT
  74. #define O_BINARY        _O_BINARY
  75. #define O_RAW           _O_BINARY
  76. #define O_TEMPORARY     _O_TEMPORARY
  77. #define O_NOINHERIT     _O_NOINHERIT
  78. #define O_SEQUENTIAL    _O_SEQUENTIAL
  79. #define O_RANDOM        _O_RANDOM
  80. #endif  /* __STDC__ */
  81.  
  82. #endif  /* _INC_FCNTL */
  83.