Lines Matching refs:entry
99 int contains_driver(partition_map *entry);
100 void combine_entry(partition_map *entry);
103 void delete_entry(partition_map *entry);
104 char *get_HFS_name(partition_map *entry, int *kind);
105 void insert_in_base_order(partition_map *entry);
106 void insert_in_disk_order(partition_map *entry);
109 void remove_driver(partition_map *entry);
110 void remove_from_disk_order(partition_map *entry);
215 partition_map * entry;
224 for (entry = map->disk_order; entry != NULL; entry = next) {
225 next = entry->next_on_disk;
226 free(entry->data);
227 free(entry->HFS_name);
228 free(entry);
321 partition_map * entry;
339 for (entry = map->disk_order; entry != NULL; entry = entry->next_on_disk) {
340 convert_dpme(entry->data, 0);
341 result = write_block(map, entry->disk_address, (char *)entry->data);
342 convert_dpme(entry->data, 1);
343 i = entry->disk_address;
374 partition_map *entry;
377 entry = (partition_map *) malloc(sizeof(partition_map));
378 if (entry == NULL) {
382 entry->next_on_disk = NULL;
383 entry->prev_on_disk = NULL;
384 entry->next_by_base = NULL;
385 entry->prev_by_base = NULL;
386 entry->disk_address = ix;
387 entry->the_map = map;
388 entry->data = data;
389 entry->contains_driver = contains_driver(entry);
390 entry->HFS_name = get_HFS_name(entry, &entry->HFS_kind);
392 insert_in_disk_order(entry);
393 insert_in_base_order(entry);
559 // set data into entry
753 // set data into entry
972 delete_partition_from_map(partition_map *entry)
977 if (istrncmp(entry->data->dpme_type, kMapType, DPISTRLEN) == 0) {
978 printf("Can't delete entry for the map itself\n");
981 if (entry->contains_driver) {
988 if (entry->next_by_base == NULL &&
989 entry->data->dpme_pblock_start >= entry->the_map->media_size) {
990 if (entry->contains_driver) {
991 remove_driver(entry); // update block0 if necessary
993 delete_entry(entry);
997 if (entry->next_by_base == NULL) {
998 entry->data->dpme_pblocks =
999 entry->the_map->media_size - entry->data->dpme_pblock_start;
1002 entry->data->dpme_pblock_start, entry->data->dpme_pblocks);
1006 if (entry->contains_driver) {
1007 remove_driver(entry); // update block0 if necessary
1009 free(entry->data);
1010 free(entry->HFS_name);
1011 entry->HFS_kind = kHFS_not;
1012 entry->HFS_name = 0;
1013 entry->data = data;
1014 combine_entry(entry);
1015 map = entry->the_map;
1022 contains_driver(partition_map *entry)
1031 map = entry->the_map;
1048 if (entry->data->dpme_pblock_start <= f*start
1050 <= (entry->data->dpme_pblock_start
1051 + entry->data->dpme_pblocks)) {
1061 combine_entry(partition_map *entry)
1066 if (entry == NULL
1067 || istrncmp(entry->data->dpme_type, kFreeType, DPISTRLEN) != 0) {
1070 if (entry->next_by_base != NULL) {
1071 p = entry->next_by_base;
1074 } else if (entry->data->dpme_pblock_start + entry->data->dpme_pblocks
1077 printf("next entry is not contiguous\n");
1081 if (end > entry->data->dpme_pblock_start + entry->data->dpme_pblocks) {
1082 entry->data->dpme_pblocks = end - entry->data->dpme_pblock_start;
1084 entry->data->dpme_lblocks = entry->data->dpme_pblocks;
1087 entry->data->dpme_pblocks += p->data->dpme_pblocks;
1088 entry->data->dpme_lblocks = entry->data->dpme_pblocks;
1092 if (entry->prev_by_base != NULL) {
1093 p = entry->prev_by_base;
1097 != entry->data->dpme_pblock_start) {
1099 printf("previous entry is not contiguous\n");
1102 if (end < entry->data->dpme_pblock_start + entry->data->dpme_pblocks) {
1103 end = entry->data->dpme_pblock_start + entry->data->dpme_pblocks;
1105 entry->data->dpme_pblocks = end - p->data->dpme_pblock_start;
1106 // new start is previous entry's start
1107 entry->data->dpme_pblock_start = p->data->dpme_pblock_start;
1108 entry->data->dpme_lblocks = entry->data->dpme_pblocks;
1111 entry->data->dpme_pblock_start = p->data->dpme_pblock_start;
1112 entry->data->dpme_pblocks += p->data->dpme_pblocks;
1113 entry->data->dpme_lblocks = entry->data->dpme_pblocks;
1117 entry->contains_driver = contains_driver(entry);
1122 delete_entry(partition_map *entry)
1127 map = entry->the_map;
1130 remove_from_disk_order(entry);
1132 p = entry->next_by_base;
1133 if (map->base_order == entry) {
1137 p->prev_by_base = entry->prev_by_base;
1139 if (entry->prev_by_base != NULL) {
1140 entry->prev_by_base->next_by_base = p;
1143 free(entry->data);
1144 free(entry->HFS_name);
1145 free(entry);
1215 remove_from_disk_order(partition_map *entry)
1220 map = entry->the_map;
1221 p = entry->next_on_disk;
1222 if (map->disk_order == entry) {
1226 p->prev_on_disk = entry->prev_on_disk;
1228 if (entry->prev_on_disk != NULL) {
1229 entry->prev_on_disk->next_on_disk = p;
1231 entry->next_on_disk = NULL;
1232 entry->prev_on_disk = NULL;
1237 insert_in_disk_order(partition_map *entry)
1243 map = entry->the_map;
1245 if (cur == NULL || entry->disk_address <= cur->disk_address) {
1246 map->disk_order = entry;
1247 entry->next_on_disk = cur;
1249 cur->prev_on_disk = entry;
1251 entry->prev_on_disk = NULL;
1254 if (cur->disk_address <= entry->disk_address
1256 || entry->disk_address <= cur->next_on_disk->disk_address)) {
1257 entry->next_on_disk = cur->next_on_disk;
1258 cur->next_on_disk = entry;
1259 entry->prev_on_disk = cur;
1260 if (entry->next_on_disk != NULL) {
1261 entry->next_on_disk->prev_on_disk = entry;
1271 insert_in_base_order(partition_map *entry)
1277 map = entry->the_map;
1280 || entry->data->dpme_pblock_start <= cur->data->dpme_pblock_start) {
1281 map->base_order = entry;
1282 entry->next_by_base = cur;
1284 cur->prev_by_base = entry;
1286 entry->prev_by_base = NULL;
1289 if (cur->data->dpme_pblock_start <= entry->data->dpme_pblock_start
1291 || entry->data->dpme_pblock_start
1293 entry->next_by_base = cur->next_by_base;
1294 cur->next_by_base = entry;
1295 entry->prev_by_base = cur;
1296 if (entry->next_by_base != NULL) {
1297 entry->next_by_base->prev_by_base = entry;
1309 partition_map * entry;
1313 // find map entry
1314 entry = find_entry_by_type(kMapType, map);
1316 if (entry == NULL) {
1317 printf("Couldn't find entry for map!\n");
1320 next = entry->next_by_base;
1323 if (new_size == entry->data->dpme_pblocks) {
1329 if (new_size < entry->data->dpme_pblocks) {
1349 if (entry->data->dpme_pblock_start + entry->data->dpme_pblocks
1354 if (new_size > entry->data->dpme_pblocks + next->data->dpme_pblocks) {
1359 entry->data->dpme_type[0] = 0;
1360 delete_partition_from_map(entry);
1367 remove_driver(partition_map *entry)
1377 map = entry->the_map;
1401 if (entry->data->dpme_pblock_start <= f*start
1403 <= (entry->data->dpme_pblock_start
1404 + entry->data->dpme_pblocks)) {