summaryrefslogtreecommitdiffstats
path: root/common/partitions/parser.h
diff options
context:
space:
mode:
Diffstat (limited to 'common/partitions/parser.h')
-rw-r--r--common/partitions/parser.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/common/partitions/parser.h b/common/partitions/parser.h
new file mode 100644
index 0000000000..13506c00a0
--- /dev/null
+++ b/common/partitions/parser.h
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2013 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+ *
+ * Under GPLv2 only
+ */
+
+#ifndef __PARTITIONS_PARSER_H__
+#define __PARTITIONS_PARSER_H__
+
+#include <block.h>
+#include <filetype.h>
+#include <linux/list.h>
+
+#define MAX_PARTITION 8
+
+struct partition {
+ uint64_t first_sec;
+ uint64_t size;
+};
+
+struct partition_desc {
+ int used_entries;
+ struct partition parts[MAX_PARTITION];
+};
+
+struct partition_parser {
+ void (*parse)(void *buf, struct block_device *blk, struct partition_desc *pd);
+ enum filetype type;
+
+ struct list_head list;
+};
+
+int partition_parser_register(struct partition_parser *p);
+
+#endif /* __PARTITIONS_PARSER_H__ */