xref: /openbsd-src/sbin/disklabel/extern.h (revision e46ff49b6d65a5969b658698445d284099516ef9)
1 /*	$OpenBSD: extern.h,v 1.36 2023/06/21 12:50:09 krw Exp $	*/
2 
3 /*
4  * Copyright (c) 2003 Theo de Raadt <deraadt@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 #define MEG(x)	((x) * 1024LL * (1024 / DEV_BSIZE))
20 #define GIG(x)  (MEG(x) * 1024LL)
21 
22 /* 'actions' for mpfree(). */
23 #define	DISCARD	0
24 #define	KEEP	1
25 
26 u_short	dkcksum(const struct disklabel *);
27 char	canonical_unit(const struct disklabel *, char);
28 double	scale(u_int64_t, char, const struct disklabel *);
29 void	display(FILE *, const struct disklabel *, char, int);
30 void	display_partition(FILE *, const struct disklabel *, int, char);
31 int	duid_parse(struct disklabel *, char *);
32 
33 int	editor(int);
34 int	editor_allocspace(struct disklabel *);
35 void	mpsave(const struct disklabel *);
36 void	mpcopy(char **, char **);
37 void	mpfree(char **, int);
38 void	parse_autotable(char *);
39 
40 int	writelabel(int, struct disklabel *);
41 extern  char *dkname, *specname, *fstabfile;
42 extern	char *mountpoints[MAXPARTITIONS];
43 extern  int aflag, dflag, uidflag;
44 extern  int donothing;
45 extern	int verbose;
46 extern	int quiet;
47 extern	struct disklabel lab;
48