diff options
author | Karel Zak | 2014-11-26 17:33:07 +0100 |
---|---|---|
committer | Karel Zak | 2014-11-26 17:33:07 +0100 |
commit | a1ef792fda428eff141d4c844942c09f69e67088 (patch) | |
tree | 44481c894ce3e4b57d895babd1656f992d9ab981 /libfdisk/src/ask.c | |
parent | libsmartcols: fix docs namespace (diff) | |
download | kernel-qcow2-util-linux-a1ef792fda428eff141d4c844942c09f69e67088.tar.gz kernel-qcow2-util-linux-a1ef792fda428eff141d4c844942c09f69e67088.tar.xz kernel-qcow2-util-linux-a1ef792fda428eff141d4c844942c09f69e67088.zip |
libfdisk: rename and move function
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libfdisk/src/ask.c')
-rw-r--r-- | libfdisk/src/ask.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/libfdisk/src/ask.c b/libfdisk/src/ask.c index 0ec3543c5..57c01ae23 100644 --- a/libfdisk/src/ask.c +++ b/libfdisk/src/ask.c @@ -11,6 +11,28 @@ static void fdisk_ask_menu_reset_items(struct fdisk_ask *ask); + +/** + * fdisk_set_ask: + * @cxt: context + * @ask_cb: callback + * @data: callback data + * + * Set callback for dialog driven partitioning and library warnings/errors. + * + * Returns: 0 on success, < 0 on error. + */ +int fdisk_set_ask(struct fdisk_context *cxt, + int (*ask_cb)(struct fdisk_context *, struct fdisk_ask *, void *), + void *data) +{ + assert(cxt); + + cxt->ask_cb = ask_cb; + cxt->ask_data = data; + return 0; +} + struct fdisk_ask *fdisk_new_ask(void) { struct fdisk_ask *ask = calloc(1, sizeof(struct fdisk_ask)); |