mirror of
https://github.com/VARCem/MiniVHD.git
synced 2026-09-23 23:35:17 +00:00
Create geometry struct and change functions to use it
This commit is contained in:
@@ -19,6 +19,12 @@ typedef enum MVHDError {
|
||||
MVHD_ERR_SPARSE_CHECKSUM
|
||||
} MVHDError;
|
||||
|
||||
typedef struct MVHDGeom {
|
||||
uint16_t cyl;
|
||||
uint8_t heads;
|
||||
uint8_t spt;
|
||||
} MVHDGeom;
|
||||
|
||||
typedef struct MVHDMeta {
|
||||
FILE* f;
|
||||
char* filename;
|
||||
@@ -29,11 +35,11 @@ typedef struct MVHDMeta {
|
||||
} MVHDMeta;
|
||||
|
||||
MVHDMeta* mvhd_open(const char* path, int* err);
|
||||
MVHDMeta* mvhd_create_fixed(const char* path, int cyl, int heads, int spt, int* err);
|
||||
MVHDMeta* mvhd_create_sparse(const char* path, int cyl, int heads, int spt, int* err);
|
||||
MVHDMeta* mvhd_create_diff(const char* path, const char* par_path, int cyl, int heads, int spt, int* err);
|
||||
MVHDMeta* mvhd_create_fixed(const char* path, MVHDGeom geom, int* err);
|
||||
MVHDMeta* mvhd_create_sparse(const char* path, MVHDGeom geom, int* err);
|
||||
MVHDMeta* mvhd_create_diff(const char* path, const char* par_path, MVHDGeom geom, int* err);
|
||||
void mvhd_close(MVHDMeta* vhdm);
|
||||
void mvhd_calculate_geometry(int size_mb, int* new_size, int* cyl, int* heads, int* spt);
|
||||
MVHDGeom mvhd_calculate_geometry(int size_mb, int* new_size);
|
||||
int mvhd_read_sectors(MVHDMeta* vhdm, int offset, int num_sectors, void* out_buff);
|
||||
int mvhd_write_sectors(MVHDMeta* vhdm, int offset, int num_sectors, void* in_buff);
|
||||
int mvhd_format_sectors(MVHDMeta* vhdm, int offset, int num_sectors);
|
||||
|
||||
Reference in New Issue
Block a user