int i = 0;
reset_more_printf();
- more_printf("Available modes:\n");
+ printf("Available modes:\n");
while (list_modes[i]) {
- more_printf("%s ", list_modes[i]->name);
+ printf("%s ", list_modes[i]->name);
i++;
}
- more_printf("\n");
+ printf("\n");
}
/**
find_cli_mode_descr(hdt_cli.mode, ¤t_mode);
- reset_more_printf();
- more_printf("Available commands are:\n");
+ printf("Available commands are:\n");
/* List first default modules of the mode */
if (current_mode->default_modules &&
current_mode->default_modules->modules) {
while (current_mode->default_modules->modules[j].name) {
- more_printf("%s ",
+ printf("%s ",
current_mode->default_modules->modules[j].name);
j++;
}
- more_printf("\n");
+ printf("\n");
}
/* List secondly the show modules of the mode */
if (current_mode->show_modules &&
current_mode->show_modules->modules) {
- more_printf("\nshow commands:\n");
+ printf("\nshow commands:\n");
j = 0;
while (current_mode->show_modules->modules[j].name) {
- more_printf("%s ",
+ printf("%s ",
current_mode->show_modules->modules[j].name);
j++;
}
- more_printf("\n");
+ printf("\n");
}
/* List thirdly the set modules of the mode */
if (current_mode->set_modules &&
current_mode->set_modules->modules) {
- more_printf("\nset commands:\n");
+ printf("\nset commands:\n");
j = 0;
while (current_mode->set_modules->modules[j].name) {
- more_printf("%s ",
+ printf("%s ",
current_mode->set_modules->modules[j].name);
j++;
}
- more_printf("\n");
+ printf("\n");
}
/* List finally the default modules of the hdt mode */
current_mode->default_modules,
&associated_module);
if (associated_module == NULL)
- more_printf("%s ",
+ printf("%s ",
hdt_mode.default_modules->modules[j].name);
j++;
}
- more_printf("\n");
+ printf("\n");
}
- more_printf("\n");
+ printf("\n");
main_show_modes(argc, argv, hardware);
}
printf("\033[2K\033[1G\033[1F\n");\
} while (0);
+/* The brokeness of that macro is that
+ * it assumes that __VA_ARGS__ contains
+ * one \n (and only one)
+ */
#define more_printf(...) do {\
if (display_line_nb == 20) {\
printf("\n--More--");\
printf("\033[2K\033[1G\033[1F");\
}\
printf(__VA_ARGS__);\
- display_line_nb++; \
+ display_line_nb++;\
} while (0);
/* Display CPU registers for debugging purposes */