]>
git.saurik.com Git - apple/hfs.git/blob - tests/disk-image.h
5 // Created by Chris Suter on 8/12/15.
13 #include <TargetConditionals.h>
16 * One 'shared' disk image is created for any test to use, if it wants.
17 * To use this disk image, call disk_image_get(). To create a 'not-shared'
18 * disk image for use just within your test, call disk_image_create().
20 * Callers of disk_image_create() and disk_image_get() should not free the pointer they receive,
21 * as it is freed automatically.
26 #define GB * (1024 * 1024 * 1024ULL)
27 #define TB * (1024 * 1024 * 1024 * 1024ULL)
29 #define SHARED_PATH "/tmp/shared.sparseimage"
30 #define SHARED_MOUNT "/tmp/mnt/shared"
32 typedef struct disk_image
{
33 const char *mount_point
;
38 typedef struct disk_image_opts
{
39 const char *partition_type
;
41 const char *mount_point
;
42 unsigned long long size
; // in bytes
45 disk_image_t
*disk_image_create(const char *path
, disk_image_opts_t
*opts
);
46 disk_image_t
*disk_image_get(void);
47 bool disk_image_cleanup(disk_image_t
*di
);
51 #endif /* disk_image_h_ */