1 #define MAX_ARGC 16 /* Maximum argument count per line */
2 #define MAX_ARGLEN 128 /* Maximum length of an argument */
3 #define MAX_LINES 16 /* Maximum number of lines per menu */
5 #define MAX_TITLE 1 /* Maximum length of title, in lines */
7 /* Maximum depth to which submenus will be searched when looking for commands */
8 #define MAX_MENU_DEPTH 8
10 typedef struct menu_arg {
11 char *ma_doc; /* Short doc for completion */
12 char *ma_prompt; /* For prompting in menu */
15 typedef struct menu_line {
16 int (*ml_function) ();
17 struct menu *ml_submenu;
19 struct menu_arg ml_args[MAX_ARGC];
22 #define ml_doc ml_args[0].ma_prompt
23 #define ml_command ml_args[0].ma_doc
30 struct menu_line m_lines[MAX_LINES];
33 /* Return codes for Do_menu */
34 /* These should also be used by functions called from Do_menu */
35 #define DM_NORMAL 0 /* Normal return */
36 #define DM_QUIT 1 /* Quit; ^C or q command received */
38 /* Macros for initializing menu lines */
39 #define NULLFUNC ((int (*)()) 0)
40 #define NULLMENU ((struct menu *) 0)
41 #define SUBMENU(cmd, doc, menu) { NULLFUNC, menu, 1, { { cmd, doc } } }
42 #define SIMPLEFUNC(cmd, doc, func) { func, NULLMENU, 1, { { cmd, doc } } }