diff options
author | 2016-01-29 14:54:38 +0000 | |
---|---|---|
committer | 2016-01-29 14:54:38 +0000 | |
commit | 356b92ce1b0ec4c63bb431fc7e8a16e4af5126d8 (patch) | |
tree | 46f165aa995532e1e343d791dd04dddc1399a7ce | |
parent | Rename struct partition_map to struct entry. No change to .o files. (diff) | |
download | wireguard-openbsd-356b92ce1b0ec4c63bb431fc7e8a16e4af5126d8.tar.xz wireguard-openbsd-356b92ce1b0ec4c63bb431fc7e8a16e4af5126d8.zip |
Rename struct partition_map_header to struct partition_map. No change to
.o files.
-rw-r--r-- | sbin/pdisk/dump.c | 28 | ||||
-rw-r--r-- | sbin/pdisk/dump.h | 10 | ||||
-rw-r--r-- | sbin/pdisk/partition_map.c | 54 | ||||
-rw-r--r-- | sbin/pdisk/partition_map.h | 30 | ||||
-rw-r--r-- | sbin/pdisk/pdisk.c | 62 |
5 files changed, 92 insertions, 92 deletions
diff --git a/sbin/pdisk/dump.c b/sbin/pdisk/dump.c index 1292068f4c7..94d2566345f 100644 --- a/sbin/pdisk/dump.c +++ b/sbin/pdisk/dump.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dump.c,v 1.63 2016/01/29 14:48:20 krw Exp $ */ +/* $OpenBSD: dump.c,v 1.64 2016/01/29 14:54:38 krw Exp $ */ /* * dump.c - dumping partition maps @@ -39,14 +39,14 @@ #include "io.h" void adjust_value_and_compute_prefix(double *, int *); -void dump_block_zero(struct partition_map_header *); +void dump_block_zero(struct partition_map *); void dump_partition_entry(struct entry *, int, int, int); -int get_max_base_or_length(struct partition_map_header *); -int get_max_name_string_length(struct partition_map_header *); -int get_max_type_string_length(struct partition_map_header *); +int get_max_base_or_length(struct partition_map *); +int get_max_name_string_length(struct partition_map *); +int get_max_type_string_length(struct partition_map *); void -dump_block_zero(struct partition_map_header *map) +dump_block_zero(struct partition_map *map) { struct block0 *p; struct ddmap *m; @@ -75,7 +75,7 @@ dump_block_zero(struct partition_map_header *map) void -dump_partition_map(struct partition_map_header *map) +dump_partition_map(struct partition_map *map) { struct entry *entry; int digits, max_type_length, max_name_length; @@ -107,7 +107,7 @@ void dump_partition_entry(struct entry *entry, int type_length, int name_length, int digits) { - struct partition_map_header *map; + struct partition_map *map; struct dpme *p; double bytes; int j, driver; @@ -144,7 +144,7 @@ dump_partition_entry(struct entry *entry, int type_length, void -show_data_structures(struct partition_map_header *map) +show_data_structures(struct partition_map *map) { struct entry *entry; struct block0 *zp; @@ -222,7 +222,7 @@ show_data_structures(struct partition_map_header *map) void -full_dump_partition_entry(struct partition_map_header *map, int ix) +full_dump_partition_entry(struct partition_map *map, int ix) { struct entry *cur; struct dpme *p; @@ -323,7 +323,7 @@ dump_block(unsigned char *addr, int len) } void -full_dump_block_zero(struct partition_map_header *map) +full_dump_block_zero(struct partition_map *map) { struct block0 *zp; struct ddmap *m; @@ -355,7 +355,7 @@ full_dump_block_zero(struct partition_map_header *map) } int -get_max_type_string_length(struct partition_map_header *map) +get_max_type_string_length(struct partition_map *map) { struct entry *entry; int max, length; @@ -372,7 +372,7 @@ get_max_type_string_length(struct partition_map_header *map) } int -get_max_name_string_length(struct partition_map_header *map) +get_max_name_string_length(struct partition_map *map) { struct entry *entry; int max, length; @@ -389,7 +389,7 @@ get_max_name_string_length(struct partition_map_header *map) } int -get_max_base_or_length(struct partition_map_header *map) +get_max_base_or_length(struct partition_map *map) { struct entry *entry; int max; diff --git a/sbin/pdisk/dump.h b/sbin/pdisk/dump.h index b770f3ebc98..e6bc7bfcf6a 100644 --- a/sbin/pdisk/dump.h +++ b/sbin/pdisk/dump.h @@ -1,4 +1,4 @@ -/* $OpenBSD: dump.h,v 1.15 2016/01/24 01:38:32 krw Exp $ */ +/* $OpenBSD: dump.h,v 1.16 2016/01/29 14:54:38 krw Exp $ */ /* * dump.h - dumping partition maps @@ -31,9 +31,9 @@ #define __dump__ void dump_block(unsigned char *, int); -void dump_partition_map(struct partition_map_header *); -void full_dump_partition_entry(struct partition_map_header *, int); -void full_dump_block_zero(struct partition_map_header *); -void show_data_structures(struct partition_map_header *); +void dump_partition_map(struct partition_map *); +void full_dump_partition_entry(struct partition_map *, int); +void full_dump_block_zero(struct partition_map *); +void show_data_structures(struct partition_map *); #endif /* __dump__ */ diff --git a/sbin/pdisk/partition_map.c b/sbin/pdisk/partition_map.c index a167e49c08b..7c85057c260 100644 --- a/sbin/pdisk/partition_map.c +++ b/sbin/pdisk/partition_map.c @@ -1,4 +1,4 @@ -/* $OpenBSD: partition_map.c,v 1.83 2016/01/29 14:48:20 krw Exp $ */ +/* $OpenBSD: partition_map.c,v 1.84 2016/01/29 14:54:38 krw Exp $ */ /* * partition_map.c - partition map routines @@ -54,25 +54,25 @@ enum add_action { }; int add_data_to_map(struct dpme *, long, - struct partition_map_header *); -int coerce_block0(struct partition_map_header *); + struct partition_map *); +int coerce_block0(struct partition_map *); int contains_driver(struct entry *); void combine_entry(struct entry *); struct dpme *create_dpme(const char *, const char *, uint32_t, uint32_t); void delete_entry(struct entry *); void insert_in_base_order(struct entry *); void insert_in_disk_order(struct entry *); -int read_partition_map(struct partition_map_header *); +int read_partition_map(struct partition_map *); void remove_driver(struct entry *); -void renumber_disk_addresses(struct partition_map_header *); +void renumber_disk_addresses(struct partition_map *); -struct partition_map_header * +struct partition_map * open_partition_map(int fd, char *name, uint64_t mediasz, uint32_t sectorsz) { - struct partition_map_header *map; + struct partition_map *map; int ok; - map = malloc(sizeof(struct partition_map_header)); + map = malloc(sizeof(struct partition_map)); if (map == NULL) { warn("can't allocate memory for open partition map"); return NULL; @@ -142,7 +142,7 @@ open_partition_map(int fd, char *name, uint64_t mediasz, uint32_t sectorsz) void -free_partition_map(struct partition_map_header *map) +free_partition_map(struct partition_map *map) { struct entry *entry; @@ -159,7 +159,7 @@ free_partition_map(struct partition_map_header *map) } int -read_partition_map(struct partition_map_header *map) +read_partition_map(struct partition_map *map) { struct entry *cur, *nextcur; struct dpme *dpme; @@ -241,7 +241,7 @@ read_partition_map(struct partition_map_header *map) void -write_partition_map(struct partition_map_header *map) +write_partition_map(struct partition_map *map) { struct entry *entry; int result; @@ -259,7 +259,7 @@ write_partition_map(struct partition_map_header *map) int -add_data_to_map(struct dpme *dpme, long ix, struct partition_map_header *map) +add_data_to_map(struct dpme *dpme, long ix, struct partition_map *map) { struct entry *entry; @@ -284,13 +284,13 @@ add_data_to_map(struct dpme *dpme, long ix, struct partition_map_header *map) return 1; } -struct partition_map_header * +struct partition_map * create_partition_map(int fd, char *name, u_int64_t mediasz, uint32_t sectorsz) { - struct partition_map_header *map; + struct partition_map *map; struct dpme *dpme; - map = malloc(sizeof(struct partition_map_header)); + map = malloc(sizeof(struct partition_map)); if (map == NULL) { warn("can't allocate memory for open partition map"); return NULL; @@ -341,7 +341,7 @@ create_partition_map(int fd, char *name, u_int64_t mediasz, uint32_t sectorsz) int -coerce_block0(struct partition_map_header *map) +coerce_block0(struct partition_map *map) { struct block0 *p; @@ -361,7 +361,7 @@ coerce_block0(struct partition_map_header *map) int add_partition_to_map(const char *name, const char *dptype, uint32_t base, - uint32_t length, struct partition_map_header *map) + uint32_t length, struct partition_map *map) { struct entry *cur; struct dpme *dpme; @@ -494,7 +494,7 @@ dpme_init_flags(struct dpme *dpme) } void -renumber_disk_addresses(struct partition_map_header *map) +renumber_disk_addresses(struct partition_map *map) { struct entry *cur; long ix; @@ -544,7 +544,7 @@ delete_partition_from_map(struct entry *entry) int contains_driver(struct entry *entry) { - struct partition_map_header *map; + struct partition_map *map; struct block0 *p; struct ddmap *m; int i; @@ -647,7 +647,7 @@ combine_entry(struct entry *entry) void delete_entry(struct entry *entry) { - struct partition_map_header *map; + struct partition_map *map; map = entry->the_map; map->blocks_in_map--; @@ -661,7 +661,7 @@ delete_entry(struct entry *entry) struct entry * -find_entry_by_disk_address(long ix, struct partition_map_header *map) +find_entry_by_disk_address(long ix, struct partition_map *map) { struct entry *cur; @@ -674,7 +674,7 @@ find_entry_by_disk_address(long ix, struct partition_map_header *map) struct entry * -find_entry_by_type(const char *type_name, struct partition_map_header *map) +find_entry_by_type(const char *type_name, struct partition_map *map) { struct entry *cur; @@ -687,7 +687,7 @@ find_entry_by_type(const char *type_name, struct partition_map_header *map) } struct entry * -find_entry_by_base(uint32_t base, struct partition_map_header *map) +find_entry_by_base(uint32_t base, struct partition_map *map) { struct entry *cur; @@ -700,7 +700,7 @@ find_entry_by_base(uint32_t base, struct partition_map_header *map) void -move_entry_in_map(long index1, long index2, struct partition_map_header *map) +move_entry_in_map(long index1, long index2, struct partition_map *map) { struct entry *p1, *p2; @@ -739,7 +739,7 @@ move_entry_in_map(long index1, long index2, struct partition_map_header *map) void insert_in_disk_order(struct entry *entry) { - struct partition_map_header *map; + struct partition_map *map; struct entry *cur; /* find position in disk list & insert */ @@ -765,7 +765,7 @@ insert_in_disk_order(struct entry *entry) void insert_in_base_order(struct entry *entry) { - struct partition_map_header *map; + struct partition_map *map; struct entry *cur; uint32_t start; @@ -791,7 +791,7 @@ insert_in_base_order(struct entry *entry) void -resize_map(long new_size, struct partition_map_header *map) +resize_map(long new_size, struct partition_map *map) { struct entry *entry; struct entry *next; diff --git a/sbin/pdisk/partition_map.h b/sbin/pdisk/partition_map.h index 471bbe8394e..6e2803a1bf8 100644 --- a/sbin/pdisk/partition_map.h +++ b/sbin/pdisk/partition_map.h @@ -1,4 +1,4 @@ -/* $OpenBSD: partition_map.h,v 1.33 2016/01/29 14:48:20 krw Exp $ */ +/* $OpenBSD: partition_map.h,v 1.34 2016/01/29 14:54:38 krw Exp $ */ /* * partition_map.h - partition map routines @@ -32,7 +32,7 @@ struct entry; -struct partition_map_header { +struct partition_map { LIST_HEAD(, entry) disk_order; LIST_HEAD(, entry) base_order; char *name; @@ -48,7 +48,7 @@ struct partition_map_header { struct entry { LIST_ENTRY(entry) disk_entry; LIST_ENTRY(entry) base_entry; - struct partition_map_header *the_map; + struct partition_map *the_map; struct dpme *dpme; long disk_address; int contains_driver; @@ -65,27 +65,27 @@ extern int dflag; extern int lflag; extern int rflag; -struct partition_map_header *init_partition_map(char *); -struct partition_map_header *create_partition_map(int, char *, uint64_t, +struct partition_map *init_partition_map(char *); +struct partition_map *create_partition_map(int, char *, uint64_t, uint32_t); -struct partition_map_header *open_partition_map(int, char *, uint64_t, +struct partition_map *open_partition_map(int, char *, uint64_t, uint32_t); struct entry *find_entry_by_disk_address(long, - struct partition_map_header *); + struct partition_map *); struct entry *find_entry_by_type(const char *, - struct partition_map_header *); + struct partition_map *); struct entry *find_entry_by_base(uint32_t, - struct partition_map_header *); + struct partition_map *); int add_partition_to_map(const char *, const char *, uint32_t, uint32_t, - struct partition_map_header *); -void free_partition_map(struct partition_map_header *); + struct partition_map *); +void free_partition_map(struct partition_map *); void delete_partition_from_map(struct entry *); -void move_entry_in_map(long, long, struct partition_map_header *); -void resize_map(long new_size, struct partition_map_header *); -void write_partition_map(struct partition_map_header *); +void move_entry_in_map(long, long, struct partition_map *); +void resize_map(long new_size, struct partition_map *); +void write_partition_map(struct partition_map *); void dpme_init_flags(struct dpme *); -void sync_device_size(struct partition_map_header *); +void sync_device_size(struct partition_map *); #endif /* __partition_map__ */ diff --git a/sbin/pdisk/pdisk.c b/sbin/pdisk/pdisk.c index 07fd7bdbae7..c8b1c7da410 100644 --- a/sbin/pdisk/pdisk.c +++ b/sbin/pdisk/pdisk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pdisk.c,v 1.78 2016/01/28 19:07:45 krw Exp $ */ +/* $OpenBSD: pdisk.c,v 1.79 2016/01/29 14:54:38 krw Exp $ */ /* * pdisk - an editor for Apple format partition tables @@ -54,17 +54,17 @@ int rflag; /* open device read Only */ static int first_get = 1; -void do_change_map_size(struct partition_map_header *); -void do_create_partition(struct partition_map_header *, int); -void do_delete_partition(struct partition_map_header *); -void do_display_entry(struct partition_map_header *); -void do_rename_partition(struct partition_map_header *); -void do_change_type(struct partition_map_header *); -void do_reorder(struct partition_map_header *); -void do_write_partition_map(struct partition_map_header *); -void edit(struct partition_map_header **); -int get_base_argument(long *, struct partition_map_header *); -int get_size_argument(long *, struct partition_map_header *); +void do_change_map_size(struct partition_map *); +void do_create_partition(struct partition_map *, int); +void do_delete_partition(struct partition_map *); +void do_display_entry(struct partition_map *); +void do_rename_partition(struct partition_map *); +void do_change_type(struct partition_map *); +void do_reorder(struct partition_map *); +void do_write_partition_map(struct partition_map *); +void edit(struct partition_map **); +int get_base_argument(long *, struct partition_map *); +int get_size_argument(long *, struct partition_map *); __dead static void usage(void); @@ -73,7 +73,7 @@ main(int argc, char **argv) { struct disklabel dl; struct stat st; - struct partition_map_header *map; + struct partition_map *map; int c, fd; while ((c = getopt(argc, argv, "lr")) != -1) { @@ -127,10 +127,10 @@ main(int argc, char **argv) * Edit the file */ void -edit(struct partition_map_header **mapp) +edit(struct partition_map **mapp) { - struct partition_map_header *map = *mapp; - struct partition_map_header *oldmap; + struct partition_map *map = *mapp; + struct partition_map *oldmap; int command; printf("Edit %s -\n", map->name); @@ -235,7 +235,7 @@ edit(struct partition_map_header **mapp) } void -do_create_partition(struct partition_map_header *map, int get_type) +do_create_partition(struct partition_map *map, int get_type) { long base, length; char *name = NULL; @@ -280,9 +280,9 @@ out: } int -get_base_argument(long *number, struct partition_map_header *map) +get_base_argument(long *number, struct partition_map *map) { - struct partition_map *entry; + struct entry *entry; int result = 0; if (get_number_argument("First block: ", number) == 0) { @@ -304,9 +304,9 @@ get_base_argument(long *number, struct partition_map_header *map) int -get_size_argument(long *number, struct partition_map_header *map) +get_size_argument(long *number, struct partition_map *map) { - struct partition_map *entry; + struct entry *entry; unsigned long multiple; int result = 0; @@ -336,9 +336,9 @@ get_size_argument(long *number, struct partition_map_header *map) void -do_rename_partition(struct partition_map_header *map) +do_rename_partition(struct partition_map *map) { - struct partition_map *entry; + struct entry *entry; char *name; long ix; @@ -372,9 +372,9 @@ do_rename_partition(struct partition_map_header *map) } void -do_change_type(struct partition_map_header *map) +do_change_type(struct partition_map *map) { - struct partition_map *entry; + struct entry *entry; char *type; long ix; @@ -409,9 +409,9 @@ do_change_type(struct partition_map_header *map) void -do_delete_partition(struct partition_map_header *map) +do_delete_partition(struct partition_map *map) { - struct partition_map *cur; + struct entry *cur; long ix; if (get_number_argument("Partition number: ", &ix) == 0) { @@ -428,7 +428,7 @@ do_delete_partition(struct partition_map_header *map) void -do_reorder(struct partition_map_header *map) +do_reorder(struct partition_map *map) { long ix, old_index; @@ -445,7 +445,7 @@ do_reorder(struct partition_map_header *map) void -do_write_partition_map(struct partition_map_header *map) +do_write_partition_map(struct partition_map *map) { if (map->changed == 0) { bad_input("The map has not been changed."); @@ -466,7 +466,7 @@ do_write_partition_map(struct partition_map_header *map) void -do_change_map_size(struct partition_map_header *map) +do_change_map_size(struct partition_map *map) { long size; @@ -479,7 +479,7 @@ do_change_map_size(struct partition_map_header *map) void -do_display_entry(struct partition_map_header *map) +do_display_entry(struct partition_map *map) { long number; |