};
/**
- * fdisk_write_disklabel
+ * fdisk_write_disklabel:
* @cxt: fdisk context
*
* Write in-memory changes to disk
* fdisk_verify_disklabel:
* @cxt: fdisk context
*
- * Verifies the partition tabe.
+ * Verifies the partition table.
*
* Returns 0.
*/
/**
* fdisk_new_context:
- * @filename: path to the device to be handled
+ * @fname: path to the device to be handled
* @readonly: how to open the device
*
* If the @readonly flag is set to false, fdisk will attempt to open
* the device with read-write mode and will fallback to read-only if
* unsuccessful.
*
- * Returns: newly allocated fdisk context
+ * Returns: newly allocated fdisk context or NULL upon failure.
*/
struct fdisk_context *fdisk_new_context_from_filename(const char *fname, int readonly)
{
free(cxt);
}
-/*
+/**
* fdisk_get_nparttypes:
+ * @cxt: fdisk context
*
* Returns: number of partition types supported by the current label
*/
return cxt->label->nparttypes;
}
-/*
+/**
+ * fdisk_get_parttype_from_code:
+ * @cxt: fdisk context
+ * @code: code to search for
+ *
* Search in lable-specific table of supported partition types by code.
+ *
+ * Returns partition type or NULL upon failure or invalid @code.
*/
struct fdisk_parttype *fdisk_get_parttype_from_code(
struct fdisk_context *cxt,
return NULL;
}
-/*
+/**
+ * fdisk_get_parttype_from_string:
+ * @cxt: fdisk context
+ * @str: string to search for
+ *
* Search in lable-specific table of supported partition types by typestr.
+ *
+ * Returns partition type or NULL upon failure or invalid @str.
*/
struct fdisk_parttype *fdisk_get_parttype_from_string(
struct fdisk_context *cxt,
return NULL;
}
-/*
+/**
+ * fdisk_new_unknown_parttype:
+ * @type: type as number
+ * @typestr: type as string
+
* Allocates new 'unknown' partition type. Use fdisk_free_parttype() to
* deallocate.
+ *
+ * Returns newly allocated partition type, or NULL upon failure.
*/
struct fdisk_parttype *fdisk_new_unknown_parttype(unsigned int type,
const char *typestr)
return t;
}
-/*
- * fdisk_parse_parttype
+/**
+ * fdisk_parse_parttype:
* @cxt: fdisk context
- * @str: string
+ * @str: string to parse from
*
* Returns pointer to static table of the partition types, or newly allocated
* partition type for unknown types. It's safe to call fdisk_free_parttype()
return ret;
}
-/*
+/**
* fdisk_free_parttype:
+ * @t: new type
*
* Free the @type.
*/
* @cxt: fdisk context
* @partnum: partition number
*
- * Returns partition type
+ * Returns partition type or NULL upon failure.
*/
struct fdisk_parttype *fdisk_get_partition_type(struct fdisk_context *cxt, int partnum)
{
* @partnum: partition number
* @t: new type
*
- * Returns partition type
+ * Returns 0 on success, < 0 on error.
*/
int fdisk_set_partition_type(struct fdisk_context *cxt, int partnum,
struct fdisk_parttype *t)