Top |
struct fdisk_parttype * | fdisk_copy_parttype () |
struct fdisk_parttype * | fdisk_new_parttype () |
struct fdisk_parttype * | fdisk_new_unknown_parttype () |
unsigned int | fdisk_parttype_get_code () |
const char * | fdisk_parttype_get_name () |
const char * | fdisk_parttype_get_string () |
int | fdisk_parttype_is_unknown () |
int | fdisk_parttype_set_code () |
int | fdisk_parttype_set_name () |
int | fdisk_parttype_set_typestr () |
void | fdisk_ref_parttype () |
void | fdisk_unref_parttype () |
There are two basic types of parttypes, string based (e.g. GPT) and code/hex based (e.g. MBR).
struct fdisk_parttype *
fdisk_copy_parttype (const struct fdisk_parttype *type
);
Use fdisk_unref_parttype()
to deallocate.
struct fdisk_parttype *
fdisk_new_parttype (void
);
It's recommended to use fdisk_label_get_parttype_from_code()
or
fdisk_label_get_parttype_from_string()
for well known types rather
than allocate a new instance.
struct fdisk_parttype * fdisk_new_unknown_parttype (unsigned int code
,const char *typestr
);
Allocates new 'unknown' partition type. Use fdisk_unref_parttype()
to
deallocate.
const char *
fdisk_parttype_get_string (const struct fdisk_parttype *t
);
int
fdisk_parttype_is_unknown (const struct fdisk_parttype *t
);
Checks for example result from fdisk_label_parse_parttype()
.
int fdisk_parttype_set_code (struct fdisk_parttype *t
,int code
);
Sets type code to allocated partition type, for static types it returns
-EINVAL. Don't use this function for GPT, see fdisk_parttype_set_typestr()
.
Return: 0 on success, <0 on error
int fdisk_parttype_set_name (struct fdisk_parttype *t
,const char *str
);
Sets type name to allocated partition type, for static types it returns -EINVAL.
Return: 0 on success, <0 on error
int fdisk_parttype_set_typestr (struct fdisk_parttype *t
,const char *str
);
Sets type string to allocated partition type, for static types
it returns -EINVAL. Don't use this function for MBR, see
fdisk_parttype_set_code()
.
Return: 0 on success, <0 on error
void
fdisk_ref_parttype (struct fdisk_parttype *t
);
Increments reference counter for allocated types
parse hex or UUID from string |
||
try hex or UUID as the last possibility (don't use!) |
||
try input as type shortcut (e.g 'L' for linux partition) |
||
try input as type alias (e.g. 'linux' for linux partition) |
||
accept also deprecated aliases and shortcuts |
||
ignore unknown types |
||
use input as sequntial number of type (e.g. list-types fdisk dialog) |
||
recommended flags for new code |