]>
git.ipfire.org Git - thirdparty/util-linux.git/blob - disk-utils/fdisk.h
2 * SPDX-License-Identifier: GPL-2.0-or-later
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.
9 * Copyright (C) 2014-2023 Karel Zak <kzak@redhat.com>
11 #ifndef UTIL_LINUX_FDISK_H
12 #define UTIL_LINUX_FDISK_H
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.
29 #include "fdisk-list.h"
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
38 extern struct fdisk_table
*original_layout
;
39 extern int device_is_used
;
40 extern int is_interactive
;
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)
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
);
50 extern int ask_callback(struct fdisk_context
*cxt
, struct fdisk_ask
*ask
,
51 void *data
__attribute__((__unused__
)));
53 extern int print_partition_info(struct fdisk_context
*cxt
);
55 /* prototypes for fdisk.c */
56 extern void dump_firstsector(struct fdisk_context
*cxt
);
57 extern void dump_disklabel(struct fdisk_context
*cxt
);
59 extern void list_partition_types(struct fdisk_context
*cxt
);
60 extern void change_partition_type(struct fdisk_context
*cxt
);
62 extern void toggle_dos_compatibility_flag(struct fdisk_context
*cxt
);
64 extern void follow_wipe_mode(struct fdisk_context
*cxt
);
66 extern void resize_partition(struct fdisk_context
*cxt
);
68 #endif /* UTIL_LINUX_FDISK_H */