Index: uspace/lib/mbr/libmbr.c
===================================================================
--- uspace/lib/mbr/libmbr.c	(revision 5beb1ff28ca0095f6ff9e09ade3782654e79f764)
+++ uspace/lib/mbr/libmbr.c	(revision 271e24a4aca586ebdc97458d9836e0a3a3e1038c)
@@ -12,5 +12,5 @@
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
+ * - The LIBMBR_NAME of the author may not be used to endorse or promote products
  *   derived from this software without specific prior written permission.
  *
@@ -45,7 +45,7 @@
 
 static br_block_t * alloc_br(void);
-static int decode_part(pt_entry_t * src, part_t * trgt, uint32_t base);
-static int decode_logical(mbr_t * mbr, mbr_parts_t * p, part_t * ext);
-static void encode_part(part_t * src, pt_entry_t * trgt, uint32_t base);
+static int decode_part(pt_entry_t * src, mbr_part_t * trgt, uint32_t base);
+static int decode_logical(mbr_t * mbr, mbr_partitions_t * p, mbr_part_t * ext);
+static void encode_part(mbr_part_t * src, pt_entry_t * trgt, uint32_t base);
 
 /** Read MBR from specific device
@@ -123,10 +123,10 @@
  * @return 		linked list of partitions or NULL on error
  */
-mbr_parts_t * mbr_read_partitions(mbr_t * mbr)
+mbr_partitions_t * mbr_read_partitions(mbr_t * mbr)
 {
 	int rc, i;
-	part_t * p;
-	part_t * ext = NULL;
-	mbr_parts_t * parts;
+	mbr_part_t * p;
+	mbr_part_t * ext = NULL;
+	mbr_partitions_t * parts;
 
 	if (mbr == NULL)
@@ -143,7 +143,7 @@
 			continue;
 		
-		p = malloc(sizeof(part_t));
+		p = malloc(sizeof(mbr_part_t));
 		if (p == NULL) {
-			printf(NAME ": Error on memory allocation.\n");
+			printf(LIBMBR_NAME ": Error on memory allocation.\n");
 			free(p);
 			mbr_free_partitions(parts);
@@ -159,6 +159,6 @@
 	rc = decode_logical(mbr, parts, ext);
 	if (rc != EOK) {
-		printf(NAME ": Error occured during decoding the MBR.\n" \
-			   NAME ": Partition list may be incomplete.\n");
+		printf(LIBMBR_NAME ": Error occured during decoding the MBR.\n" \
+			   LIBMBR_NAME ": Partition list may be incomplete.\n");
 	}
 
@@ -173,12 +173,12 @@
  * @return				returns EOK on succes, specific error code otherwise
  */
-int mbr_write_partitions(mbr_parts_t * parts, mbr_t * mbr, service_id_t dev_handle)
+int mbr_write_partitions(mbr_partitions_t * parts, mbr_t * mbr, service_id_t dev_handle)
 {
 	bool logical = false;
 	int i = 0;
 	int rc;
-	part_t * p;
-	part_t * ext = (parts->l_extended == NULL) ? NULL
-					: list_get_instance(parts->l_extended, part_t, link);
+	mbr_part_t * p;
+	mbr_part_t * ext = (parts->l_extended == NULL) ? NULL
+					: list_get_instance(parts->l_extended, mbr_part_t, link);
 	
 	br_block_t * last_ebr = NULL;
@@ -194,8 +194,8 @@
 
 	aoff64_t addr = ext->start_addr;
-	part_t * prev_part = NULL;
+	mbr_part_t * prev_part = NULL;
 
 	list_foreach(parts->list, it) {
-		p = list_get_instance(it, part_t, link);
+		p = list_get_instance(it, mbr_part_t, link);
 		if (mbr_get_flag(p, ST_LOGIC)) {
 			// writing logical partition
@@ -269,5 +269,5 @@
 
 	list_foreach(parts->list, it) {
-		p = list_get_instance(it, part_t, link);
+		p = list_get_instance(it, mbr_part_t, link);
 		if (mbr_get_flag(p, ST_LOGIC)) {
 			// extended does not exist, fail
@@ -295,5 +295,5 @@
 			ext = p;
 
-		//p = list_get_instance(p->link.next, mbr_parts_t, link);
+		//p = list_get_instance(p->link.next, mbr_partitions_t, link);
 		p = p->next;
 	}
@@ -357,8 +357,8 @@
 }
 
-/** part_t constructor */
-part_t * mbr_alloc_partition(void)
-{
-	part_t * p = malloc(sizeof(part_t));
+/** mbr_part_t constructor */
+mbr_part_t * mbr_alloc_partition(void)
+{
+	mbr_part_t * p = malloc(sizeof(mbr_part_t));
 	if (p == NULL) {
 		return NULL;
@@ -374,7 +374,7 @@
 }
 
-mbr_parts_t * mbr_alloc_partitions(void)
-{
-	mbr_parts_t * parts = malloc(sizeof(mbr_parts_t));
+mbr_partitions_t * mbr_alloc_partitions(void)
+{
+	mbr_partitions_t * parts = malloc(sizeof(mbr_partitions_t));
 	if (parts == NULL) {
 		return NULL;
@@ -387,20 +387,23 @@
 
 /** Add partition */
-void mbr_add_partition(mbr_parts_t * parts, part_t * partition)
+int mbr_add_partition(mbr_partitions_t * parts, mbr_part_t * partition)
 {
 	list_append(&(partition->link), &(parts->list));
+	return EOK;
 }
 
 /** Remove partition */
-void mbr_remove_partition(mbr_parts_t * parts, int idx)
+int mbr_remove_partition(mbr_partitions_t * parts, size_t idx)
 {
 	link_t * l = list_nth(&(parts->list), idx);
 	list_remove(l);
-	part_t * p = list_get_instance(l, part_t, link);
+	mbr_part_t * p = list_get_instance(l, mbr_part_t, link);
 	mbr_free_partition(p);
-}
-
-/** part_t destructor */
-void mbr_free_partition(part_t * p)
+	
+	return EOK;
+}
+
+/** mbr_part_t destructor */
+void mbr_free_partition(mbr_part_t * p)
 {
 	if (p->ebr != NULL)
@@ -410,5 +413,5 @@
 
 /** Get flag bool value */
-int mbr_get_flag(part_t * p, MBR_FLAGS flag)
+int mbr_get_flag(mbr_part_t * p, MBR_FLAGS flag)
 {
 	return (p->status & (1 << flag)) ? 1 : 0;
@@ -416,5 +419,5 @@
 
 /** Set a specifig status flag to a value */
-void mbr_set_flag(part_t * p, MBR_FLAGS flag, bool value)
+void mbr_set_flag(mbr_part_t * p, MBR_FLAGS flag, bool value)
 {
 	uint8_t status = p->status;
@@ -438,8 +441,8 @@
  * @param parts		partition list to be freed
  */
-void mbr_free_partitions(mbr_parts_t * parts)
+void mbr_free_partitions(mbr_partitions_t * parts)
 {
 	list_foreach_safe(parts->list, cur_link, next) {
-		part_t * p = list_get_instance(cur_link, part_t, link);
+		mbr_part_t * p = list_get_instance(cur_link, mbr_part_t, link);
 		list_remove(cur_link);
 		mbr_free_partition(p);
@@ -462,6 +465,6 @@
 }
 
-/** Parse partition entry to part_t */
-static int decode_part(pt_entry_t * src, part_t * trgt, uint32_t base)
+/** Parse partition entry to mbr_part_t */
+static int decode_part(pt_entry_t * src, mbr_part_t * trgt, uint32_t base)
 {
 	trgt->type = src->ptype;
@@ -477,11 +480,11 @@
 }
 
-/** Parse MBR contents to part_t list
+/** Parse MBR contents to mbr_part_t list
  * parameter 'p' is allocated for only used primary partitions
  */
-static int decode_logical(mbr_t * mbr, mbr_parts_t * parts, part_t * ext)
+static int decode_logical(mbr_t * mbr, mbr_partitions_t * parts, mbr_part_t * ext)
 {
 	int rc;
-	part_t * p;
+	mbr_part_t * p;
 
 	if (mbr == NULL || parts == NULL)
@@ -534,6 +537,6 @@
 }
 
-/** Convert part_t to pt_entry_t */
-static void encode_part(part_t * src, pt_entry_t * trgt, uint32_t base)
+/** Convert mbr_part_t to pt_entry_t */
+static void encode_part(mbr_part_t * src, pt_entry_t * trgt, uint32_t base)
 {
 	if (src != NULL) {
