if (rc == 0 && num >= low && num <= high)
return fdisk_ask_number_set_result(ask, num);
- printf(_("Value out of range.\n"));
+ fdisk_warnx(cxt, _("Value out of range."));
} while (1);
return -1;
fdisk_ask_number_set_relative(ask, 1);
return fdisk_ask_number_set_result(ask, num);
}
- printf(_("Value out of range.\n"));
+ fdisk_warnx(cxt, _("Value out of range."));
} while (1);
return -1;
return rc;
}
-
struct fdisk_parttype *ask_partition_type(struct fdisk_context *cxt)
{
const char *q;
return;
flag = !fdisk_dos_is_compatible(lb);
-
- if (flag)
- printf(_("DOS Compatibility flag is set (DEPRECATED!)\n"));
- else
- printf(_("DOS Compatibility flag is not set\n"));
+ fdisk_info(cxt, flag ?
+ _("DOS Compatibility flag is set (DEPRECATED!)") :
+ _("DOS Compatibility flag is not set"));
fdisk_dos_enable_compatible(lb, flag);
if (fdisk_is_disklabel(cxt, DOS))
- fdisk_reset_alignment(cxt);
+ fdisk_reset_alignment(cxt); /* reset the current label */
}
void change_partition_type(struct fdisk_context *cxt)
org_t = t = fdisk_get_partition_type(cxt, i);
if (!t)
- printf(_("Partition %zu does not exist yet!\n"), i + 1);
+ fdisk_warnx(cxt, _("Partition %zu does not exist yet!"), i + 1);
else do {
t = ask_partition_type(cxt);
continue;
if (fdisk_set_partition_type(cxt, i, t) == 0) {
- printf (_("Changed type of partition '%s' to '%s'\n"),
+ fdisk_info(cxt,
+ _("Changed type of partition '%s' to '%s'"),
org_t ? org_t->name : _("Unknown"),
t ? t->name : _("Unknown"));
} else {
- printf (_("Type of partition %zu is unchanged: %s\n"),
+ fdisk_info(cxt,
+ _("Type of partition %zu is unchanged: %s"),
i + 1,
org_t ? org_t->name : _("Unknown"));
}
#define MAX_PER_LINE 16
-static void
-print_buffer(struct fdisk_context *cxt, unsigned char pbuffer[]) {
+static void print_buffer(struct fdisk_context *cxt, unsigned char pbuffer[])
+{
unsigned int i, l;
for (i = 0, l = 0; i < cxt->sector_size; i++, l++) {
/* Here starts interactive mode, use fdisk_{warn,info,..} functions */
color_enable(UL_COLOR_GREEN);
- fdisk_info(cxt, _("Welcome to fdisk (%s).\n"), PACKAGE_STRING);
+ fdisk_info(cxt, _("Welcome to fdisk (%s)."), PACKAGE_STRING);
color_disable();
fdisk_info(cxt, _("Changes will remain in memory only, until you decide to write them.\n"
"Be careful before using the write command.\n"));
fflush(stdout);
if (!fdisk_dev_has_disklabel(cxt)) {
- fdisk_warnx(cxt, _("Device does not contain a recognized partition table\n"));
+ fdisk_warnx(cxt, _("Device does not contain a recognized partition table"));
fdisk_create_disklabel(cxt, NULL);
}