Commit | Line | Data |
---|---|---|
7e9f4bfd C |
1 | /* Header file for command-reading library command.c. |
2 | Copyright (C) 1986, 1989 Free Software Foundation, Inc. | |
3 | ||
4 | This program is free software; you can redistribute it and/or modify | |
5 | it under the terms of the GNU General Public License as published by | |
6 | the Free Software Foundation; either version 1, or (at your option) | |
7 | any later version. | |
8 | ||
9 | This program is distributed in the hope that it will be useful, | |
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | GNU General Public License for more details. | |
13 | ||
14 | You should have received a copy of the GNU General Public License | |
15 | along with this program; if not, write to the Free Software | |
16 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ | |
17 | ||
18 | /* This structure records one command'd definition. */ | |
19 | ||
20 | struct cmd_list_element | |
21 | { | |
22 | /* Points to next command in this list. */ | |
23 | struct cmd_list_element *next; | |
24 | ||
25 | /* Name of this command. */ | |
26 | char *name; | |
27 | ||
28 | /* Command class; class values are chosen by application program. */ | |
29 | int class; | |
30 | ||
31 | /* Function definition of this command. | |
32 | Zero for command class names and for help topics that | |
33 | are not really commands. */ | |
34 | void (*function) (); | |
35 | ||
36 | /* Documentation of this command (or help topic). | |
37 | First line is brief documentation; remaining lines form, with it, | |
38 | the full documentation. First line should end with a period. | |
39 | Entire string should also end with a period, not a newline. */ | |
40 | char *doc; | |
41 | ||
42 | /* Auxiliary information. | |
43 | It is up to the calling program to decide what this means. */ | |
44 | char *aux; | |
45 | ||
46 | /* Nonzero identifies a prefix command. For them, the address | |
47 | of the variable containing the list of subcommands. */ | |
48 | struct cmd_list_element **prefixlist; | |
49 | ||
50 | /* For prefix commands only: | |
51 | String containing prefix commands to get here: this one | |
52 | plus any others needed to get to it. Should end in a space. | |
53 | It is used before the word "command" in describing the | |
54 | commands reached through this prefix. */ | |
55 | char *prefixname; | |
56 | ||
57 | /* For prefix commands only: | |
58 | nonzero means do not get an error if subcommand is not | |
59 | recognized; call the prefix's own function in that case. */ | |
60 | char allow_unknown; | |
61 | ||
62 | /* Nonzero says this is an abbreviation, and should not | |
63 | be mentioned in lists of commands. | |
64 | This allows "br<tab>" to complete to "break", which it | |
65 | otherwise wouldn't. */ | |
66 | char abbrev_flag; | |
67 | }; | |
68 | ||
69 | /* Forward-declarations of the entry-points of command.c. */ | |
70 | ||
71 | extern struct cmd_list_element *add_cmd (); | |
72 | extern struct cmd_list_element *add_alias_cmd (); | |
73 | extern struct cmd_list_element *add_prefix_cmd (); | |
74 | extern struct cmd_list_element *lookup_cmd (), *lookup_cmd_1 (); | |
75 | extern char **complete_on_cmdlist (); | |
76 | extern void delete_cmd (); | |
77 | extern void help_cmd (); |