| 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);
Incremparts reference counter for allocated types