1 /* Header file for command-reading library command.c.
2 Copyright (C) 1986, 1989, 1990 Free Software Foundation, Inc.
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)
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.
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. */
18 #ifndef _COMMAND_H_INCLUDED
19 #define _COMMAND_H_INCLUDED
21 /* Not a set/show command. Note that some commands which begin with
22 "set" or "show" might be in this category, if their syntax does
23 not fall into one of the following categories. */
24 typedef enum cmd_types
{
30 /* Types of "set" or "show" command. */
31 typedef enum var_types
{
32 /* "on" or "off". *VAR is an integer which is nonzero for on,
35 /* Unsigned Integer. *VAR is an unsigned int. The user can type 0
36 to mean "unlimited", which is stored in *VAR as UINT_MAX. */
38 /* String which the user enters with escapes (e.g. the user types \n and
39 it is a real newline in the stored string).
40 *VAR is a malloc'd string, or NULL if the string is empty. */
42 /* String which stores what the user types verbatim.
43 *VAR is a malloc'd string, or NULL if the string is empty. */
45 /* String which stores a filename.
46 *VAR is a malloc'd string, or NULL if the string is empty. */
48 /* ZeroableInteger. *VAR is an int. Like Unsigned Integer except
49 that zero really means zero. */
53 /* This structure records one command'd definition. */
55 struct cmd_list_element
57 /* Points to next command in this list. */
58 struct cmd_list_element
*next
;
60 /* Name of this command. */
63 /* Command class; class values are chosen by application program. */
64 enum command_class
class;
66 /* Function definition of this command.
67 Zero for command class names and for help topics that
68 are not really commands. */
70 # define NO_FUNCTION ((void (*)()) 0 )
72 /* Documentation of this command (or help topic).
73 First line is brief documentation; remaining lines form, with it,
74 the full documentation. First line should end with a period.
75 Entire string should also end with a period, not a newline. */
78 /* Auxiliary information.
79 It is up to the calling program to decide what this means. */
82 /* Nonzero identifies a prefix command. For them, the address
83 of the variable containing the list of subcommands. */
84 struct cmd_list_element
**prefixlist
;
86 /* For prefix commands only:
87 String containing prefix commands to get here: this one
88 plus any others needed to get to it. Should end in a space.
89 It is used before the word "command" in describing the
90 commands reached through this prefix. */
93 /* For prefix commands only:
94 nonzero means do not get an error if subcommand is not
95 recognized; call the prefix's own function in that case. */
98 /* Nonzero says this is an abbreviation, and should not
99 be mentioned in lists of commands.
100 This allows "br<tab>" to complete to "break", which it
101 otherwise wouldn't. */
104 /* Completion routine for this command. */
105 char **(*completer
)();
107 /* Type of "set" or "show" command (or SET_NOT_SET if not "set"
111 /* Pointer to variable affected by "set" and "show". Doesn't matter
112 if type is not_set. */
115 /* What kind of variable is *VAR? */
118 /* Pointer to command strings of user-defined commands */
119 struct command_line
*user_commands
;
122 /* Forward-declarations of the entry-points of command.c. */
124 extern struct cmd_list_element
*add_cmd ();
125 extern struct cmd_list_element
*add_alias_cmd ();
126 extern struct cmd_list_element
*add_prefix_cmd ();
127 extern struct cmd_list_element
*add_abbrev_prefix_cmd ();
128 extern struct cmd_list_element
*lookup_cmd (), *lookup_cmd_1 ();
129 extern void add_com ();
130 extern void add_com_alias ();
131 extern void add_info ();
132 extern void add_info_alias ();
133 extern char **complete_on_cmdlist ();
134 extern void delete_cmd ();
135 extern void help_cmd ();
136 extern struct cmd_list_element
*add_set_cmd ();
137 extern struct cmd_list_element
*add_show_from_set ();
139 /* Do a "set" or "show" command. ARG is NULL if no argument, or the text
140 of the argument, and FROM_TTY is nonzero if this command is being entered
141 directly by the user (i.e. these are just like any other
142 command). C is the command list element for the command. */
143 extern void do_setshow_command ();
145 /* Do a "show" command for each thing on a command list. */
146 extern void cmd_show_list ();
148 extern void error_no_arg (); /* Print error for missing argument */
149 extern void dont_repeat (); /* Avoid auto-repeat of command */
151 #endif /* _COMMAND_H_INCLUDED */
This page took 0.031619 seconds and 4 git commands to generate.