xref: /openbsd-src/sbin/fdisk/gpt.h (revision f1dd7b858388b4a23f4f67a4957ec5ff656ebbe8)
1 /*	$OpenBSD: gpt.h,v 1.9 2021/05/10 17:16:01 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 void		GPT_read(int);
20 int		GPT_get_header(off_t);
21 int		GPT_get_partition_table(off_t);
22 int		GPT_get_lba_start(unsigned int);
23 int		GPT_get_lba_end(unsigned int);
24 
25 int		GPT_init(void);
26 int		GPT_write(void);
27 void		GPT_print(char *, int);
28 void		GPT_print_part(int, char *, int);
29 void		GPT_print_parthdr(int);
30 
31 extern struct gpt_header gh;
32 extern struct gpt_partition gp[NGPTPARTITIONS];
33 
34 #define	ANYGPT		0
35 #define	PRIMARYGPT	1
36 #define	SECONDARYGPT	2
37 
38 #define	TERSE		0
39 #define	VERBOSE		1
40