VirtualBox

Changeset 37559 in vbox for trunk/include/iprt


Ignore:
Timestamp:
Jun 20, 2011 2:48:03 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
72400
Message:

iprt/file.h: RTFile will be available in kernel mode as well.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/file.h

    r36573 r37559  
    3030#include <iprt/types.h>
    3131#include <iprt/stdarg.h>
    32 #ifdef IN_RING3
    33 # include <iprt/fs.h>
    34 #endif
     32#include <iprt/fs.h>
    3533
    3634RT_C_DECLS_BEGIN
     
    7068#endif
    7169
    72 
    73 #ifdef IN_RING3
    7470
    7571/**
     
    236232
    237233
     234#ifdef IN_RING3
    238235/**
    239236 * Force the use of open flags for all files opened after the setting is
     
    246243 */
    247244RTR3DECL(int)  RTFileSetForceFlags(unsigned fOpenForAccess, unsigned fSet, unsigned fMask);
     245#endif /* IN_RING3 */
    248246
    249247/**
     
    256254 *                          The ACCESS, ACTION and DENY flags are mandatory!
    257255 */
    258 RTR3DECL(int)  RTFileOpen(PRTFILE pFile, const char *pszFilename, uint32_t fOpen);
     256RTDECL(int)  RTFileOpen(PRTFILE pFile, const char *pszFilename, uint32_t fOpen);
    259257
    260258/**
     
    269267 * @param   ...             Arguments to the format string.
    270268 */
    271 RTR3DECL(int)  RTFileOpenF(PRTFILE pFile, uint32_t fOpen, const char *pszFilenameFmt, ...);
     269RTDECL(int)  RTFileOpenF(PRTFILE pFile, uint32_t fOpen, const char *pszFilenameFmt, ...);
    272270
    273271/**
     
    282280 * @param   va              Arguments to the format string.
    283281 */
    284 RTR3DECL(int)  RTFileOpenV(PRTFILE pFile, uint32_t fOpen, const char *pszFilenameFmt, va_list va);
     282RTDECL(int)  RTFileOpenV(PRTFILE pFile, uint32_t fOpen, const char *pszFilenameFmt, va_list va);
    285283
    286284/**
     
    291289 * @param   fAccess         The desired access only, i.e. read, write or both.
    292290 */
    293 RTR3DECL(int)  RTFileOpenBitBucket(PRTFILE phFile, uint32_t fAccess);
     291RTDECL(int)  RTFileOpenBitBucket(PRTFILE phFile, uint32_t fAccess);
    294292
    295293/**
     
    299297 * @param   File            The file handle to close.
    300298 */
    301 RTR3DECL(int)  RTFileClose(RTFILE File);
     299RTDECL(int)  RTFileClose(RTFILE File);
    302300
    303301/**
     
    308306 * @param   uNative         The native handle.
    309307 */
    310 RTR3DECL(int) RTFileFromNative(PRTFILE pFile, RTHCINTPTR uNative);
     308RTDECL(int) RTFileFromNative(PRTFILE pFile, RTHCINTPTR uNative);
    311309
    312310/**
     
    316314 * @param   File            The IPRT file handle.
    317315 */
    318 RTR3DECL(RTHCINTPTR) RTFileToNative(RTFILE File);
     316RTDECL(RTHCINTPTR) RTFileToNative(RTFILE File);
    319317
    320318/**
     
    325323 * @todo    This is a RTPath api!
    326324 */
    327 RTR3DECL(int)  RTFileDelete(const char *pszFilename);
     325RTDECL(int)  RTFileDelete(const char *pszFilename);
    328326
    329327/** @name Seek flags.
     
    352350 *                      NULL is allowed.
    353351 */
    354 RTR3DECL(int)  RTFileSeek(RTFILE File, int64_t offSeek, unsigned uMethod, uint64_t *poffActual);
     352RTDECL(int)  RTFileSeek(RTFILE File, int64_t offSeek, unsigned uMethod, uint64_t *poffActual);
    355353
    356354/**
     
    364362 *                      If NULL an error will be returned for a partial read.
    365363 */
    366 RTR3DECL(int)  RTFileRead(RTFILE File, void *pvBuf, size_t cbToRead, size_t *pcbRead);
     364RTDECL(int)  RTFileRead(RTFILE File, void *pvBuf, size_t cbToRead, size_t *pcbRead);
    367365
    368366/**
     
    378376 *                      If NULL an error will be returned for a partial read.
    379377 */
    380 RTR3DECL(int)  RTFileReadAt(RTFILE File, RTFOFF off, void *pvBuf, size_t cbToRead, size_t *pcbRead);
     378RTDECL(int)  RTFileReadAt(RTFILE File, RTFOFF off, void *pvBuf, size_t cbToRead, size_t *pcbRead);
    381379
    382380/**
     
    390388 *                      If NULL an error will be returned for a partial write.
    391389 */
    392 RTR3DECL(int)  RTFileWrite(RTFILE File, const void *pvBuf, size_t cbToWrite, size_t *pcbWritten);
     390RTDECL(int)  RTFileWrite(RTFILE File, const void *pvBuf, size_t cbToWrite, size_t *pcbWritten);
    393391
    394392/**
     
    404402 *                      If NULL an error will be returned for a partial write.
    405403 */
    406 RTR3DECL(int)  RTFileWriteAt(RTFILE File, RTFOFF off, const void *pvBuf, size_t cbToWrite, size_t *pcbWritten);
     404RTDECL(int)  RTFileWriteAt(RTFILE File, RTFOFF off, const void *pvBuf, size_t cbToWrite, size_t *pcbWritten);
    407405
    408406/**
     
    412410 * @param   File        Handle to the file.
    413411 */
    414 RTR3DECL(int)  RTFileFlush(RTFILE File);
     412RTDECL(int)  RTFileFlush(RTFILE File);
    415413
    416414/**
     
    421419 * @param   cbSize      The new file size.
    422420 */
    423 RTR3DECL(int)  RTFileSetSize(RTFILE File, uint64_t cbSize);
     421RTDECL(int)  RTFileSetSize(RTFILE File, uint64_t cbSize);
    424422
    425423/**
     
    430428 * @param   pcbSize     Where to store the filesize.
    431429 */
    432 RTR3DECL(int)  RTFileGetSize(RTFILE File, uint64_t *pcbSize);
     430RTDECL(int)  RTFileGetSize(RTFILE File, uint64_t *pcbSize);
    433431
    434432/**
     
    440438 * @see     RTFileGetMaxSizeEx.
    441439 */
    442 RTR3DECL(RTFOFF) RTFileGetMaxSize(RTFILE File);
     440RTDECL(RTFOFF) RTFileGetMaxSize(RTFILE File);
    443441
    444442/**
     
    450448 * @see     RTFileGetMaxSize.
    451449 */
    452 RTR3DECL(int) RTFileGetMaxSizeEx(RTFILE File, PRTFOFF pcbMax);
     450RTDECL(int) RTFileGetMaxSizeEx(RTFILE File, PRTFOFF pcbMax);
    453451
    454452/**
     
    459457 * @param   File        Handle to the file.
    460458 */
    461 RTR3DECL(RTFOFF) RTFileGetMaxSize(RTFILE File);
     459RTDECL(RTFOFF) RTFileGetMaxSize(RTFILE File);
    462460
    463461/**
     
    477475 * @param   File        The file handle
    478476 */
    479 RTR3DECL(bool) RTFileIsValid(RTFILE File);
     477RTDECL(bool) RTFileIsValid(RTFILE File);
    480478
    481479/**
     
    641639 * @param   cbLock      Length of region to lock, may overlap the end of file.
    642640 */
    643 RTR3DECL(int)  RTFileLock(RTFILE File, unsigned fLock, int64_t offLock, uint64_t cbLock);
     641RTDECL(int)  RTFileLock(RTFILE File, unsigned fLock, int64_t offLock, uint64_t cbLock);
    644642
    645643/**
     
    666664 * @param   cbLock      Length of region to lock, may overlap the end of file.
    667665 */
    668 RTR3DECL(int)  RTFileChangeLock(RTFILE File, unsigned fLock, int64_t offLock, uint64_t cbLock);
     666RTDECL(int)  RTFileChangeLock(RTFILE File, unsigned fLock, int64_t offLock, uint64_t cbLock);
    669667
    670668/**
     
    678676 * @param   cbLock      Length of region to unlock, may overlap the end of file.
    679677 */
    680 RTR3DECL(int)  RTFileUnlock(RTFILE File, int64_t offLock, uint64_t cbLock);
     678RTDECL(int)  RTFileUnlock(RTFILE File, int64_t offLock, uint64_t cbLock);
    681679
    682680
     
    691689 *                                  Use RTFSOBJATTRADD_NOTHING if this doesn't matter.
    692690 */
    693 RTR3DECL(int) RTFileQueryInfo(RTFILE File, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAdditionalAttribs);
     691RTDECL(int) RTFileQueryInfo(RTFILE File, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAdditionalAttribs);
    694692
    695693/**
     
    717715 * @remark  POSIX can only set Access & Modification and will always set both.
    718716 */
    719 RTR3DECL(int) RTFileSetTimes(RTFILE File, PCRTTIMESPEC pAccessTime, PCRTTIMESPEC pModificationTime,
    720                              PCRTTIMESPEC pChangeTime, PCRTTIMESPEC pBirthTime);
     717RTDECL(int) RTFileSetTimes(RTFILE File, PCRTTIMESPEC pAccessTime, PCRTTIMESPEC pModificationTime,
     718                           PCRTTIMESPEC pChangeTime, PCRTTIMESPEC pBirthTime);
    721719
    722720/**
     
    732730 * @remark  This is wrapper around RTFileQueryInfo() and exists to complement RTFileSetTimes().
    733731 */
    734 RTR3DECL(int) RTFileGetTimes(RTFILE File, PRTTIMESPEC pAccessTime, PRTTIMESPEC pModificationTime,
    735                              PRTTIMESPEC pChangeTime, PRTTIMESPEC pBirthTime);
     732RTDECL(int) RTFileGetTimes(RTFILE File, PRTTIMESPEC pAccessTime, PRTTIMESPEC pModificationTime,
     733                           PRTTIMESPEC pChangeTime, PRTTIMESPEC pBirthTime);
    736734
    737735/**
     
    745743 * @param   fMode       The new file mode, see @ref grp_rt_fs for details.
    746744 */
    747 RTR3DECL(int) RTFileSetMode(RTFILE File, RTFMODE fMode);
     745RTDECL(int) RTFileSetMode(RTFILE File, RTFMODE fMode);
    748746
    749747/**
     
    757755 *          and exists to complement RTFileSetMode().
    758756 */
    759 RTR3DECL(int) RTFileGetMode(RTFILE File, uint32_t *pfMode);
     757RTDECL(int) RTFileGetMode(RTFILE File, uint32_t *pfMode);
    760758
    761759/**
     
    769767 *                      unchanged.
    770768 */
    771 RTR3DECL(int) RTFileSetOwner(RTFILE File, uint32_t uid, uint32_t gid);
     769RTDECL(int) RTFileSetOwner(RTFILE File, uint32_t uid, uint32_t gid);
    772770
    773771/**
     
    781779 * @remark  This is wrapper around RTFileQueryInfo() and exists to complement RTFileGetOwner().
    782780 */
    783 RTR3DECL(int) RTFileGetOwner(RTFILE File, uint32_t *pUid, uint32_t *pGid);
     781RTDECL(int) RTFileGetOwner(RTFILE File, uint32_t *pUid, uint32_t *pGid);
    784782
    785783/**
     
    800798 * @param   piRet       Return value of the IOCTL request.
    801799 */
    802 RTR3DECL(int) RTFileIoCtl(RTFILE File, unsigned long ulRequest, void *pvData, unsigned cbData, int *piRet);
     800RTDECL(int) RTFileIoCtl(RTFILE File, unsigned long ulRequest, void *pvData, unsigned cbData, int *piRet);
    803801
    804802/**
     
    817815 * @sa      RTFsQuerySizes
    818816 */
    819 RTR3DECL(int) RTFileQueryFsSizes(RTFILE hFile, PRTFOFF pcbTotal, RTFOFF *pcbFree,
    820                                  uint32_t *pcbBlock, uint32_t *pcbSector);
     817RTDECL(int) RTFileQueryFsSizes(RTFILE hFile, PRTFOFF pcbTotal, RTFOFF *pcbFree,
     818                               uint32_t *pcbBlock, uint32_t *pcbSector);
    821819
    822820/**
     
    913911
    914912
     913#ifdef IN_RING3
     914
    915915/** @page pg_rt_asyncio RT File async I/O API
    916916 *
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette