home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c083 / 14.ddi / GENINC.PAK / FCNTL.H < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-02  |  1.9 KB  |  83 lines

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