Changeset 44c4886 in mainline for uspace/lib/gpt/libgpt.h
- Timestamp:
- 2013-06-10T15:06:20Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 52f2c89, cb328ab
- Parents:
- a2aa81cb
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/gpt/libgpt.h
ra2aa81cb r44c4886 86 86 typedef struct { 87 87 /** Raw header. Has more bytes alloced than sizeof(gpt_header_t)! 88 * See gpt_read_gpt_header() to know why. */ 89 gpt_header_t * raw_data; 90 /** Device where the data are from */ 91 service_id_t device; 92 /** Linked list of partitions (initially NULL) */ 88 * See gpt_alloc_header() to know why. */ 89 gpt_header_t *header; 93 90 } gpt_t; 94 91 … … 123 120 size_t arr_size; 124 121 /** Resizable partition array */ 125 gpt_entry_t * 122 gpt_entry_t *part_array; 126 123 } gpt_partitions_t; 127 124 128 125 129 126 typedef struct gpt_table { 130 gpt_t * gpt; 131 gpt_partitions_t * parts; 127 gpt_t *gpt; 128 gpt_partitions_t *parts; 129 service_id_t device; 132 130 } gpt_label_t; 133 131 134 132 struct partition_type { 135 const char * 136 const char * 133 const char *desc; 134 const char *guid; 137 135 }; 138 136 139 137 extern const struct partition_type gpt_ptypes[]; 140 138 139 extern gpt_label_t * gpt_alloc_label(void); 140 extern void gpt_free_label(gpt_label_t *); 141 141 142 extern gpt_t * gpt_alloc_ gpt_header(void);143 extern gpt_t * gpt_read_gpt_header(service_id_t dev_handle);144 extern int gpt_write_ gpt_header(gpt_t * header, service_id_t dev_handle);142 extern gpt_t * gpt_alloc_header(size_t); 143 extern int gpt_read_header(gpt_label_t *, service_id_t); 144 extern int gpt_write_header(gpt_label_t *, service_id_t); 145 145 146 146 extern gpt_partitions_t * gpt_alloc_partitions(void); 147 extern gpt_partitions_t * gpt_read_partitions(gpt_t * gpt); 148 extern int gpt_write_partitions(gpt_partitions_t * parts, gpt_t * header, service_id_t dev_handle); 149 extern gpt_part_t * gpt_alloc_partition (gpt_partitions_t * parts); 150 extern int gpt_add_partition (gpt_partitions_t * parts, gpt_part_t * partition); 151 extern int gpt_remove_partition(gpt_partitions_t * parts, size_t idx); 147 extern int gpt_read_partitions (gpt_label_t *); 148 extern int gpt_write_partitions(gpt_label_t *, service_id_t); 149 extern gpt_part_t * gpt_alloc_partition (void); 150 extern gpt_part_t * gpt_get_partition (gpt_label_t *); 151 extern int gpt_add_partition (gpt_label_t *, gpt_part_t *); 152 extern int gpt_remove_partition(gpt_label_t *, size_t); 152 153 153 extern size_t gpt_get_part_type(gpt_part_t * p);154 extern void gpt_set_part_type(gpt_part_t * p, size_t type);155 extern void gpt_set_start_lba(gpt_part_t * p, uint64_t start);156 extern uint64_t gpt_get_start_lba(gpt_part_t * p);157 extern void gpt_set_end_lba (gpt_part_t * p, uint64_t end);158 extern uint64_t gpt_get_end_lba (gpt_part_t * p);159 extern unsigned char * gpt_get_part_name(gpt_part_t * p);160 extern void gpt_set_part_name(gpt_part_t * p, char * name[], size_t length);161 extern bool gpt_get_flag (gpt_part_t * p, GPT_ATTR flag);162 extern void gpt_set_flag (gpt_part_t * p, GPT_ATTR flag, bool value);154 extern size_t gpt_get_part_type(gpt_part_t *); 155 extern void gpt_set_part_type(gpt_part_t *, size_t); 156 extern void gpt_set_start_lba(gpt_part_t *, uint64_t); 157 extern uint64_t gpt_get_start_lba(gpt_part_t *); 158 extern void gpt_set_end_lba (gpt_part_t *, uint64_t); 159 extern uint64_t gpt_get_end_lba (gpt_part_t *); 160 extern unsigned char * gpt_get_part_name(gpt_part_t *); 161 extern void gpt_set_part_name(gpt_part_t *, char *[], size_t); 162 extern bool gpt_get_flag (gpt_part_t *, GPT_ATTR); 163 extern void gpt_set_flag (gpt_part_t *, GPT_ATTR, bool); 163 164 164 165 … … 168 169 iterator < (parts)->part_array + (parts)->fill; ++iterator) 169 170 170 extern void gpt_free_gpt(gpt_t * gpt);171 extern void gpt_free_partitions(gpt_partitions_t * parts);171 extern void gpt_free_gpt(gpt_t *); 172 extern void gpt_free_partitions(gpt_partitions_t *); 172 173 173 174 #endif
Note:
See TracChangeset
for help on using the changeset viewer.