summaryrefslogtreecommitdiffstats
path: root/libfdisk/src/libfdisk.h
diff options
context:
space:
mode:
authorKarel Zak2014-08-14 13:28:37 +0200
committerKarel Zak2014-08-14 13:28:37 +0200
commita745611d695016ede822380bce0aa92350fc80a3 (patch)
treefa3c4b47e1290a4224996fdfc6ea1a0a69b271d1 /libfdisk/src/libfdisk.h
parentlibfdisk: move get_parttypes to label API (diff)
downloadkernel-qcow2-util-linux-a745611d695016ede822380bce0aa92350fc80a3.tar.gz
kernel-qcow2-util-linux-a745611d695016ede822380bce0aa92350fc80a3.tar.xz
kernel-qcow2-util-linux-a745611d695016ede822380bce0aa92350fc80a3.zip
libfdisk: final parttype API cleanup
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libfdisk/src/libfdisk.h')
-rw-r--r--libfdisk/src/libfdisk.h36
1 files changed, 21 insertions, 15 deletions
diff --git a/libfdisk/src/libfdisk.h b/libfdisk/src/libfdisk.h
index cf65ddaee..c63060c14 100644
--- a/libfdisk/src/libfdisk.h
+++ b/libfdisk/src/libfdisk.h
@@ -121,16 +121,27 @@ sector_t fdisk_get_nsectors(struct fdisk_context *cxt);
const char *fdisk_get_devname(struct fdisk_context *cxt);
/* parttype.c */
-extern struct fdisk_parttype *fdisk_get_parttype_from_code(struct fdisk_context *cxt,
- unsigned int code);
-extern struct fdisk_parttype *fdisk_get_parttype_from_string(struct fdisk_context *cxt,
- const char *str);
-extern struct fdisk_parttype *fdisk_parse_parttype(struct fdisk_context *cxt, const char *str);
-
-extern struct fdisk_parttype *fdisk_new_unknown_parttype(unsigned int type, const char *typestr);
-extern void fdisk_free_parttype(struct fdisk_parttype *type);
-
-extern int fdisk_is_parttype_string(struct fdisk_context *cxt);
+const struct fdisk_parttype *fdisk_label_get_parttype(struct fdisk_label *lb, size_t n);
+size_t fdisk_label_get_nparttypes(struct fdisk_label *lb);
+
+int fdisk_label_has_code_parttypes(struct fdisk_label *lb);
+struct fdisk_parttype *fdisk_label_get_parttype_from_code(
+ struct fdisk_label *lb,
+ unsigned int code);
+
+struct fdisk_parttype *fdisk_label_get_parttype_from_string(
+ struct fdisk_label *lb,
+ const char *str);
+struct fdisk_parttype *fdisk_new_unknown_parttype(unsigned int code,
+ const char *typestr);
+struct fdisk_parttype *fdisk_label_parse_parttype(
+ struct fdisk_label *lb,
+ const char *str);
+void fdisk_free_parttype(struct fdisk_parttype *t);
+
+const char *fdisk_parttype_get_string(const struct fdisk_parttype *t);
+unsigned int fdisk_parttype_get_code(const struct fdisk_parttype *t);
+const char *fdisk_parttype_get_name(const struct fdisk_parttype *t);
/* label.c */
enum {
@@ -179,11 +190,6 @@ extern int fdisk_delete_partition(struct fdisk_context *cxt, size_t partnum);
extern int fdisk_set_partition_type(struct fdisk_context *cxt, size_t partnum,
struct fdisk_parttype *t);
-extern int fdisk_label_get_parttypes(struct fdisk_label *lb,
- struct fdisk_parttype **types,
- size_t *ntypes);
-extern int fdisk_label_is_parttype_string(struct fdisk_label *lb);
-
extern int fdisk_label_get_fields_ids(
struct fdisk_label *lb,
struct fdisk_context *cxt,