summaryrefslogtreecommitdiffstats
path: root/partx/partx.h
diff options
context:
space:
mode:
authorKarel Zak2006-12-07 00:25:43 +0100
committerKarel Zak2006-12-07 00:25:43 +0100
commit22853e4a82c6ef7b336527529acb94b14a0b0fd8 (patch)
treeee28e4598c8c449d7e811711d8ce8eb17caecfb6 /partx/partx.h
parentImported from util-linux-2.10f tarball. (diff)
downloadkernel-qcow2-util-linux-22853e4a82c6ef7b336527529acb94b14a0b0fd8.tar.gz
kernel-qcow2-util-linux-22853e4a82c6ef7b336527529acb94b14a0b0fd8.tar.xz
kernel-qcow2-util-linux-22853e4a82c6ef7b336527529acb94b14a0b0fd8.zip
Imported from util-linux-2.10m tarball.
Diffstat (limited to 'partx/partx.h')
-rw-r--r--partx/partx.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/partx/partx.h b/partx/partx.h
new file mode 100644
index 000000000..b96588a59
--- /dev/null
+++ b/partx/partx.h
@@ -0,0 +1,26 @@
+/*
+ * For each partition type there is a routine that takes
+ * a block device and a range, and returns the list of
+ * slices found there in the supplied array SP that can
+ * hold NS entries. The return value is the number of
+ * entries stored, or -1 if the appropriate type is not
+ * present.
+ */
+
+
+/* units: 512 byte sectors */
+struct slice {
+ unsigned int start;
+ unsigned int size;
+};
+
+typedef int (ptreader)(int fd, struct slice all, struct slice *sp, int ns);
+
+extern ptreader read_dos_pt, read_bsd_pt, read_solaris_pt, read_unixware_pt;
+
+char *getblock(int fd, unsigned int secnr);
+
+static inline int
+four2int(unsigned char *p) {
+ return p[0] + (p[1]<<8) + (p[2]<<16) + (p[3]<<24);
+}