~ubuntu-branches/ubuntu/raring/virtualbox-ose/raring

« back to all changes in this revision

Viewing changes to include/iprt/fs.h

  • Committer: Bazaar Package Importer
  • Author(s): Felix Geyer
  • Date: 2011-01-30 23:27:25 UTC
  • mfrom: (0.3.12 upstream)
  • Revision ID: james.westby@ubuntu.com-20110130232725-2ouajjd2ggdet0zd
Tags: 4.0.2-dfsg-1ubuntu1
* Merge from Debian unstable, remaining changes:
  - Add Apport hook.
    - debian/virtualbox-ose.files/source_virtualbox-ose.py
    - debian/virtualbox-ose.install
  - Drop *-source packages.
* Drop ubuntu-01-fix-build-gcc45.patch, fixed upstream.
* Drop ubuntu-02-as-needed.patch, added to the Debian package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
 
42
42
/** @name Filesystem Object Mode Flags.
43
43
 *
44
 
 * There are two sets of flags: the unix mode flags and the dos
45
 
 * attributes.
 
44
 * There are two sets of flags: the unix mode flags and the dos attributes.
46
45
 *
47
46
 * APIs returning mode flags will provide both sets.
48
47
 *
49
 
 * When specifying mode flags to any API at least one of
50
 
 * them must be given. If one set is missing the API will
51
 
 * synthesize it from the one given if it requires it.
52
 
 *
53
 
 * Both sets match their x86 ABIs, the DOS/NT one is simply shifted
54
 
 * up 16 bits. The DOS/NT range is bits 16 to 31 inclusively. The
55
 
 * Unix range is bits 0 to 15 (inclusively).
 
48
 * When specifying mode flags to any API at least one of them must be given. If
 
49
 * one set is missing the API will synthesize it from the one given if it
 
50
 * requires it.
 
51
 *
 
52
 * Both sets match their x86 ABIs, the DOS/NT one is simply shifted up 16 bits.
 
53
 * The DOS/NT range is bits 16 to 31 inclusively. The Unix range is bits 0 to 15
 
54
 * (inclusively).
 
55
 *
 
56
 * @remarks These constants have been comitted to a binary format and must not
 
57
 *          be changed in any incompatible ways.
56
58
 *
57
59
 * @{
58
60
 */
262
264
{
263
265
    /** No additional information is available / requested. */
264
266
    RTFSOBJATTRADD_NOTHING = 1,
265
 
    /** The additional unix attributes (RTFSOBJATTR::u::Unix) are available / requested. */
 
267
    /** The additional unix attributes (RTFSOBJATTR::u::Unix) are available /
 
268
     *  requested. */
266
269
    RTFSOBJATTRADD_UNIX,
 
270
    /** The additional unix attributes (RTFSOBJATTR::u::UnixOwner) are
 
271
     * available / requested. */
 
272
    RTFSOBJATTRADD_UNIX_OWNER,
 
273
    /** The additional unix attributes (RTFSOBJATTR::u::UnixGroup) are
 
274
     * available / requested. */
 
275
    RTFSOBJATTRADD_UNIX_GROUP,
267
276
    /** The additional extended attribute size (RTFSOBJATTR::u::EASize) is available / requested. */
268
277
    RTFSOBJATTRADD_EASIZE,
269
278
    /** The last valid item (inclusive).
274
283
    RTFSOBJATTRADD_32BIT_SIZE_HACK = 0x7fffffff
275
284
} RTFSOBJATTRADD;
276
285
 
 
286
/** The number of bytes reserved for the additional attribute union. */
 
287
#define RTFSOBJATTRUNION_MAX_SIZE       128
 
288
 
 
289
/**
 
290
 * Additional Unix Attributes (RTFSOBJATTRADD_UNIX).
 
291
 */
 
292
typedef struct RTFSOBJATTRUNIX
 
293
{
 
294
    /** The user owning the filesystem object (st_uid).
 
295
     * This field is NIL_UID if not supported. */
 
296
    RTUID           uid;
 
297
 
 
298
    /** The group the filesystem object is assigned (st_gid).
 
299
     * This field is NIL_GID if not supported. */
 
300
    RTGID           gid;
 
301
 
 
302
    /** Number of hard links to this filesystem object (st_nlink).
 
303
     * This field is 1 if the filesystem doesn't support hardlinking or
 
304
     * the information isn't available.
 
305
     */
 
306
    uint32_t        cHardlinks;
 
307
 
 
308
    /** The device number of the device which this filesystem object resides on (st_dev).
 
309
     * This field is 0 if this information is not available. */
 
310
    RTDEV           INodeIdDevice;
 
311
 
 
312
    /** The unique identifier (within the filesystem) of this filesystem object (st_ino).
 
313
     * Together with INodeIdDevice, this field can be used as a OS wide unique id
 
314
     * when both their values are not 0.
 
315
     * This field is 0 if the information is not available. */
 
316
    RTINODE         INodeId;
 
317
 
 
318
    /** User flags (st_flags).
 
319
     * This field is 0 if this information is not available. */
 
320
    uint32_t        fFlags;
 
321
 
 
322
    /** The current generation number (st_gen).
 
323
     * This field is 0 if this information is not available. */
 
324
    uint32_t        GenerationId;
 
325
 
 
326
    /** The device number of a character or block device type object (st_rdev).
 
327
     * This field is 0 if the file isn't of a character or block device type and
 
328
     * when the OS doesn't subscribe to the major+minor device idenfication scheme. */
 
329
    RTDEV           Device;
 
330
} RTFSOBJATTRUNIX;
 
331
 
 
332
 
 
333
/**
 
334
 * Additional Unix Attributes (RTFSOBJATTRADD_UNIX_OWNER).
 
335
 *
 
336
 * @remarks This interface is mainly for TAR.
 
337
 */
 
338
typedef struct RTFSOBJATTRUNIXOWNER
 
339
{
 
340
    /** The user owning the filesystem object (st_uid).
 
341
     * This field is NIL_UID if not supported. */
 
342
    RTUID           uid;
 
343
    /** The user name.
 
344
     * Empty if not available or not supported, truncated if too long. */
 
345
    char            szName[RTFSOBJATTRUNION_MAX_SIZE - sizeof(RTUID)];
 
346
} RTFSOBJATTRUNIXOWNER;
 
347
 
 
348
 
 
349
/**
 
350
 * Additional Unix Attributes (RTFSOBJATTRADD_UNIX_GROUP).
 
351
 *
 
352
 * @remarks This interface is mainly for TAR.
 
353
 */
 
354
typedef struct RTFSOBJATTRUNIXGROUP
 
355
{
 
356
    /** The user owning the filesystem object (st_uid).
 
357
     * This field is NIL_GID if not supported. */
 
358
    RTGID           gid;
 
359
    /** The group name.
 
360
     * Empty if not available or not supported, truncated if too long. */
 
361
    char            szName[RTFSOBJATTRUNION_MAX_SIZE - sizeof(RTGID)];
 
362
} RTFSOBJATTRUNIXGROUP;
 
363
 
277
364
 
278
365
/**
279
366
 * Filesystem object attributes.
280
367
 */
281
 
#pragma pack(1)
282
368
typedef struct RTFSOBJATTR
283
369
{
284
370
    /** Mode flags (st_mode). RTFS_UNIX_*, RTFS_TYPE_*, and RTFS_DOS_*. */
295
381
     */
296
382
    union RTFSOBJATTRUNION
297
383
    {
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;
 
384
        /** Additional Unix Attributes - RTFSOBJATTRADD_UNIX. */
 
385
        RTFSOBJATTRUNIX         Unix;
 
386
        /** Additional Unix Owner Attributes - RTFSOBJATTRADD_UNIX_OWNER. */
 
387
        RTFSOBJATTRUNIXOWNER    UnixOwner;
 
388
        /** Additional Unix Group Attributes - RTFSOBJATTRADD_UNIX_GROUP. */
 
389
        RTFSOBJATTRUNIXGROUP    UnixGroup;
340
390
 
341
391
        /**
342
392
         * Extended attribute size is available when RTFS_DOS_HAVE_EA_SIZE is set.
346
396
            /** Size of EAs. */
347
397
            RTFOFF          cb;
348
398
        } EASize;
 
399
        /** Reserved space. */
 
400
        uint8_t         abReserveSpace[128];
349
401
    } u;
350
402
} RTFSOBJATTR;
351
 
#pragma pack()
352
403
/** Pointer to a filesystem object attributes structure. */
353
404
typedef RTFSOBJATTR *PRTFSOBJATTR;
354
405
/** Pointer to a const filesystem object attributes structure. */
360
411
 *
361
412
 * This is returned by the RTPathQueryInfo(), RTFileQueryInfo() and RTDirRead() APIs.
362
413
 */
363
 
#pragma pack(1)
364
414
typedef struct RTFSOBJINFO
365
415
{
366
416
   /** Logical size (st_size).
394
444
   RTFSOBJATTR  Attr;
395
445
 
396
446
} RTFSOBJINFO;
397
 
#pragma pack()
398
447
/** Pointer to a filesystem object information structure. */
399
448
typedef RTFSOBJINFO *PRTFSOBJINFO;
400
449
/** Pointer to a const filesystem object information structure. */
522
571
} RTFSPROPERTIES;
523
572
/** Pointer to a filesystem properties structure. */
524
573
typedef RTFSPROPERTIES *PRTFSPROPERTIES;
 
574
/** Pointer to a const filesystem properties structure. */
 
575
typedef RTFSPROPERTIES const *PCRTFSPROPERTIES;
525
576
 
526
577
#ifdef IN_RING3
527
578
 
562
613
 
563
614
RT_C_DECLS_END
564
615
 
565
 
#endif /* ___iprt_fs_h */
 
616
#endif /* !___iprt_fs_h */
566
617