return rv;
}
-int main()
+int main(void)
{
t_menuitem *curr;
char cmd[160];
// This is same as inputc except it honors the ontimeout handler
// and calls it when needed. For the callee, there is no difference
// as this will not return unless a key has been pressed.
-static int getch()
+static int getch(void)
{
t_timeout_handler th;
int key;
// Run through all items and if they are submenus
// with a non-trivial "action" and trivial submenunum
// replace submenunum with the menu with name "action"
-void fix_submenus()
+void fix_submenus(void)
{
int i, j;
pt_menu m;
ms->tm_stepsize = stepsize;
}
-void unreg_ontimeout()
+void unreg_ontimeout(void)
{
ms->ontimeout = NULL;
}
}
}
-void unreg_ontotaltimeout()
+void unreg_ontotaltimeout(void)
{
ms->ontotaltimeout = NULL;
}
m->col = col;
}
-pt_menuitem add_sep() // Add a separator to current menu
+pt_menuitem add_sep(void) // Add a separator to current menu
{
pt_menuitem mi;
pt_menu m;
pt_menusystem init_menusystem(const char *title);
-void close_menusystem(); // Deallocate memory used
+void close_menusystem(void); // Deallocate memory used
void set_normal_attr(uchar normal, uchar selected, uchar inactivenormal,
uchar inactiveselected);
unsigned int stepsize);
// Set timeout handler, set 0 for default values.
// So stepsize=0 means numsteps is measured in centiseconds.
-void unreg_ontimeout();
+void unreg_ontimeout(void);
void reg_ontotaltimeout(t_timeout_handler, unsigned long numcentiseconds);
-void unreg_ontotaltimeout();
+void unreg_ontotaltimeout(void);
// Find the number of the menu given the name
// Returns -1 if not found
}
// Add a separator to the "current" menu
-pt_menuitem add_sep();
+pt_menuitem add_sep(void);
// Generate string based on state of checkboxes and radioitem in given menu
// and append string to existing contents of "line"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-int gfx_menu_init()
+int gfx_menu_init(void)
{
com32sys_t r;
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-void gfx_done()
+void gfx_done(void)
{
com32sys_t r;
// return:
// boot menu index (-1: go to text mode prompt)
//
-int gfx_input()
+int gfx_input(void)
{
com32sys_t r;
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Locate menu entry and boot.
//
-void boot()
+void boot(void)
{
char *label, *arg, *s;
menu_t *menu_ptr;
autocomplete_tail = new;
}
-static void autocomplete_destroy_list()
+static void autocomplete_destroy_list(void)
{
struct autocomplete_list *tmp = NULL;
free(argv);
}
-static void reset_prompt()
+static void reset_prompt(void)
{
/* No need to display the prompt if we exit */
if (hdt_cli.mode != EXIT_MODE) {
more_printf("\n");
}
-void print_history()
+void print_history(void)
{
reset_more_printf();
for (int i = 1; i <= MAX_HISTORY_SIZE; i++) {
void main_show(char *item, struct s_hardware *hardware);
#define CLI_HISTORY "history"
-void print_history();
+void print_history(void);
// DMI STUFF
#define CLI_DMI_BASE_BOARD "base_board"
}
/* Reset the more_printf counter */
-void reset_more_printf()
+void reset_more_printf(void)
{
display_line_nb = 0;
}
char vesa_background[255];
};
-void reset_more_printf();
+void reset_more_printf(void);
const char *find_argument(const char **argv, const char *argument);
char *remove_spaces(char *p);
char *remove_trailing_lf(char *p);
}
/* In the menu system, what to do on keyboard timeout */
-TIMEOUTCODE ontimeout()
+TIMEOUTCODE ontimeout(void)
{
// beep();
return CODE_WAIT;
int total_menu_count; // Sum of all menus we have
};
-TIMEOUTCODE ontimeout();
+TIMEOUTCODE ontimeout(void);
void keys_handler(t_menusystem * ms
__attribute__ ((unused)), t_menuitem * mi, int scancode);
}
}
-void clear_end_of_line() {
+void clear_end_of_line(void)
+{
fputs(CSI "0K", stdout);
}
-void move_cursor_left(int count) {
+void move_cursor_left(int count)
+{
char buffer[10];
memset(buffer,0,sizeof(buffer));
sprintf(buffer,CSI "%dD",count);
fputs(buffer, stdout);
}
-void move_cursor_right(int count) {
+void move_cursor_right(int count)
+{
char buffer[10];
memset(buffer,0,sizeof(buffer));
sprintf(buffer, CSI "%dC", count);
fputs("\033[0m",stdout);
}
-void clear_line() {
+void clear_line(void)
+{
fputs(CSI "2K", stdout);
}
-void clear_beginning_of_line() {
+void clear_beginning_of_line(void)
+{
fputs(CSI "1K", stdout);
}
-void move_cursor_to_column(int count) {
+void move_cursor_to_column(int count)
+{
char buffer[10];
memset(buffer,0,sizeof(buffer));
sprintf(buffer, CSI "%dG", count);
fputs(buffer, stdout);
}
-void move_cursor_to_next_line() {
+void move_cursor_to_next_line(void)
+{
fputs("\033e", stdout);
}
-void disable_utf8() {
+void disable_utf8(void)
+{
fputs("\033%@", stdout);
}
-void set_g1_special_char(){
+void set_g1_special_char(void){
fputs("\033)0", stdout);
}
-void set_us_g0_charset() {
+void set_us_g0_charset(void)
+{
fputs("\033(B\1#0", stdout);
}
-void clear_entire_screen() {
+void clear_entire_screen(void)
+{
fputs(CSI "2J", stdout);
}
cprint_vga2ansi('0', '0');
}
-void reset_colors()
+void reset_colors(void)
{
csprint(CSI "1D", 0x07);
}
#define APP_YEAR "2008"
#define APP_VER "beta-b032"
-void rosh_version()
+void rosh_version(void)
{
printf("%s v %s; (c) %s %s.\n", APP_LONGNAME, APP_VER, APP_YEAR,
APP_AUTHOR);
* Switches console over to raw input mode. Allows get_key to get just
* 1 key sequence (without delay or display)
*/
-void rosh_console_raw()
+void rosh_console_raw(void)
{
// struct termios itio, ntio;
// tcgetattr(0, &itio);
/*
* Switches back to standard getline mode.
*/
-void rosh_console_std()
+void rosh_console_std(void)
{
// struct termios itio, ntio;
console_ansi_std();
* Attempts to get a single key from the console
* returns key pressed
*/
-int rosh_getkey()
+int rosh_getkey(void)
{
int inc;