home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1993 #2 / Image.iso / clipper / 52capi.zip / FILESYS.API < prev    next >
Text File  |  1993-08-06  |  3KB  |  147 lines

  1. /***
  2. *
  3. *   Filesys.api
  4. *
  5. *   C language definitions for Clipper low level file I/O system
  6. *
  7. *   Copyright (c) 1992-1993, Computer Associates International, Inc.
  8. *   All rights reserved.
  9. *
  10. *   CA-Clipper uses Microsoft C large model calling conventions
  11. *
  12. */
  13.  
  14.  
  15. #ifndef _FILESYS_API
  16.  
  17.   
  18. #ifndef _CLIPDEFS_H
  19. #include "clipdefs.h"
  20. #endif
  21.  
  22.  
  23. #ifndef _ERROR_API
  24. #include "error.api"
  25. #endif
  26.  
  27.  
  28.  
  29. /*
  30. *  Make sure HANDLE is defined
  31. */
  32. #ifndef FHANDLE_DEFINED
  33.  
  34. typedef USHORT FHANDLE;
  35. typedef FHANDLE fhandle;
  36. typedef FHANDLE far * FHANDLEP;
  37.  
  38. #define FHANDLE_DEFINED
  39. #endif
  40.  
  41.  
  42.  
  43. /*
  44. *   DOS predefined standard handles
  45. */
  46.  
  47. #define STDIN    0
  48. #define STDOUT   1
  49. #define STDERR   2
  50. #define STDAUX   3
  51. #define STDPRN   4
  52.  
  53.  
  54. /*
  55. *   Error value
  56. */
  57.  
  58. #define FS_ERROR      0xFFFF
  59.  
  60.  
  61. /*
  62. *   OPEN modes
  63. */
  64.  
  65. // access flags
  66. #define FO_READ       0x0000
  67. #define FO_WRITE      0x0001
  68. #define FO_READWRITE  0x0002
  69.  
  70. // sharing flags
  71. #define FO_COMPAT     0x0000
  72. #define FO_EXCLUSIVE  0x0010
  73. #define FO_DENYWRITE  0x0020
  74. #define FO_DENYREAD   0x0030
  75. #define FO_DENYNONE   0x0040
  76. #define FO_SHARED     0x0040
  77.  
  78. // inheritance flags
  79. #define FO_INHERITED  0x0000
  80. #define FO_PRIVATE    0x0080
  81.  
  82.  
  83. /*
  84. *   CREATE attributes
  85. */
  86.  
  87. #define FC_NORMAL     0x0000  
  88. #define FC_READONLY   0x0001
  89. #define FC_HIDDEN     0x0002
  90. #define FC_SYSTEM     0x0004
  91.  
  92.  
  93.  
  94. /*
  95. *  SEEK modes
  96. */
  97.  
  98. #define FS_SET        0x0000
  99. #define FS_RELATIVE   0x0001
  100. #define FS_END        0x0002
  101.  
  102.  
  103.  
  104. /*
  105. *   LOCK modes
  106. */
  107.  
  108. #define FL_LOCK       0x0000
  109. #define FL_UNLOCK     0x0001
  110.  
  111.  
  112.  
  113. /*
  114. *   Extend file open modes
  115. */
  116. /* _txopen() extended mode flags */
  117.  
  118. #define FXO_TRUNCATE   0x0100
  119. #define FXO_APPEND     0x0200
  120. #define FXO_FORCEEXT   0x0800
  121. #define FXO_DEFAULTS   0x1000
  122. #define FXO_DEVICERAW  0x2000
  123.  
  124.  
  125.  
  126. /*
  127. *   Function prototypes
  128. */
  129.  
  130. extern FHANDLE _fsCreate( BYTEP filename, USHORT attribute );
  131. extern void    _fsDelete( BYTEP filename );
  132. extern FHANDLE _fsOpen( BYTEP filename, USHORT flags );
  133. extern void    _fsClose( FHANDLE h );
  134. extern USHORT  _fsRead( FHANDLE h, BYTEP buff, USHORT count );
  135. extern USHORT  _fsWrite( FHANDLE h, BYTEP buff, USHORT count );
  136. extern ULONG   _fsSeek( FHANDLE h, LONG offset, USHORT mode );
  137. extern void    _fsRename( BYTEP oldname, BYTEP newname );
  138. extern BOOL    _fsLock( FHANDLE h, ULONG start, ULONG length, USHORT mode );
  139. extern void    _fsCommit( FHANDLE h );
  140. extern FHANDLE _fsExtOpen( BYTEP filename, BYTEP defExt, USHORT flags,
  141.                            BYTEP paths, ERRORP error );
  142. extern USHORT  _fsError(void);
  143.  
  144.  
  145. #define _FILESYS_API
  146. #endif
  147.