home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1997 May / VPR9705A.ISO / VPR_DATA / PROGRAM / CBTRIAL / SETUP / DATA.Z / FCNTL.H < prev    next >
C/C++ Source or Header  |  1997-02-14  |  3KB  |  114 lines

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