Changeset 34002 in vbox for trunk/include
- Timestamp:
- Nov 11, 2010 5:16:37 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 67667
- Location:
- trunk/include/iprt
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/err.h
r33945 r34002 1294 1294 /** The tar end of file record was read. */ 1295 1295 #define VERR_TAR_END_OF_FILE (-926) 1296 /** The tar file ended unexpectedly. */ 1297 #define VERR_TAR_UNEXPECTED_EOS (-927) 1296 1298 /** @} */ 1297 1299 -
trunk/include/iprt/fs.h
r33993 r34002 263 263 /** No additional information is available / requested. */ 264 264 RTFSOBJATTRADD_NOTHING = 1, 265 /** The additional unix attributes (RTFSOBJATTR::u::Unix) are available / requested. */ 265 /** The additional unix attributes (RTFSOBJATTR::u::Unix) are available / 266 * requested. */ 266 267 RTFSOBJATTRADD_UNIX, 268 /** The additional unix attributes (RTFSOBJATTR::u::UnixOwner) are 269 * available / requested. */ 270 RTFSOBJATTRADD_UNIX_OWNER, 271 /** The additional unix attributes (RTFSOBJATTR::u::UnixGroup) are 272 * available / requested. */ 273 RTFSOBJATTRADD_UNIX_GROUP, 267 274 /** The additional extended attribute size (RTFSOBJATTR::u::EASize) is available / requested. */ 268 275 RTFSOBJATTRADD_EASIZE, … … 275 282 } RTFSOBJATTRADD; 276 283 284 /** The number of bytes reserved for the additional attribute union. */ 285 #define RTFSOBJATTRUNION_MAX_SIZE 128 286 287 /** 288 * Additional Unix Attributes (RTFSOBJATTRADD_UNIX). 289 */ 290 typedef struct RTFSOBJATTRUNIX 291 { 292 /** The user owning the filesystem object (st_uid). 293 * This field is NIL_UID if not supported. */ 294 RTUID uid; 295 296 /** The group the filesystem object is assigned (st_gid). 297 * This field is NIL_GID if not supported. */ 298 RTGID gid; 299 300 /** Number of hard links to this filesystem object (st_nlink). 301 * This field is 1 if the filesystem doesn't support hardlinking or 302 * the information isn't available. 303 */ 304 uint32_t cHardlinks; 305 306 /** The device number of the device which this filesystem object resides on (st_dev). 307 * This field is 0 if this information is not available. */ 308 RTDEV INodeIdDevice; 309 310 /** The unique identifier (within the filesystem) of this filesystem object (st_ino). 311 * Together with INodeIdDevice, this field can be used as a OS wide unique id 312 * when both their values are not 0. 313 * This field is 0 if the information is not available. */ 314 RTINODE INodeId; 315 316 /** User flags (st_flags). 317 * This field is 0 if this information is not available. */ 318 uint32_t fFlags; 319 320 /** The current generation number (st_gen). 321 * This field is 0 if this information is not available. */ 322 uint32_t GenerationId; 323 324 /** The device number of a character or block device type object (st_rdev). 325 * This field is 0 if the file isn't of a character or block device type and 326 * when the OS doesn't subscribe to the major+minor device idenfication scheme. */ 327 RTDEV Device; 328 } RTFSOBJATTRUNIX; 329 330 331 /** 332 * Additional Unix Attributes (RTFSOBJATTRADD_UNIX_OWNER). 333 * 334 * @remarks This interface is mainly for TAR. 335 */ 336 typedef struct RTFSOBJATTRUNIXOWNER 337 { 338 /** The user owning the filesystem object (st_uid). 339 * This field is NIL_UID if not supported. */ 340 RTUID uid; 341 /** The user name. 342 * Empty if not available or not supported, truncated if too long. */ 343 char szName[RTFSOBJATTRUNION_MAX_SIZE - sizeof(RTUID)]; 344 } RTFSOBJATTRUNIXOWNER; 345 346 347 /** 348 * Additional Unix Attributes (RTFSOBJATTRADD_UNIX_GROUP). 349 * 350 * @remarks This interface is mainly for TAR. 351 */ 352 typedef struct RTFSOBJATTRUNIXGROUP 353 { 354 /** The user owning the filesystem object (st_uid). 355 * This field is NIL_GID if not supported. */ 356 RTGID gid; 357 /** The group name. 358 * Empty if not available or not supported, truncated if too long. */ 359 char szName[RTFSOBJATTRUNION_MAX_SIZE - sizeof(RTGID)]; 360 } RTFSOBJATTRUNIXGROUP; 361 277 362 278 363 /** 279 364 * Filesystem object attributes. 280 365 */ 281 #pragma pack(1)282 366 typedef struct RTFSOBJATTR 283 367 { … … 296 380 union RTFSOBJATTRUNION 297 381 { 298 /** Additional Unix Attributes 299 * These are available when RTFSOBJATTRADD is set in fUnix. 300 */ 301 struct RTFSOBJATTRUNIX 302 { 303 /** The user owning the filesystem object (st_uid). 304 * This field is ~0U if not supported. */ 305 RTUID uid; 306 307 /** The group the filesystem object is assigned (st_gid). 308 * This field is ~0U if not supported. */ 309 RTGID gid; 310 311 /** Number of hard links to this filesystem object (st_nlink). 312 * This field is 1 if the filesystem doesn't support hardlinking or 313 * the information isn't available. 314 */ 315 uint32_t cHardlinks; 316 317 /** The device number of the device which this filesystem object resides on (st_dev). 318 * This field is 0 if this information is not available. */ 319 RTDEV INodeIdDevice; 320 321 /** The unique identifier (within the filesystem) of this filesystem object (st_ino). 322 * Together with INodeIdDevice, this field can be used as a OS wide unique id 323 * when both their values are not 0. 324 * This field is 0 if the information is not available. */ 325 RTINODE INodeId; 326 327 /** User flags (st_flags). 328 * This field is 0 if this information is not available. */ 329 uint32_t fFlags; 330 331 /** The current generation number (st_gen). 332 * This field is 0 if this information is not available. */ 333 uint32_t GenerationId; 334 335 /** The device number of a character or block device type object (st_rdev). 336 * This field is 0 if the file isn't of a character or block device type and 337 * when the OS doesn't subscribe to the major+minor device idenfication scheme. */ 338 RTDEV Device; 339 } Unix; 382 /** Additional Unix Attributes - RTFSOBJATTRADD_UNIX. */ 383 RTFSOBJATTRUNIX Unix; 384 /** Additional Unix Owner Attributes - RTFSOBJATTRADD_UNIX_OWNER. */ 385 RTFSOBJATTRUNIXOWNER UnixOwner; 386 /** Additional Unix Group Attributes - RTFSOBJATTRADD_UNIX_GROUP. */ 387 RTFSOBJATTRUNIXGROUP UnixGroup; 340 388 341 389 /** … … 347 395 RTFOFF cb; 348 396 } EASize; 397 /** Reserved space. */ 398 uint8_t abReserveSpace[128]; 349 399 } u; 350 400 } RTFSOBJATTR; 351 #pragma pack()352 401 /** Pointer to a filesystem object attributes structure. */ 353 402 typedef RTFSOBJATTR *PRTFSOBJATTR; … … 361 410 * This is returned by the RTPathQueryInfo(), RTFileQueryInfo() and RTDirRead() APIs. 362 411 */ 363 #pragma pack(1)364 412 typedef struct RTFSOBJINFO 365 413 { … … 395 443 396 444 } RTFSOBJINFO; 397 #pragma pack()398 445 /** Pointer to a filesystem object information structure. */ 399 446 typedef RTFSOBJINFO *PRTFSOBJINFO; -
trunk/include/iprt/path.h
r33802 r34002 628 628 * 629 629 * @param pszPath Path to the file system object. 630 * @param pObjInfo Object information structure to be filled on successful return. 630 * @param pObjInfo Object information structure to be filled on successful 631 * return. 631 632 * @param enmAdditionalAttribs 632 633 * Which set of additional attributes to request. -
trunk/include/iprt/vfs.h
r33973 r34002 119 119 120 120 121 /** @defgroup grp_vfs_dir VFS DirectoryAPI121 /** @defgroup grp_vfs_dir VFS Base Object API 122 122 * @{ 123 123 */ 124 124 125 RTDECL(RTVFS) RTVfsObjToVfs(RTVFSOBJ hVfsObj); 126 RTDECL(RTVFSFSSTREAM) RTVfsObjToFsStream(RTVFSOBJ hVfsObj); 127 RTDECL(RTVFSDIR) RTVfsObjToDir(RTVFSOBJ hVfsObj); 128 RTDECL(RTVFSIOSTREAM) RTVfsObjToIoStream(RTVFSOBJ hVfsObj); 129 RTDECL(RTVFSFILE) RTVfsObjToFile(RTVFSOBJ hVfsObj); 130 RTDECL(RTVFSSYMLINK) RTVfsObjToSymlink(RTVFSOBJ hVfsObj); 131 132 RTDECL(RTVFSOBJ) RTVfsObjFromVfs(RTVFS hVfs); 133 RTDECL(RTVFSOBJ) RTVfsObjFromFsStream(RTVFSFSSTREAM hVfsFss); 134 RTDECL(RTVFSOBJ) RTVfsObjFromDir(RTVFSDIR hVfsDir); 135 RTDECL(RTVFSOBJ) RTVfsObjFromIoStream(RTVFSIOSTREAM hVfsIos); 136 RTDECL(RTVFSOBJ) RTVfsObjFromFile(RTVFSFILE hVfsFile); 137 RTDECL(RTVFSOBJ) RTVfsObjFromSymlink(RTVFSSYMLINK hVfsSym); 125 /** 126 * Retains a reference to the VFS base object handle. 127 * 128 * @returns New reference count on success, UINT32_MAX on failure. 129 * @param hVfsObj The VFS base object handle. 130 */ 131 RTDECL(uint32_t) RTVfsObjRetain(RTVFSOBJ hVfsObj); 132 133 /** 134 * Releases a reference to the VFS base handle. 135 * 136 * @returns New reference count on success (0 if closed), UINT32_MAX on failure. 137 * @param hVfsObj The VFS base object handle. 138 */ 139 RTDECL(uint32_t) RTVfsObjRelease(RTVFSOBJ hVfsObj); 138 140 139 141 /** … … 141 143 * 142 144 * @returns IPRT status code. 145 * @retval VERR_NOT_SUPPORTED if the @a enmAddAttr value is not handled by the 146 * implementation. 147 * 143 148 * @param hVfsObj The VFS object handle. 144 149 * @param pObjInfo Where to return the info. … … 146 151 * @sa RTFileQueryInfo, RTPathQueryInfo 147 152 */ 148 RTDECL(int) RTVfsObjQueryInfo(RTVFSOBJ hVfsObj, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAddAttr); 153 RTDECL(int) RTVfsObjQueryInfo(RTVFSOBJ hVfsObj, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAddAttr); 154 155 156 /** 157 * Converts a VFS base object handle to a VFS handle. 158 * 159 * @returns Referenced handle on success, NIL on failure. 160 * @param hVfsObj The VFS base object handle. 161 */ 162 RTDECL(RTVFS) RTVfsObjToVfs(RTVFSOBJ hVfsObj); 163 164 /** 165 * Converts a VFS base object handle to a VFS filesystem stream handle. 166 * 167 * @returns Referenced handle on success, NIL on failure. 168 * @param hVfsObj The VFS base object handle. 169 */ 170 RTDECL(RTVFSFSSTREAM) RTVfsObjToFsStream(RTVFSOBJ hVfsObj); 171 172 /** 173 * Converts a VFS base object handle to a VFS directory handle. 174 * 175 * @returns Referenced handle on success, NIL on failure. 176 * @param hVfsObj The VFS base object handle. 177 */ 178 RTDECL(RTVFSDIR) RTVfsObjToDir(RTVFSOBJ hVfsObj); 179 180 /** 181 * Converts a VFS base object handle to a VFS I/O stream handle. 182 * 183 * @returns Referenced handle on success, NIL on failure. 184 * @param hVfsObj The VFS base object handle. 185 */ 186 RTDECL(RTVFSIOSTREAM) RTVfsObjToIoStream(RTVFSOBJ hVfsObj); 187 188 /** 189 * Converts a VFS base object handle to a VFS file handle. 190 * 191 * @returns Referenced handle on success, NIL on failure. 192 * @param hVfsObj The VFS base object handle. 193 */ 194 RTDECL(RTVFSFILE) RTVfsObjToFile(RTVFSOBJ hVfsObj); 195 196 /** 197 * Converts a VFS base object handle to a VFS symbolic link handle. 198 * 199 * @returns Referenced handle on success, NIL on failure. 200 * @param hVfsObj The VFS base object handle. 201 */ 202 RTDECL(RTVFSSYMLINK) RTVfsObjToSymlink(RTVFSOBJ hVfsObj); 203 204 205 /** 206 * Converts a VFS handle to a VFS base object handle. 207 * 208 * @returns Referenced handle on success, NIL if the input handle was invalid. 209 * @param hVfs The VFS handle. 210 */ 211 RTDECL(RTVFSOBJ) RTVfsObjFromVfs(RTVFS hVfs); 212 213 /** 214 * Converts a VFS filesystem stream handle to a VFS base object handle. 215 * 216 * @returns Referenced handle on success, NIL if the input handle was invalid. 217 * @param hVfsFSs The VFS filesystem stream handle. 218 */ 219 RTDECL(RTVFSOBJ) RTVfsObjFromFsStream(RTVFSFSSTREAM hVfsFss); 220 221 /** 222 * Converts a VFS directory handle to a VFS base object handle. 223 * 224 * @returns Referenced handle on success, NIL if the input handle was invalid. 225 * @param hVfsDir The VFS directory handle. 226 */ 227 RTDECL(RTVFSOBJ) RTVfsObjFromDir(RTVFSDIR hVfsDir); 228 229 /** 230 * Converts a VFS I/O stream handle to a VFS base object handle. 231 * 232 * @returns Referenced handle on success, NIL if the input handle was invalid. 233 * @param hVfsIos The VFS I/O stream handle. 234 */ 235 RTDECL(RTVFSOBJ) RTVfsObjFromIoStream(RTVFSIOSTREAM hVfsIos); 236 237 /** 238 * Converts a VFS file handle to a VFS base object handle. 239 * 240 * @returns Referenced handle on success, NIL if the input handle was invalid. 241 * @param hVfsFile The VFS file handle. 242 */ 243 RTDECL(RTVFSOBJ) RTVfsObjFromFile(RTVFSFILE hVfsFile); 244 245 /** 246 * Converts a VFS symbolic link handle to a VFS base object handle. 247 * 248 * @returns Referenced handle on success, NIL if the input handle was invalid. 249 * @param hVfsSym The VFS symbolic link handle. 250 */ 251 RTDECL(RTVFSOBJ) RTVfsObjFromSymlink(RTVFSSYMLINK hVfsSym); 149 252 150 253 /** @} */ … … 182 285 * @retval VINF_SUCCESS if a new object was retrieved. 183 286 * @retval VERR_EOF when there are no more objects. 287 * 184 288 * @param pvThis The implementation specific directory data. 185 289 * @param ppszName Where to return the object name. Must be freed by … … 323 427 * @retval VERR_EOF when trying to read __beyond__ the end of the stream and 324 428 * @a pcbRead is NULL. 429 * @retval VERR_ACCESS_DENIED if the stream is not readable. 325 430 * 326 431 * @param hVfsIos The VFS I/O stream handle. … … 339 444 * 340 445 * @returns IPRT status code. 446 * @retval VERR_ACCESS_DENIED if the stream is not writable. 447 * 341 448 * @param hVfsIos The VFS I/O stream handle. 342 449 * @param pvBuf The bytes to write. … … 366 473 * @retval VERR_EOF when trying to read __beyond__ the end of the stream and 367 474 * @a pcbRead is NULL. 475 * @retval VERR_ACCESS_DENIED if the stream is not readable. 368 476 * 369 477 * @param hVfsIos The VFS I/O stream handle. … … 383 491 * 384 492 * @returns IPRT status code. 493 * @retval VERR_ACCESS_DENIED if the stream is not writable. 494 * 385 495 * @param hVfsIos The VFS I/O stream handle. 386 496 * @param pSgBuf Pointer to a gather buffer descriptor. The number -
trunk/include/iprt/vfslowlevel.h
r33973 r34002 125 125 * Get information about the file. 126 126 * 127 * @returns IPRT status code. 127 * @returns IPRT status code. See RTVfsObjQueryInfo. 128 128 * @param pvThis The implementation specific file data. 129 129 * @param pObjInfo Where to return the object info on success. 130 130 * @param enmAddAttr Which set of additional attributes to request. 131 * @sa RT FileQueryInfo131 * @sa RTVfsObjQueryInfo, RTFileQueryInfo, RTPathQueryInfo 132 132 */ 133 133 DECLCALLBACKMEMBER(int, pfnQueryInfo)(void *pvThis, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAddAttr); … … 234 234 * @param hVfsObj Where to return the object handle (referenced). 235 235 * This must be cast to the desired type before use. 236 * @sa RTVfsFsStrmNext 236 237 */ 237 238 DECLCALLBACKMEMBER(int, pfnNext)(void *pvThis, char **ppszName, RTVFSOBJTYPE *penmType, PRTVFSOBJ phVfsObj); … … 245 246 /** The RTVFSFSSTREAMOPS structure version. */ 246 247 #define RTVFSFSSTREAMOPS_VERSION RT_MAKE_U32_FROM_U8(0xff,0x3f,1,0) 248 249 250 /** 251 * Creates a new VFS filesystem stream handle. 252 * 253 * @returns IPRT status code 254 * @param pFsStreamOps The filesystem stream operations. 255 * @param cbInstance The size of the instance data. 256 * @param hVfs The VFS handle to associate this filesystem 257 * steram with. NIL_VFS is ok. 258 * @param hSemRW The read-write semaphore to use to protect the 259 * handle if this differs from the one the VFS 260 * uses. NIL_RTSEMRW is ok if no locking is 261 * desired. 262 * @param phVfsFss Where to return the new handle. 263 * @param ppvInstance Where to return the pointer to the instance data 264 * (size is @a cbInstance). 265 */ 266 RTDECL(int) RTVfsNewFsStream(PCRTVFSFSSTREAMOPS pFsStreamOps, size_t cbInstance, RTVFS hVfs, RTSEMRW hSemRW, 267 PRTVFSFSSTREAM phVfsFss, void **ppvInstance); 247 268 248 269 … … 553 574 * @param cbInstance The size of the instance data. 554 575 * @param fOpen The open flags. The minimum is the access mask. 555 * @param hVfs The VFS handle to associate this file with.556 * NIL_VFS is ok.576 * @param hVfs The VFS handle to associate this I/O stream 577 * with. NIL_VFS is ok. 557 578 * @param hSemRW The read-write semaphore to use to protect the 558 579 * handle if this differs from the one the VFS
Note:
See TracChangeset
for help on using the changeset viewer.