]>
Commit | Line | Data |
---|---|---|
9e95aa12 KZ |
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 | */ | |
fcd9a2a4 KZ |
11 | #ifndef UTIL_LINUX_FDISK_H |
12 | #define UTIL_LINUX_FDISK_H | |
726f69e2 | 13 | /* |
e6d0c4c1 KZ |
14 | * fdisk.h |
15 | */ | |
726f69e2 | 16 | |
17d0d058 | 17 | #include "c.h" |
e6d0c4c1 KZ |
18 | #include <assert.h> |
19 | #include <libfdisk.h> | |
17d0d058 | 20 | |
f3744ac5 KZ |
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 | */ | |
bb58112e | 24 | #include "blkdev.h" |
80a1712f | 25 | #include "colors.h" |
e6d0c4c1 KZ |
26 | #include "debug.h" |
27 | #include "nls.h" | |
28 | ||
fdb006e8 KZ |
29 | #include "fdisk-list.h" |
30 | ||
e6d0c4c1 KZ |
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 | ||
ba465623 | 37 | extern int pwipemode; |
fadd8e08 KZ |
38 | extern struct fdisk_table *original_layout; |
39 | extern int device_is_used; | |
c1154128 | 40 | extern int is_interactive; |
ba465623 | 41 | |
e6d0c4c1 KZ |
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) | |
f3744ac5 | 45 | |
c1154128 | 46 | extern int get_user_reply(const char *prompt, |
a410f8df | 47 | char *buf, size_t bufsz); |
a47fec81 | 48 | extern int process_fdisk_menu(struct fdisk_context **cxt); |
39f01b7b | 49 | |
416c43a9 KZ |
50 | extern int ask_callback(struct fdisk_context *cxt, struct fdisk_ask *ask, |
51 | void *data __attribute__((__unused__))); | |
52 | ||
3e3b51b3 JLB |
53 | extern int print_partition_info(struct fdisk_context *cxt); |
54 | ||
726f69e2 | 55 | /* prototypes for fdisk.c */ |
e916600f KZ |
56 | extern void dump_firstsector(struct fdisk_context *cxt); |
57 | extern void dump_disklabel(struct fdisk_context *cxt); | |
58 | ||
7b575fcc | 59 | extern void list_partition_types(struct fdisk_context *cxt); |
fcd9a2a4 | 60 | extern void change_partition_type(struct fdisk_context *cxt); |
22853e4a | 61 | |
f02fecd1 | 62 | extern void toggle_dos_compatibility_flag(struct fdisk_context *cxt); |
7eda085c | 63 | |
5635d195 KZ |
64 | extern void follow_wipe_mode(struct fdisk_context *cxt); |
65 | ||
d45820df TW |
66 | extern void resize_partition(struct fdisk_context *cxt); |
67 | ||
a4c0dce8 KZ |
68 | extern void discard_sectors(struct fdisk_context *cxt); |
69 | ||
fcd9a2a4 | 70 | #endif /* UTIL_LINUX_FDISK_H */ |