|
|
partition
Index
struct PartitionHandle * AddPartition(
struct PartitionHandle * root,
struct TagItem * taglist );
struct PartitionHandle * AddPartitionTags(
struct PartitionHandle * root,
TAG tag, ... );
root - PartitionHandle, where to add the new partition
taglist - tags that specify more information about the partition
unknown tags are ignored
PT_DOSENVEC - ptr to a DosEnvec
de_LowCyl and de_HighCyl specify start and end of cylinder
de_Reserved, de_Bootblocks, ...
de_Surfaces, de_BlocksPerTrack, ... are inherited from "root"
PT_TYPE - partition type (depends on PartitionTable type)
PT_POSITION - position number within the partition table (MBR->PC)
PT_ACTIVE - set this partition active (MBR->PC)
PT_NAME - set partition name (HD0, HD1, ...)
PartitionHandle of the new partition; 0 for an error
void ClosePartitionTable(
struct PartitionHandle * root );
close a partition table (and discard all changes)
all partitions and subpartitions in root->list will be removed recursivly
root - partition table to close
void CloseRootPartition(
struct PartitionHandle * ph );
close root handle allocated by OpenRootPartition()
ph - root handle created by OpenRootPartition()
LONG CreatePartitionTable(
struct PartitionHandle * root,
ULONG type );
Create a new partition table.
root - partition to create table in
type - the type of the partition table to create
0 on success; an error code otherwise
After calling this function the state of the PartitionHandle will be the
same as when calling OpenPartitionTable(). Therefore before closing the
PartitionHandle you should call ClosePartitionTable().
void DeletePartition(
struct PartitionHandle * ph );
Delete a partition with its subpartitions
ph - PartitionHandle to delete
LONG DestroyPartitionTable(
struct PartitionHandle * root );
Destroy a partition table by immediately overwriting table data on disk.
root - partition table to destroy
0 on success; an error code otherwise
After calling this function the state of the PartitionHandle will be the
same as before calling OpenPartitionTable(). Therefore do not reference
any child PartitionHandles any more.
LONG GetPartitionAttrs(
struct PartitionHandle * ph,
struct TagItem * taglist );
LONG GetPartitionAttrsTags(
struct PartitionHandle * ph,
TAG tag, ... );
get attributes of a partition
ph - PartitionHandle
taglist - list of attributes; unknown tags are ignored
PT_DOSENVEC - struct DosEnvec *; get DosEnvec values
PT_TYPE - struct PartitionType * ; get partition type (MBR-PC)
PT_POSITION - ULONG * ; position of partition (MBR-PC)
PT_ACTIVE - LONG * ; is partition active
PT_NAME - STRPTR ; get name of partition (max 31 Bytes + NULL-byte)
LONG GetPartitionTableAttrs(
struct PartitionHandle * root,
struct TagItem * taglist );
LONG GetPartitionTableAttrsTags(
struct PartitionHandle * root,
TAG tag, ... );
get attributes of a partition table
ph - PartitionHandle of the partition table
taglist - list of attributes; unknown tags are ignored
PTT_TYPE - ULONG * ; get partition table type
PTT_MAXLEADIN - LONG *
PTT_RESERVED - ULONG * ; get number of reserved blocks
LONG OpenPartitionTable(
struct PartitionHandle * root );
Open a partition table. On success root->list will be filled with a
list of PartitionHandles. If one partition contains more
subpartitions, the caller should call OpenPartitionTable() on the
PartitionHandle recursively.
0 for success; an error code otherwise.
struct PartitionHandle * OpenRootPartition(
CONST_STRPTR Device,
LONG Unit );
Create a root handle by opening a trackdisk-compatible device.
Device - name of the block device
Unit - unit of the block device
struct PartitionAttribute * QueryPartitionAttrs(
struct PartitionHandle * table );
query partition attributes
ph - PartitionHandle to the table
list of NULL-terminated ULONGs with attributes
struct PartitionAttribute * QueryPartitionTableAttrs(
struct PartitionHandle * table );
query partition table attributes
ph - PartitionHandle of a partition table
list of NULL-terminated ULONGs with attributes
LONG SetPartitionAttrs(
struct PartitionHandle * ph,
struct TagItem * taglist );
LONG SetPartitionAttrsTags(
struct PartitionHandle * ph,
TAG tag, ... );
set attributes of a partition
ph - PartitionHandle
taglist - list of attributes; unknown tags are ignored
PT_DOSENVEC - set new DosEnvec values
PT_TYPE - change partition type (MBR-PC)
PT_POSITION - move partition to another position (MBR-PC)
PT_ACTIVE - set partition active
PT_NAME - change name of partition (max 31 Bytes + NULL-byte)
LONG SetPartitionTableAttrs(
struct PartitionHandle * root,
struct TagItem * taglist );
LONG SetPartitionTableAttrsTags(
struct PartitionHandle * root,
TAG tag, ... );
set attributes of a partition table
ph - PartitionHandle of the partition table
taglist - list of attributes; unknown tags are ignored
LONG WritePartitionTable(
struct PartitionHandle * root );
Write a partition table; writing this partition table doesn't affect
subpartition tables
root - partition table to write
0 for success; an error code otherwise
|