2009-09-24 09:02:18 -07:00
|
|
|
#ifndef __PERF_HELP_H
|
|
|
|
#define __PERF_HELP_H
|
2009-04-20 06:00:56 -07:00
|
|
|
|
|
|
|
struct cmdnames {
|
2009-07-01 03:37:06 -07:00
|
|
|
size_t alloc;
|
|
|
|
size_t cnt;
|
2009-04-20 06:00:56 -07:00
|
|
|
struct cmdname {
|
|
|
|
size_t len; /* also used for similarity index in help.c */
|
|
|
|
char name[FLEX_ARRAY];
|
|
|
|
} **names;
|
|
|
|
};
|
|
|
|
|
|
|
|
static inline void mput_char(char c, unsigned int num)
|
|
|
|
{
|
|
|
|
while(num--)
|
|
|
|
putchar(c);
|
|
|
|
}
|
|
|
|
|
|
|
|
void load_command_list(const char *prefix,
|
|
|
|
struct cmdnames *main_cmds,
|
|
|
|
struct cmdnames *other_cmds);
|
2009-07-01 03:37:06 -07:00
|
|
|
void add_cmdname(struct cmdnames *cmds, const char *name, size_t len);
|
2009-04-20 06:00:56 -07:00
|
|
|
/* Here we require that excludes is a sorted list. */
|
|
|
|
void exclude_cmds(struct cmdnames *cmds, struct cmdnames *excludes);
|
|
|
|
int is_in_cmdlist(struct cmdnames *c, const char *s);
|
|
|
|
void list_commands(const char *title, struct cmdnames *main_cmds,
|
|
|
|
struct cmdnames *other_cmds);
|
|
|
|
|
2009-09-24 09:02:18 -07:00
|
|
|
#endif /* __PERF_HELP_H */
|