]> git.ipfire.org Git - thirdparty/util-linux.git/blob - disk-utils/fdisk.h
Merge branch 'master' of https://github.com/goldwynr/util-linux
[thirdparty/util-linux.git] / disk-utils / fdisk.h
1 /*
2 * SPDX-License-Identifier: GPL-2.0-or-later
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * Copyright (C) 2014-2023 Karel Zak <kzak@redhat.com>
10 */
11 #ifndef UTIL_LINUX_FDISK_H
12 #define UTIL_LINUX_FDISK_H
13 /*
14 * fdisk.h
15 */
16
17 #include "c.h"
18 #include <assert.h>
19 #include <libfdisk.h>
20
21 /* Let's temporary include private libfdisk header file. The final libfdisk.h
22 * maybe included when fdisk.c and libfdisk code will be completely spit.
23 */
24 #include "blkdev.h"
25 #include "colors.h"
26 #include "debug.h"
27 #include "nls.h"
28
29 #include "fdisk-list.h"
30
31 #define FDISKPROG_DEBUG_INIT (1 << 1)
32 #define FDISKPROG_DEBUG_MENU (1 << 3)
33 #define FDISKPROG_DEBUG_MISC (1 << 4)
34 #define FDISKPROG_DEBUG_ASK (1 << 5)
35 #define FDISKPROG_DEBUG_ALL 0xFFFF
36
37 extern int pwipemode;
38 extern struct fdisk_table *original_layout;
39 extern int device_is_used;
40 extern int is_interactive;
41
42 UL_DEBUG_DECLARE_MASK(fdisk);
43 #define DBG(m, x) __UL_DBG(fdisk, FDISKPROG_DEBUG_, m, x)
44 #define ON_DBG(m, x) __UL_DBG_CALL(fdisk, FDISKPROG_DEBUG_, m, x)
45
46 extern int get_user_reply(const char *prompt,
47 char *buf, size_t bufsz);
48 extern int process_fdisk_menu(struct fdisk_context **cxt);
49
50 extern int ask_callback(struct fdisk_context *cxt, struct fdisk_ask *ask,
51 void *data __attribute__((__unused__)));
52
53 extern int print_partition_info(struct fdisk_context *cxt);
54
55 /* prototypes for fdisk.c */
56 extern void dump_firstsector(struct fdisk_context *cxt);
57 extern void dump_disklabel(struct fdisk_context *cxt);
58
59 extern void list_partition_types(struct fdisk_context *cxt);
60 extern void change_partition_type(struct fdisk_context *cxt);
61
62 extern void toggle_dos_compatibility_flag(struct fdisk_context *cxt);
63
64 extern void follow_wipe_mode(struct fdisk_context *cxt);
65
66 extern void resize_partition(struct fdisk_context *cxt);
67
68 #endif /* UTIL_LINUX_FDISK_H */