1 /* $OpenBSD: part.h,v 1.47 2023/05/21 17:29:33 krw Exp $ */ 2 3 /* 4 * Copyright (c) 1997 Tobias Weingartner 5 * 6 * Permission to use, copy, modify, and distribute this software for any 7 * purpose with or without fee is hereby granted, provided that the above 8 * copyright notice and this permission notice appear in all copies. 9 * 10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 */ 18 19 struct chs { 20 uint64_t chs_cyl; 21 uint32_t chs_head; 22 uint32_t chs_sect; 23 }; 24 25 struct prt { 26 uint64_t prt_bs; 27 uint64_t prt_ns; 28 unsigned char prt_flag; 29 unsigned char prt_id; 30 }; 31 32 void PRT_print_mbrmenu(char *, size_t); 33 void PRT_print_gptmenu(char *, size_t); 34 void PRT_dp_to_prt(const struct dos_partition *, const uint64_t, 35 const uint64_t, struct prt *); 36 void PRT_prt_to_dp(const struct prt *,const uint64_t, 37 const uint64_t, struct dos_partition *); 38 void PRT_print_part(const int, const struct prt *, const char *); 39 void PRT_print_parthdr(void); 40 const char *PRT_uuid_to_desc(const struct uuid *); 41 char *PRT_uuid_to_menudflt(const struct uuid *); 42 const char *PRT_menuid_to_guid(const int); 43 int PRT_protected_uuid(const struct uuid *); 44 void PRT_lba_to_chs(const struct prt *, struct chs *, struct chs *); 45