Index: uspace/lib/gpt/libgpt.h
===================================================================
--- uspace/lib/gpt/libgpt.h	(revision 8c95dff74a31d0b98e3e8fb115185a07e64c2ac2)
+++ uspace/lib/gpt/libgpt.h	(revision 6453e30691421828634cd3f671e5840773c9ff46)
@@ -1,5 +1,5 @@
 /*
  * Copyright (c) 2009 Jiri Svoboda
- * Copyright (c) 2011, 2012, 2013 Dominik Taborsky
+ * Copyright (c) 2011-2013 Dominik Taborsky
  * All rights reserved.
  *
@@ -37,24 +37,57 @@
 #define LIBGPT_LIBGPT_H_
 
-#define LIBGPT_NAME	"libgpt"
-
 #include <loc.h>
 #include <sys/types.h>
-
 #include "gpt.h"
 
 /** Block address of GPT header. */
-#define GPT_HDR_BA	1
+#define GPT_HDR_BA  1
+
 /** Block size of GPT header. */
-#define GPT_HDR_BS	1
+#define GPT_HDR_BS  1
+
 /** Minimum number of GPT partition entries */
-#define GPT_MIN_PART_NUM 128
+#define GPT_MIN_PART_NUM  128
+
 /** Basic number of GPT partition entries */
-#define GPT_BASE_PART_NUM (GPT_MIN_PART_NUM)
+#define GPT_BASE_PART_NUM  (GPT_MIN_PART_NUM)
+
 /** How much fill we ignore before resizing partition array */
-#define GPT_IGNORE_FILL_NUM 10
+#define GPT_IGNORE_FILL_NUM  10
 
 /** Unused partition entry */
-#define GPT_PTE_UNUSED 0
+#define GPT_PTE_UNUSED  0
+
+/** Raw GPT header.
+ *
+ * Uses more bytes than sizeof(gpt_header_t).
+ */
+typedef struct {
+	gpt_header_t *header;
+} gpt_t;
+
+typedef gpt_entry_t gpt_part_t;
+
+typedef struct {
+	/** Number of entries */
+	size_t fill;
+	
+	/** Size of the array */
+	size_t arr_size;
+	
+	/** Resizable partition array */
+	gpt_part_t *part_array;
+} gpt_partitions_t;
+
+typedef struct {
+	gpt_t *gpt;
+	gpt_partitions_t *parts;
+	service_id_t device;
+} gpt_label_t;
+
+typedef struct {
+	const char *desc;
+	const char *guid;
+} partition_type_t;
 
 /** GPT header signature ("EFI PART" in ASCII) */
@@ -62,69 +95,41 @@
 extern const uint8_t revision[4];
 
-typedef struct {
-	/** Raw header. Has more bytes alloced than sizeof(gpt_header_t)!
-	 * See gpt_alloc_header() to know why. */
-	gpt_header_t *header;
-} gpt_t;
+extern const partition_type_t gpt_ptypes[];
 
-typedef gpt_entry_t gpt_part_t;
-
-typedef struct gpt_parts {
-	/** Number of entries */
-	size_t fill;
-	/** Size of the array */
-	size_t arr_size;
-	/** Resizable partition array */
-	gpt_entry_t *part_array;
-} gpt_partitions_t;
-
-
-typedef struct gpt_table {
-	gpt_t *gpt;
-	gpt_partitions_t *parts;
-	service_id_t device;
-} gpt_label_t;
-
-struct partition_type {
-	const char *desc;
-	const char *guid;
-};
-
-extern const struct partition_type gpt_ptypes[];
-
-extern gpt_label_t * gpt_alloc_label(void);
+extern gpt_label_t *gpt_alloc_label(void);
 extern void gpt_free_label(gpt_label_t *);
 
-extern gpt_t * gpt_alloc_header(size_t);
-extern int     gpt_read_header(gpt_label_t *, service_id_t);
-extern int     gpt_write_header(gpt_label_t *, service_id_t);
+extern gpt_t *gpt_alloc_header(size_t);
+extern int gpt_read_header(gpt_label_t *, service_id_t);
+extern int gpt_write_header(gpt_label_t *, service_id_t);
 
-extern gpt_partitions_t * gpt_alloc_partitions(void);
-extern int             gpt_read_partitions (gpt_label_t *);
-extern int             gpt_write_partitions(gpt_label_t *, service_id_t);
-extern gpt_part_t *    gpt_alloc_partition (void);
-extern gpt_part_t *    gpt_get_partition   (gpt_label_t *);
-extern gpt_part_t *    gpt_get_partition_at(gpt_label_t *, size_t);
-extern int             gpt_add_partition   (gpt_label_t *, gpt_part_t *);
-extern int             gpt_remove_partition(gpt_label_t *, size_t);
+extern gpt_partitions_t *gpt_alloc_partitions(void);
+extern int gpt_read_partitions(gpt_label_t *);
+extern int gpt_write_partitions(gpt_label_t *, service_id_t);
+extern gpt_part_t *gpt_alloc_partition(void);
+extern gpt_part_t *gpt_get_partition(gpt_label_t *);
+extern gpt_part_t *gpt_get_partition_at(gpt_label_t *, size_t);
+extern int gpt_add_partition(gpt_label_t *, gpt_part_t *);
+extern int gpt_remove_partition(gpt_label_t *, size_t);
 
-extern size_t          gpt_get_part_type(gpt_part_t *);
-extern void            gpt_set_part_type(gpt_part_t *, size_t);
-extern void            gpt_set_start_lba(gpt_part_t *, uint64_t);
-extern uint64_t        gpt_get_start_lba(gpt_part_t *);
-extern void            gpt_set_end_lba  (gpt_part_t *, uint64_t);
-extern uint64_t        gpt_get_end_lba  (gpt_part_t *);
-extern unsigned char * gpt_get_part_name(gpt_part_t *);
-extern void            gpt_set_part_name(gpt_part_t *, char *, size_t);
-extern bool            gpt_get_flag     (gpt_part_t *, GPT_ATTR);
-extern void            gpt_set_flag     (gpt_part_t *, GPT_ATTR, bool);
+extern size_t gpt_get_part_type(gpt_part_t *);
+extern void gpt_set_part_type(gpt_part_t *, size_t);
+extern void gpt_set_start_lba(gpt_part_t *, uint64_t);
+extern uint64_t gpt_get_start_lba(gpt_part_t *);
+extern void gpt_set_end_lba(gpt_part_t *, uint64_t);
+extern uint64_t gpt_get_end_lba(gpt_part_t *);
+extern unsigned char *gpt_get_part_name(gpt_part_t *);
+extern void gpt_set_part_name(gpt_part_t *, char *, size_t);
+extern bool gpt_get_flag(gpt_part_t *, gpt_attr_t);
+extern void gpt_set_flag(gpt_part_t *, gpt_attr_t, bool);
 
-extern void            gpt_set_random_uuid(uint8_t *);
-extern uint64_t        gpt_get_next_aligned(uint64_t, unsigned int);
+extern void gpt_set_random_uuid(uint8_t *);
+extern uint64_t gpt_get_next_aligned(uint64_t, unsigned int);
 
 
 #define gpt_part_foreach(label, iterator) \
-		for(gpt_part_t * iterator = (label)->parts->part_array; \
-		    iterator < (label)->parts->part_array + (label)->parts->arr_size; ++iterator)
+	for (gpt_part_t *iterator = (label)->parts->part_array; \
+	    iterator < (label)->parts->part_array + (label)->parts->arr_size; \
+	    iterator++)
 
 extern void gpt_free_gpt(gpt_t *);
@@ -132,3 +137,2 @@
 
 #endif
-
