aboutsummaryrefslogtreecommitdiffstats
path: root/src/entry.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/entry.c')
-rw-r--r--src/entry.c49
1 files changed, 28 insertions, 21 deletions
diff --git a/src/entry.c b/src/entry.c
index 2044813..441e858 100644
--- a/src/entry.c
+++ b/src/entry.c
@@ -1,40 +1,47 @@
#include "project.h"
-void entry_write(DISK *d,GPT_header *h,int n,GPT_entry *e)
+void
+entry_write (DISK * d, GPT_header * h, int n, GPT_entry * e)
{
-uint8_t buf[SECTOR_SIZE];
-uint64_t lba=GPT_ENTRY_LBA (h, n);
+ uint8_t buf[SECTOR_SIZE];
+ uint64_t lba = GPT_ENTRY_LBA (h, n);
-disk_read (d, buf, lba,1);
-memcpy(&buf[GPT_ENTRY_OFFSET(h,n)],e,sizeof(*e));
-disk_write (d, buf, lba, 1);
+ disk_read (d, buf, lba, 1);
+ memcpy (&buf[GPT_ENTRY_OFFSET (h, n)], e, sizeof (*e));
+ disk_write (d, buf, lba, 1);
}
-GPT_entry entry_read(DISK *d,GPT_header *h,int n)
+GPT_entry
+entry_read (DISK * d, GPT_header * h, int n)
{
-uint8_t buf[SECTOR_SIZE];
-GPT_entry e;
+ uint8_t buf[SECTOR_SIZE];
+ GPT_entry e;
-disk_read (d, buf, GPT_ENTRY_LBA (h, n), 1);
-memcpy(&e,&buf[GPT_ENTRY_OFFSET(h,n)],sizeof(e));
-return e;
+ disk_read (d, buf, GPT_ENTRY_LBA (h, n), 1);
+ memcpy (&e, &buf[GPT_ENTRY_OFFSET (h, n)], sizeof (e));
+ return e;
}
-int entry_empty(GPT_entry *e) {
-GUID empty=GUID_TYPE_EMPTY;
-return !guid_cmp(&e->type,&empty);
+int
+entry_empty (GPT_entry * e)
+{
+ GUID empty = GUID_TYPE_EMPTY;
+ return !guid_cmp (&e->type, &empty);
}
-void entry_show(GPT_entry *e)
+void
+entry_show (GPT_entry * e)
{
-char name[sizeof(e->name)+1];
+ char name[sizeof (e->name) + 1];
-utf16_to_ascii(e->name,sizeof(e->name),name,sizeof(name));
+ utf16_to_ascii (e->name, sizeof (e->name), name, sizeof (name));
-printf(" Name %s\n",name);
-printf(" Flags %16x Label %s\n",(int) e->flags,guid_to_a(e->label));
-printf(" Start %10lld End %10lld Type %s\n",(long long) e->start,(long long) e->end,guid_to_a(e->type));
+ printf (" Name %s\n", name);
+ printf (" Flags %16x Label %s\n", (int) e->flags,
+ guid_to_a (e->label));
+ printf (" Start %10lld End %10lld Type %s\n", (long long) e->start,
+ (long long) e->end, guid_to_a (e->type));
}