Changeset 33973 in vbox for trunk/include/iprt/vfs.h
- Timestamp:
- Nov 11, 2010 11:10:10 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/vfs.h
r33948 r33973 31 31 #include <iprt/dir.h> 32 32 #include <iprt/fs.h> 33 #include <iprt/handle.h> 33 34 #include <iprt/symlink.h> 34 35 #include <iprt/sg.h> … … 56 57 * @{ 57 58 */ 58 59 /** Virtual Filesystem handle. */60 typedef struct RTVFSINTERNAL *RTVFS;61 /** Pointer to a VFS handle. */62 typedef RTVFS *PRTVFS;63 /** A NIL VFS handle. */64 #define NIL_RTVFS ((RTVFS)~(uintptr_t)0)65 66 /** Virtual Filesystem base object handle. */67 typedef struct RTVFSOBJINTERNAL *RTVFSOBJ;68 /** Pointer to a VFS base object handle. */69 typedef RTVFSOBJ *PRTVFSOBJ;70 /** A NIL VFS base object handle. */71 #define NIL_RTVFSOBJ ((RTVFSOBJ)~(uintptr_t)0)72 73 /** Virtual Filesystem directory handle. */74 typedef struct RTVFSDIRINTERNAL *RTVFSDIR;75 /** Pointer to a VFS directory handle. */76 typedef RTVFSDIR *PRTVFSDIR;77 /** A NIL VFS directory handle. */78 #define NIL_RTVFSDIR ((RTVFSDIR)~(uintptr_t)0)79 80 /** Virtual Filesystem filesystem stream handle. */81 typedef struct RTVFSFSSTREAMINTERNAL *RTVFSFSSTREAM;82 /** Pointer to a VFS filesystem stream handle. */83 typedef RTVFSFSSTREAM *PRTVFSFSSTREAM;84 /** A NIL VFS filesystem stream handle. */85 #define NIL_RTVFSFSSTREAM ((RTVFSFSSTREAM)~(uintptr_t)0)86 87 /** Virtual Filesystem I/O stream handle. */88 typedef struct RTVFSIOSTREAMINTERNAL *RTVFSIOSTREAM;89 /** Pointer to a VFS I/O stream handle. */90 typedef RTVFSIOSTREAM *PRTVFSIOSTREAM;91 /** A NIL VFS I/O stream handle. */92 #define NIL_RTVFSIOSTREAM ((RTVFSIOSTREAM)~(uintptr_t)0)93 94 /** Virtual Filesystem file handle. */95 typedef struct RTVFSFILEINTERNAL *RTVFSFILE;96 /** Pointer to a VFS file handle. */97 typedef RTVFSFILE *PRTVFSFILE;98 /** A NIL VFS file handle. */99 #define NIL_RTVFSFILE ((RTVFSFILE)~(uintptr_t)0)100 101 /** Virtual Filesystem symbolic link handle. */102 typedef struct RTVFSSYMLINKINTERNAL *RTVFSSYMLINK;103 /** Pointer to a VFS symbolic link handle. */104 typedef RTVFSSYMLINK *PRTVFSSYMLINK;105 /** A NIL VFS symbolic link handle. */106 #define NIL_RTVFSSYMLINK ((RTVFSSYMLINK)~(uintptr_t)0)107 59 108 60 /** … … 139 91 140 92 141 142 93 /** @name RTVfsCreate flags 143 94 * @{ */ … … 293 244 294 245 /** 246 * Create a VFS I/O stream handle from a standard IPRT file handle (RTFILE). 247 * 248 * @returns IPRT status code. 249 * @param hFile The standard IPRT file handle. 250 * @param fOpen The flags the handle was opened with. Pass 0 to 251 * have these detected. 252 * @param fLeaveOpen Whether to leave the handle open when the VFS file 253 * is released, or to close it (@c false). 254 * @param phVfsIos Where to return the VFS I/O stream handle. 255 */ 256 RTDECL(int) RTVfsIoStrmFromRTFile(RTFILE hFile, uint32_t fOpen, bool fLeaveOpen, PRTVFSIOSTREAM phVfsIos); 257 258 /** 259 * Create a VFS I/O stream handle from one of the standard handles. 260 * 261 * @returns IPRT status code. 262 * @param enmStdHandle The standard IPRT file handle. 263 * @param fOpen The flags the handle was opened with. Pass 0 to 264 * have these detected. 265 * @param fLeaveOpen Whether to leave the handle open when the VFS file 266 * is released, or to close it (@c false). 267 * @param phVfsIos Where to return the VFS I/O stream handle. 268 */ 269 RTDECL(int) RTVfsIoStrmFromStdHandle(RTHANDLESTD enmStdHandle, uint32_t fOpen, bool fLeaveOpen, 270 PRTVFSIOSTREAM phVfsIos); 271 272 /** 295 273 * Retains a reference to the VFS I/O stream handle. 296 274 * … … 316 294 * @sa RTVfsFileToIoStream 317 295 */ 318 RTDECL(RTVFSFILE) 296 RTDECL(RTVFSFILE) RTVfsIoStrmToFile(RTVFSIOSTREAM hVfsIos); 319 297 320 298 /** … … 327 305 * @sa RTFileQueryInfo 328 306 */ 329 RTDECL(int) 307 RTDECL(int) RTVfsIoStrmQueryInfo(RTVFSIOSTREAM hVfsIos, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAddAttr); 330 308 331 309 /** 332 310 * Read bytes from the I/O stream. 333 *334 * @returns IPRT status code.335 * @param hVfsIos The VFS I/O stream handle.336 * @param pvBuf Where to store the read bytes.337 * @param cbToRead The number of bytes to read.338 * @param pcbRead Where to always store the number of bytes actually339 * read. If this is NULL, the call will block until340 * @a cbToRead bytes are available. If this is341 * non-NULL, the call will not block and return what342 * is currently avaiable.343 * @sa RTFileRead, RTPipeRead, RTPipeReadBlocking, RTSocketRead344 */345 RTDECL(int) RTVfsIoStrmRead(RTVFSIOSTREAM hVfsIos, void *pvBuf, size_t cbToRead, size_t *pcbRead);346 347 /**348 * Write bytes to the I/O stream.349 *350 * @returns IPRT status code.351 * @param hVfsIos The VFS I/O stream handle.352 * @param pvBuf The bytes to write.353 * @param cbToWrite The number of bytes to write.354 * @param pcbWritten Where to always store the number of bytes actually355 * written. If this is NULL, the call will block356 * until357 * @a cbToWrite bytes are available. If this is358 * non-NULL, the call will not block and return after359 * writing what is possible.360 * @sa RTFileWrite, RTPipeWrite, RTPipeWriteBlocking, RTSocketWrite361 */362 RTDECL(int) RTVfsIoStrmWrite(RTVFSIOSTREAM hVfsIos, const void *pvBuf, size_t cbToWrite, size_t *pcbWritten);363 364 /**365 * Reads bytes from the I/O stream into a scatter buffer.366 311 * 367 312 * @returns IPRT status code. … … 380 325 * 381 326 * @param hVfsIos The VFS I/O stream handle. 327 * @param pvBuf Where to store the read bytes. 328 * @param cbToRead The number of bytes to read. 329 * @param fBlocking Whether the call is blocking (@c true) or not. If 330 * not, the @a pcbRead parameter must not be NULL. 331 * @param pcbRead Where to always store the number of bytes actually 332 * read. This can be NULL if @a fBlocking is true. 333 * @sa RTFileRead, RTPipeRead, RTPipeReadBlocking, RTSocketRead 334 */ 335 RTDECL(int) RTVfsIoStrmRead(RTVFSIOSTREAM hVfsIos, void *pvBuf, size_t cbToRead, bool fBlocking, size_t *pcbRead); 336 337 /** 338 * Write bytes to the I/O stream. 339 * 340 * @returns IPRT status code. 341 * @param hVfsIos The VFS I/O stream handle. 342 * @param pvBuf The bytes to write. 343 * @param cbToWrite The number of bytes to write. 344 * @param fBlocking Whether the call is blocking (@c true) or not. If 345 * not, the @a pcbWritten parameter must not be NULL. 346 * @param pcbRead Where to always store the number of bytes actually 347 * written. This can be NULL if @a fBlocking is true. 348 * @sa RTFileWrite, RTPipeWrite, RTPipeWriteBlocking, RTSocketWrite 349 */ 350 RTDECL(int) RTVfsIoStrmWrite(RTVFSIOSTREAM hVfsIos, const void *pvBuf, size_t cbToWrite, bool fBlocking, size_t *pcbWritten); 351 352 /** 353 * Reads bytes from the I/O stream into a scatter buffer. 354 * 355 * @returns IPRT status code. 356 * @retval VINF_SUCCESS and the number of bytes read written to @a pcbRead. 357 * @retval VINF_TRY_AGAIN if @a fBlocking is @c false, @a pcbRead is not NULL, 358 * and no data was available. @a *pcbRead will be set to 0. 359 * @retval VINF_EOF when trying to read __beyond__ the end of the stream and 360 * @a pcbRead is not NULL (it will be set to the number of bytes read, 361 * or 0 if the end of the stream was reached before this call). 362 * When the last byte of the read request is the last byte in the 363 * stream, this status code will not be used. However, VINF_EOF is 364 * returned when attempting to read 0 bytes while standing at the end 365 * of the stream. 366 * @retval VERR_EOF when trying to read __beyond__ the end of the stream and 367 * @a pcbRead is NULL. 368 * 369 * @param hVfsIos The VFS I/O stream handle. 382 370 * @param pSgBuf Pointer to a scatter buffer descriptor. The number 383 371 * of bytes described by the segments is what will be … … 550 538 RTDECL(int) RTVfsChainOpenIoStream( const char *pszSpec, uint32_t fOpen, PRTVFSIOSTREAM phVfsIos, const char **ppszError); 551 539 540 /** 541 * Tests if the given string is a chain specification or not. 542 * 543 * @returns true if it is, false if it isn't. 544 * @param pszSpec The alleged chain spec. 545 */ 546 RTDECL(bool) RTVfsChainIsSpec(const char *pszSpec); 547 552 548 /** @} */ 553 549
Note:
See TracChangeset
for help on using the changeset viewer.