1 /* $OpenBSD: part.h,v 1.21 2015/11/26 08:15:07 tim 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 #ifndef _PART_H 20 #define _PART_H 21 22 struct prt { 23 u_int64_t bs; 24 u_int64_t ns; 25 u_int32_t shead, scyl, ssect; 26 u_int32_t ehead, ecyl, esect; 27 unsigned char flag; 28 unsigned char id; 29 }; 30 31 void PRT_printall(void); 32 const char *PRT_ascii_id(int); 33 void PRT_parse(struct dos_partition *, off_t, off_t, 34 struct prt *); 35 void PRT_make(struct prt *, off_t, off_t, struct dos_partition *); 36 void PRT_print(int, struct prt *, char *); 37 char *PRT_uuid_to_typename(struct uuid *); 38 int PRT_uuid_to_type(struct uuid *); 39 struct uuid *PRT_type_to_uuid(int); 40 41 /* This does CHS -> bs/ns */ 42 void PRT_fix_BN(struct prt *, int); 43 44 /* This does bs/ns -> CHS */ 45 void PRT_fix_CHS(struct prt *); 46 47 #endif /* _PART_H */ 48