1#ifndef HELP_H 2#define HELP_H 3 4struct cmdnames { 5int alloc; 6int cnt; 7struct cmdname { 8size_t len;/* also used for similarity index in help.c */ 9char name[FLEX_ARRAY]; 10} **names; 11}; 12 13staticinlinevoidmput_char(char c,unsigned int num) 14{ 15while(num--) 16putchar(c); 17} 18 19externvoidlist_common_cmds_help(void); 20externconst char*help_unknown_cmd(const char*cmd); 21externvoidload_command_list(const char*prefix, 22struct cmdnames *main_cmds, 23struct cmdnames *other_cmds); 24externvoidadd_cmdname(struct cmdnames *cmds,const char*name,int len); 25/* Here we require that excludes is a sorted list. */ 26externvoidexclude_cmds(struct cmdnames *cmds,struct cmdnames *excludes); 27externintis_in_cmdlist(struct cmdnames *cmds,const char*name); 28externvoidlist_commands(unsigned int colopts,struct cmdnames *main_cmds,struct cmdnames *other_cmds); 29 30/* 31 * call this to die(), when it is suspected that the user mistyped a 32 * ref to the command, to give suggested "correct" refs. 33 */ 34externvoidhelp_unknown_ref(const char*ref,const char*cmd,const char*error); 35#endif/* HELP_H */