VirtualBox

Changeset 33948 in vbox for trunk/include


Ignore:
Timestamp:
Nov 10, 2010 7:36:49 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
67609
Message:

vfs: more filesystem streaming code.

Location:
trunk/include/iprt
Files:
2 edited

Legend:

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

    r33945 r33948  
    105105/** A NIL VFS symbolic link handle. */
    106106#define NIL_RTVFSSYMLINK                ((RTVFSSYMLINK)~(uintptr_t)0)
     107
     108/**
     109 * The object type.
     110 */
     111typedef enum RTVFSOBJTYPE
     112{
     113    /** Invalid type. */
     114    RTVFSOBJTYPE_INVALID = 0,
     115    /** Pure base object.
     116     * This is returned by the filesystem stream to represent directories,
     117     * devices, fifos and similar that needs to be created. */
     118    RTVFSOBJTYPE_BASE,
     119    /** Virtual filesystem. */
     120    RTVFSOBJTYPE_VFS,
     121    /** Filesystem stream. */
     122    RTVFSOBJTYPE_FS_STREAM,
     123    /** Pure I/O stream. */
     124    RTVFSOBJTYPE_IO_STREAM,
     125    /** Directory. */
     126    RTVFSOBJTYPE_DIR,
     127    /** File. */
     128    RTVFSOBJTYPE_FILE,
     129    /** Symbolic link. */
     130    RTVFSOBJTYPE_SYMLINK,
     131    /** End of valid object types. */
     132    RTVFSOBJTYPE_END,
     133    /** Pure I/O stream. */
     134    RTVFSOBJTYPE_32BIT_HACK = 0x7fffffff
     135} RTVFSOBJTYPE;
     136/** Pointer to a VFS object type. */
     137typedef RTVFSOBJTYPE *PRTVFSOBJTYPE;
     138
     139
    107140
    108141
     
    153186RTDECL(RTVFSOBJ)        RTVfsObjFromSymlink(RTVFSSYMLINK hVfsSym);
    154187
     188/**
     189 * Query information about the object.
     190 *
     191 * @returns IPRT status code.
     192 * @param   hVfsObj         The VFS object handle.
     193 * @param   pObjInfo        Where to return the info.
     194 * @param   enmAddAttr      Which additional attributes should be retrieved.
     195 * @sa      RTFileQueryInfo, RTPathQueryInfo
     196 */
     197RTDECL(int)         RTVfsObjQueryInfo(RTVFSOBJ hVfsObj, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAddAttr);
     198
    155199/** @} */
     200
     201
     202/** @defgroup grp_vfs_fsstream      VFS Filesystem Stream API
     203 *
     204 * Filesystem streams are for tar, cpio and similar.  Any virtual filesystem can
     205 * be turned into a filesystem stream using RTVfsFsStrmFromVfs.
     206 *
     207 * @{
     208 */
     209
     210RTDECL(uint32_t)    RTVfsFsStrmRetain(RTVFSFSSTREAM hVfsFss);
     211RTDECL(uint32_t)    RTVfsFsStrmRelease(RTVFSFSSTREAM hVfsFss);
     212RTDECL(int)         RTVfsFsStrmQueryInfo(RTVFSFSSTREAM hVfsFss, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAddAttr);
     213
     214/**
     215 * Gets the next object in the stream.
     216 *
     217 * This call may affect the stream posision of a previously returned object.
     218 *
     219 * The type of object returned here typically boils down to three types:
     220 *      - I/O streams (representing files),
     221 *      - symbolic links
     222 *      - base object
     223 * The base objects represent anything not convered by the two other, i.e.
     224 * directories, device nodes, fifos, sockets and whatnot.  The details can be
     225 * queried using RTVfsObjQueryInfo.
     226 *
     227 * That said, absolutely any object except for filesystem stream objects can be
     228 * returned by this call.  Any generic code is adviced to just deal with it all.
     229 *
     230 * @returns IPRT status code.
     231 * @retval  VINF_SUCCESS if a new object was retrieved.
     232 * @retval  VERR_EOF when there are no more objects.
     233 * @param   pvThis      The implementation specific directory data.
     234 * @param   ppszName    Where to return the object name.  Must be freed by
     235 *                      calling RTStrFree.
     236 * @param   penmType    Where to return the object type.
     237 * @param   hVfsObj     Where to return the object handle (referenced).
     238 *                      This must be cast to the desired type before use.
     239 */
     240RTDECL(int)         RTVfsFsStrmNext(RTVFSFSSTREAM hVfsFss, char **ppszName, RTVFSOBJTYPE *penmType, PRTVFSOBJ phVfsObj);
     241
     242/** @}  */
    156243
    157244
     
    182269 * @{
    183270 */
     271
     272RTDECL(uint32_t)    RTVfsSymlinkRetain(RTVFSSYMLINK hVfsSym);
     273RTDECL(uint32_t)    RTVfsSymlinkRelease(RTVFSSYMLINK hVfsSym);
    184274
    185275/**
  • trunk/include/iprt/vfslowlevel.h

    r33945 r33948  
    100100#define RTVFSOPS_FEAT_ATTACH        RT_BIT_32(0)
    101101/** @}  */
    102 
    103 
    104 /**
    105  * The object type.
    106  */
    107 typedef enum RTVFSOBJTYPE
    108 {
    109     /** Invalid type. */
    110     RTVFSOBJTYPE_INVALID = 0,
    111     /** Pure base object.
    112      * This is returned by the filesystem stream to represent directories,
    113      * devices, fifos and similar that needs to be created. */
    114     RTVFSOBJTYPE_BASE,
    115     /** Virtual filesystem. */
    116     RTVFSOBJTYPE_VFS,
    117     /** Filesystem stream. */
    118     RTVFSOBJTYPE_FS_STREAM,
    119     /** Pure I/O stream. */
    120     RTVFSOBJTYPE_IO_STREAM,
    121     /** Directory. */
    122     RTVFSOBJTYPE_DIR,
    123     /** File. */
    124     RTVFSOBJTYPE_FILE,
    125     /** Symbolic link. */
    126     RTVFSOBJTYPE_SYMLINK,
    127     /** End of valid object types. */
    128     RTVFSOBJTYPE_END,
    129     /** Pure I/O stream. */
    130     RTVFSOBJTYPE_32BIT_HACK = 0x7fffffff
    131 } RTVFSOBJTYPE;
    132 /** Pointer to a VFS object type. */
    133 typedef RTVFSOBJTYPE *PRTVFSOBJTYPE;
    134102
    135103
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