Lines Matching refs:drive

144 void EntriesDetails(struct drive *drive, const int secondary, int raw) {  in EntriesDetails()  argument
147 for (i = 0; i < GetNumberOfEntries(drive); ++i) { in EntriesDetails()
149 entry = GetEntry(&drive->gpt, secondary, i); in EntriesDetails()
158 static int GptShow(struct drive *drive, CgptShowParams *params) { in GptShow() argument
160 if (GPT_SUCCESS != (gpt_retval = GptSanityCheck(&drive->gpt))) { in GptShow()
168 if (params->partition > GetNumberOfEntries(drive)) { in GptShow()
174 GptEntry *entry = GetEntry(&drive->gpt, ANY_VALID, index); in GptShow()
204 printf("%d\n", GetSuccessful(drive, ANY_VALID, index)); in GptShow()
207 printf("%d\n", GetTries(drive, ANY_VALID, index)); in GptShow()
210 printf("%d\n", GetPriority(drive, ANY_VALID, index)); in GptShow()
226 for (i = 0; i < GetNumberOfEntries(drive); ++i) { in GptShow()
227 entry = GetEntry(&drive->gpt, ANY_VALID, i); in GptShow()
243 if (CGPT_OK != ReadPMBR(drive)) { in GptShow()
250 PMBRToStr(&drive->pmbr, buf, sizeof(buf)); // will exit if buf is too small in GptShow()
253 if (drive->gpt.valid_headers & MASK_PRIMARY) { in GptShow()
262 ((drive->gpt.valid_headers & MASK_PRIMARY) && params->verbose)) { in GptShow()
267 header = (GptHeader*)drive->gpt.primary_header; in GptShow()
268 entries = (GptEntry*)drive->gpt.primary_entries; in GptShow()
272 GptHeader* primary_header = (GptHeader*)drive->gpt.primary_header; in GptShow()
275 drive->gpt.valid_entries & MASK_PRIMARY ? "" : "INVALID", in GptShow()
279 (drive->gpt.valid_entries & MASK_PRIMARY)) in GptShow()
280 EntriesDetails(drive, PRIMARY, params->numeric); in GptShow()
283 GptHeader* secondary_header = (GptHeader*)drive->gpt.secondary_header; in GptShow()
286 drive->gpt.valid_entries & MASK_SECONDARY ? "" : "INVALID", in GptShow()
294 ((drive->gpt.valid_entries & MASK_SECONDARY) && in GptShow()
295 (!(drive->gpt.valid_entries & MASK_PRIMARY) || in GptShow()
296 memcmp(drive->gpt.primary_entries, drive->gpt.secondary_entries, in GptShow()
299 EntriesDetails(drive, SECONDARY, params->numeric); in GptShow()
302 if (drive->gpt.valid_headers & MASK_SECONDARY) in GptShow()
303 printf(GPT_FMT, (int)(drive->gpt.gpt_drive_sectors - GPT_HEADER_SECTORS), in GptShow()
314 ((drive->gpt.valid_headers & MASK_SECONDARY) && in GptShow()
315 (!(drive->gpt.valid_headers & MASK_PRIMARY) || in GptShow()
316 !IsSynonymous((GptHeader*)drive->gpt.primary_header, in GptShow()
317 (GptHeader*)drive->gpt.secondary_header)) && in GptShow()
323 header = (GptHeader*)drive->gpt.secondary_header; in GptShow()
324 entries = (GptEntry*)drive->gpt.secondary_entries; in GptShow()
329 CheckValid(drive); in GptShow()
335 struct drive drive; in CgptShow() local
340 if (CGPT_OK != DriveOpen(params->drive_name, &drive, O_RDONLY, in CgptShow()
344 if (GptShow(&drive, params)) in CgptShow()
347 DriveClose(&drive, 0); in CgptShow()