aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/dump.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/dump.c b/src/dump.c
new file mode 100644
index 0000000..fa9e02c
--- /dev/null
+++ b/src/dump.c
@@ -0,0 +1,28 @@
+#include "project.h"
+
+
+void dump_out(DISK *d)
+{
+ GPT_headers h;
+ int i;
+ char name[1024];
+
+ h = headers_get (d);
+
+ for (i = 0; i < h.header.n_partition_entries; ++i)
+ {
+ GPT_entry e = entry_read (d, &h.header, i);
+ if (!entry_empty (&e))
+ {
+
+ utf16_to_ascii (e.name, sizeof (e.name), name, sizeof (name));
+
+ printf("gpt -d ${DISK} -a %d \"%s\" \"%s\" %lld %lld\n",
+ i,name,guid_to_a_simple (e.type),e.start,e.end);
+
+ }
+ }
+
+
+}
+