home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 9 / CDACTUAL9.iso / progs / CB / DATA.Z / FCNTL.H < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-18  |  2.5 KB  |  108 lines

  1. /*  fcntl.h
  2.  
  3.     Define flag values accessible to open.
  4.  
  5. */
  6.  
  7. /* $Copyright: 1987$ */
  8. /* $Revision:   8.1  $ */
  9.  
  10. #if !defined(__FCNTL_H)
  11. #define __FCNTL_H
  12.  
  13. #if !defined(___DEFS_H)
  14. #include <_defs.h>
  15. #endif
  16.  
  17. #if !defined(RC_INVOKED)
  18.  
  19. #if defined(__STDC__)
  20. #pragma warn -nak
  21. #endif
  22.  
  23. #endif  /* !RC_INVOKED */
  24.  
  25. #if defined(__FLAT__)
  26.  
  27. #if defined(__cplusplus)
  28. extern "C" {
  29. #endif
  30. int _RTLENTRY _EXPFUNC _pipe(int *phandles, unsigned int psize, int textmode);
  31. #if defined(__cplusplus)
  32. }
  33. #endif
  34. #endif  /* __FLAT__ */
  35.  
  36. extern int _RTLENTRY _fmode;
  37.  
  38. /* The first three can only be set by open */
  39.  
  40. #if !defined(__FLAT__)
  41. #define O_RDONLY    1
  42. #define O_WRONLY    2
  43. #define O_RDWR      4
  44. #else
  45. #define O_RDONLY    0
  46. #define O_WRONLY    1
  47. #define O_RDWR      2
  48. #define O_ACCMODE   3       /* mask for file access modes */
  49. #endif  /* __FLAT__ */
  50.  
  51. /* Flag values for open only */
  52.  
  53. #define O_CREAT     0x0100  /* create and open file */
  54. #define O_TRUNC     0x0200  /* open with truncation */
  55. #define O_EXCL      0x0400  /* exclusive open */
  56.  
  57. /* The "open flags" defined above are not needed after open, hence they
  58.    are re-used for other purposes when the file is running.  Sorry, it's
  59.    getting crowded !
  60. */
  61. #define _O_RUNFLAGS 0x0700
  62. #define _O_WRITABLE 0x0100 /* file is not read-only */
  63. #define _O_EOF      0x0200 /* set when text file hits ^Z   */
  64.  
  65. /* a file in append mode may be written to only at its end.
  66. */
  67. #define O_APPEND    0x0800  /* to end of file */
  68.  
  69. /* MSDOS special bits */
  70.  
  71. #define O_CHANGED   0x1000  /* user may read these bits, but    */
  72. #define O_DEVICE    0x2000  /*   only RTL\io functions may touch.   */
  73. #define O_TEXT      0x4000  /* CR-LF translation    */
  74. #define O_BINARY    0x8000  /* no translation   */
  75.  
  76. /* DOS 3.x options */
  77.  
  78. #define O_NOINHERIT 0x80
  79. #define O_DENYALL   0x10
  80. #define O_DENYWRITE 0x20
  81. #define O_DENYREAD  0x30
  82. #define O_DENYNONE  0x40
  83.  
  84. #if defined(__MFC_COMPAT__)
  85. #define _O_APPEND      O_APPEND
  86. #define _O_BINARY      O_BINARY
  87. #define _O_CREAT       O_CREAT
  88. #define _O_EXCL        O_EXCL
  89. #define _O_NOINHERIT   O_NOINHERIT
  90. #define _O_RANDOM      O_RANDOM
  91. #define _O_RAW         O_BINARY
  92. #define _O_RDONLY      O_RDONLY
  93. #define _O_RDWR        O_RDWR
  94. #define _O_TEXT        O_TEXT
  95. #define _O_TRUNC       O_TRUNC
  96. #define _O_WRONLY      O_WRONLY
  97. #endif
  98.  
  99. #if !defined(RC_INVOKED)
  100.  
  101. #if defined(__STDC__)
  102. #pragma warn .nak
  103. #endif
  104.  
  105. #endif  /* !RC_INVOKED */
  106.  
  107. #endif  /* __FCNTL_H */
  108.