home *** CD-ROM | disk | FTP | other *** search
/ Zodiac Super OZ / MEDIADEPOT.ISO / FILES / 13 / DJCRX201.ZIP / include / fcntl.h < prev    next >
C/C++ Source or Header  |  1996-09-26  |  3KB  |  128 lines

  1. /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
  2. #ifndef __dj_include_fcntl_h_
  3. #define __dj_include_fcntl_h_
  4.  
  5. #ifdef __cplusplus
  6. extern "C" {
  7. #endif
  8.  
  9. #ifndef __dj_ENFORCE_ANSI_FREESTANDING
  10.  
  11. #ifndef __STRICT_ANSI__
  12.  
  13. #define FD_CLOEXEC    0x0001
  14.  
  15. #define F_DUPFD        1
  16. #define F_GETFD        2
  17. #define F_GETFL        3
  18. #define F_GETLK        4
  19. #define F_SETFD        5
  20. #define F_SETFL        6
  21. #define F_SETLK        7
  22. #define F_SETLKW    8
  23.  
  24. #define F_UNLCK        0
  25. #define F_RDLCK        1
  26. #define F_WRLCK        2
  27.  
  28. #define O_RDONLY    0x0000
  29. #define O_WRONLY    0x0001
  30. #define O_RDWR        0x0002
  31. #define O_ACCMODE    0x0003
  32.  
  33. #define O_BINARY    0x0004    /* must fit in char, reserved by dos */
  34. #define O_TEXT        0x0008    /* must fit in char, reserved by dos */
  35. #define O_NOINHERIT    0x0080    /* DOS-specific */
  36.  
  37. #define O_CREAT        0x0100    /* second byte, away from DOS bits */
  38. #define O_EXCL        0x0200
  39. #define O_NOCTTY    0x0400
  40. #define O_TRUNC        0x0800
  41. #define O_APPEND    0x1000
  42. #define O_NONBLOCK    0x2000
  43.  
  44. #include <sys/types.h>
  45.  
  46. struct flock {
  47.   off_t    l_len;
  48.   pid_t    l_pid;
  49.   off_t    l_start;
  50.   short    l_type;
  51.   short    l_whence;
  52. };
  53.  
  54. extern int _fmode; /* O_TEXT or O_BINARY */
  55.  
  56. int    open(const char *_path, int _oflag, ...);
  57. int    creat(const char *_path, mode_t _mode);
  58. int    fcntl(int _fildes, int _cmd, ...);
  59.  
  60. #ifndef _POSIX_SOURCE
  61.  
  62. #define SH_COMPAT    0x0000
  63. #define SH_DENYRW    0x0010
  64. #define SH_DENYWR    0x0020
  65. #define SH_DENYRD    0x0030
  66. #define SH_DENYNO    0x0040
  67.  
  68. #define _SH_COMPAT    SH_COMPAT
  69. #define _SH_DENYRW    SH_DENYRW
  70. #define _SH_DENYWR    SH_DENYWR
  71. #define _SH_DENYRD    SH_DENYRD
  72. #define _SH_DENYNO    SH_DENYNO
  73.  
  74. #define S_IREAD        S_IRUSR
  75. #define S_IWRITE    S_IWUSR
  76. #define S_IEXEC        S_IXUSR
  77.  
  78. /*
  79.  *  For compatibility with other DOS C compilers.
  80.  */
  81.  
  82. #define _O_RDONLY       O_RDONLY
  83. #define _O_WRONLY       O_WRONLY
  84. #define _O_RDWR         O_RDWR
  85. #define _O_APPEND       O_APPEND
  86. #define _O_CREAT        O_CREAT
  87. #define _O_TRUNC        O_TRUNC
  88. #define _O_EXCL         O_EXCL
  89. #define _O_TEXT         O_TEXT
  90. #define _O_BINARY       O_BINARY
  91. #define _O_NOINHERIT    O_NOINHERIT
  92.  
  93. /*
  94.  * Support for advanced filesystems (Windows 9x VFAT, NTFS, LFN etc.)
  95.  */
  96.  
  97. #define _FILESYS_UNKNOWN    0x80000000U
  98. #define _FILESYS_CASE_SENSITIVE    0x0001
  99. #define _FILESYS_CASE_PRESERVED    0x0002
  100. #define _FILESYS_UNICODE    0x0004
  101. #define _FILESYS_LFN_SUPPORTED    0x4000
  102. #define _FILESYS_VOL_COMPRESSED    0x8000
  103.  
  104. unsigned _get_volume_info (const char *_path, int *_max_file_len, int *_max_path_len, char *_filesystype);
  105. char _use_lfn (const char *_path);
  106. char *_lfn_gen_short_fname (const char *_long_fname, char *_short_fname);
  107.  
  108. #define _LFN_CTIME    1
  109. #define _LFN_ATIME    2
  110.  
  111. unsigned _lfn_get_ftime (int _handle, int _which);
  112.  
  113. char _preserve_fncase (void);
  114. #define _USE_LFN    _use_lfn(0) /* assume it's the same on ALL drives */
  115.  
  116. #endif /* !_POSIX_SOURCE */
  117. #endif /* !__STRICT_ANSI__ */
  118. #endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
  119.  
  120. #ifndef __dj_ENFORCE_FUNCTION_CALLS
  121. #endif /* !__dj_ENFORCE_FUNCTION_CALLS */
  122.  
  123. #ifdef __cplusplus
  124. }
  125. #endif
  126.  
  127. #endif /* !__dj_include_fcntl_h_ */
  128.