static int tabfunc(char *buf, const int len, void (*func) (const char *p)) { int label_len, print_label, c; int ret_len, pb; char *p; ret_len = 0; pb = 1; if (len > 0) { print_label = 0; p = buf; for (c = 0; c < len; c++) { if (buf[c] == ' ') { if (print_label) { print_label = 0; break; } p++; continue; } print_label = 1; } if (print_label) { label_len = len - (int)(p - buf); ret_len = cfg_print_images(p, label_len, CMD_LENG - len - 1); if (ret_len == 0) prom_printf("\n"); if (ret_len && buf[len + ret_len - 1] == ' ') pb = 0; } else prom_printf("\n"); } else cfg_print_images(NULL, 0, 0); if (pb) (*func) (buf); return ret_len + len; }
static void maintabfunc(char *buf) { putchar('\n'); cmd_show_commands(); if (bi->flags & HAVE_IMAGES) { printk("\nKnown selections:\n"); cfg_print_images(); } printk("\nYou can also type in custom image locations, like:\n"); printk("[device:partno]/vmlinux\n"); printk("[device:partno]/vmlinux -- kernel arguments\n"); printk("[device:partno]/vmlinux [device:partno]/initrd kernel arguments\n"); printk(PROMPT"%s", buf); }