home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 June / PCFJune.iso / Xenon / C++ / FreeCommandLineTools.exe / Include / fcntl.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-31  |  2.7 KB  |  119 lines

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