-/* $OpenBSD: cmd.c,v 1.147 2021/10/21 13:16:49 krw Exp $ */
+/* $OpenBSD: cmd.c,v 1.148 2022/01/21 17:29:24 krw Exp $ */
/*
* Copyright (c) 1997 Tobias Weingartner
pp = &mbr->mbr_prt[pn];
- PRT_print(0, NULL, "s");
- PRT_print(pn, pp, "s");
+ PRT_print_parthdr();
+ PRT_print_part(pn, pp, "s");
pp->prt_id = ask_pid(pp->prt_id);
-/* $OpenBSD: mbr.c,v 1.114 2021/12/11 20:09:28 krw Exp $ */
+/* $OpenBSD: mbr.c,v 1.115 2022/01/21 17:29:24 krw Exp $ */
/*
* Copyright (c) 1997 Tobias Weingartner
printf("Offset: %lld\t", (long long)mbr->mbr_lba_self);
printf("Signature: 0x%X\n", (int)mbr->mbr_signature);
- PRT_print(0, NULL, units);
+ PRT_print_parthdr();
for (i = 0; i < NDOSPART; i++)
- PRT_print(i, &mbr->mbr_prt[i], units);
+ PRT_print_part(i, &mbr->mbr_prt[i], units);
}
int
-/* $OpenBSD: part.c,v 1.111 2022/01/18 19:37:27 krw Exp $ */
+/* $OpenBSD: part.c,v 1.112 2022/01/21 17:29:24 krw Exp $ */
/*
* Copyright (c) 1997 Tobias Weingartner
}
void
-PRT_print(const int num, const struct prt *prt, const char *units)
+PRT_print_parthdr(void)
+{
+ printf(" Starting Ending "
+ " LBA Info:\n");
+ printf(" #: id C H S - C H S "
+ "[ start: size ]\n");
+ printf("---------------------------------------"
+ "----------------------------------------\n");
+}
+
+void
+PRT_print_part(const int num, const struct prt *prt, const char *units)
{
const struct unit_type *ut;
double size;
- if (prt == NULL) {
- printf(" Starting Ending "
- " LBA Info:\n");
- printf(" #: id C H S - C H S "
- "[ start: size ]\n");
- printf("---------------------------------------"
- "----------------------------------------\n");
- } else {
- size = units_size(units, prt->prt_ns, &ut);
- printf("%c%1d: %.2X %6u %3u %3u - %6u %3u %3u "
- "[%12llu:%12.0f%s] %s\n",
- (prt->prt_flag == DOSACTIVE)?'*':' ',
- num, prt->prt_id,
- prt->prt_scyl, prt->prt_shead, prt->prt_ssect,
- prt->prt_ecyl, prt->prt_ehead, prt->prt_esect,
- prt->prt_bs, size, ut->ut_abbr, ascii_id(prt->prt_id));
- }
+ size = units_size(units, prt->prt_ns, &ut);
+ printf("%c%1d: %.2X %6u %3u %3u - %6u %3u %3u "
+ "[%12llu:%12.0f%s] %s\n",
+ (prt->prt_flag == DOSACTIVE)?'*':' ',
+ num, prt->prt_id,
+ prt->prt_scyl, prt->prt_shead, prt->prt_ssect,
+ prt->prt_ecyl, prt->prt_ehead, prt->prt_esect,
+ prt->prt_bs, size, ut->ut_abbr, ascii_id(prt->prt_id));
}
void
-/* $OpenBSD: part.h,v 1.31 2021/10/25 13:51:25 krw Exp $ */
+/* $OpenBSD: part.h,v 1.32 2022/01/21 17:29:24 krw Exp $ */
/*
* Copyright (c) 1997 Tobias Weingartner
const uint64_t, struct prt *);
void PRT_make(const struct prt *,const uint64_t, const uint64_t,
struct dos_partition *);
-void PRT_print(const int, const struct prt *, const char *);
+void PRT_print_part(const int, const struct prt *, const char *);
+void PRT_print_parthdr(void);
char *PRT_uuid_to_typename(const struct uuid *);
int PRT_uuid_to_type(const struct uuid *);
struct uuid *PRT_type_to_uuid(const int);