xref: /openbsd/sbin/fdisk/gpt.h (revision 10812099)
1 /*	$OpenBSD: gpt.h,v 1.20 2022/04/20 17:14:35 krw Exp $	*/
2 /*
3  * Copyright (c) 2015 Markus Muller <mmu@grummel.net>
4  * Copyright (c) 2015 Kenneth R Westerback <krw@openbsd.org>
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 int		GPT_read(const int);
20 int		GPT_get_lba_start(const unsigned int);
21 int		GPT_get_lba_end(const unsigned int);
22 int		GPT_get_name(const unsigned int);
23 
24 int		GPT_init(const int);
25 int		GPT_write(void);
26 void		GPT_zap_headers(void);
27 void		GPT_print(const char *, const int);
28 void		GPT_print_part(const unsigned int, const char *, const int);
29 void		GPT_print_parthdr(const int);
30 
31 extern struct mbr		gmbr;
32 extern struct gpt_header	gh;
33 extern struct gpt_partition	gp[NGPTPARTITIONS];
34 
35 #define	ANYGPT		0
36 #define	PRIMARYGPT	1
37 #define	SECONDARYGPT	2
38 
39 #define	TERSE		0
40 #define	VERBOSE		1
41 
42 #define	GHANDGP		0
43 #define	GPONLY		1
44