xref: /dflybsd-src/contrib/gdb-7/gdb/command.h (revision de8e141f24382815c10a4012d209bbbf7abf1112)
1*ef5ccd6cSJohn Marino /* Header file for command creation.
25796c8dcSSimon Schubert 
3*ef5ccd6cSJohn Marino    Copyright (C) 1986-2013 Free Software Foundation, Inc.
45796c8dcSSimon Schubert 
55796c8dcSSimon Schubert    This program is free software; you can redistribute it and/or modify
65796c8dcSSimon Schubert    it under the terms of the GNU General Public License as published by
75796c8dcSSimon Schubert    the Free Software Foundation; either version 3 of the License, or
85796c8dcSSimon Schubert    (at your option) any later version.
95796c8dcSSimon Schubert 
105796c8dcSSimon Schubert    This program is distributed in the hope that it will be useful,
115796c8dcSSimon Schubert    but WITHOUT ANY WARRANTY; without even the implied warranty of
125796c8dcSSimon Schubert    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
135796c8dcSSimon Schubert    GNU General Public License for more details.
145796c8dcSSimon Schubert 
155796c8dcSSimon Schubert    You should have received a copy of the GNU General Public License
165796c8dcSSimon Schubert    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
175796c8dcSSimon Schubert 
185796c8dcSSimon Schubert #if !defined (COMMAND_H)
195796c8dcSSimon Schubert #define COMMAND_H 1
205796c8dcSSimon Schubert 
21*ef5ccd6cSJohn Marino #include "gdb_vecs.h"
22*ef5ccd6cSJohn Marino 
23*ef5ccd6cSJohn Marino /* This file defines the public interface for any code wanting to
24*ef5ccd6cSJohn Marino    create commands.  */
25*ef5ccd6cSJohn Marino 
26c50c785cSJohn Marino /* Command classes are top-level categories into which commands are
27c50c785cSJohn Marino    broken down for "help" purposes.
28c50c785cSJohn Marino 
295796c8dcSSimon Schubert    Notes on classes: class_alias is for alias commands which are not
305796c8dcSSimon Schubert    abbreviations of the original command.  class-pseudo is for
315796c8dcSSimon Schubert    commands which are not really commands nor help topics ("stop").  */
325796c8dcSSimon Schubert 
335796c8dcSSimon Schubert enum command_class
345796c8dcSSimon Schubert {
355796c8dcSSimon Schubert   /* Special args to help_list */
365796c8dcSSimon Schubert   class_deprecated = -3, all_classes = -2, all_commands = -1,
375796c8dcSSimon Schubert   /* Classes of commands */
38c50c785cSJohn Marino   no_class = -1, class_run = 0, class_vars, class_stack, class_files,
39c50c785cSJohn Marino   class_support, class_info, class_breakpoint, class_trace,
40cf7f2e2dSJohn Marino   class_alias, class_bookmark, class_obscure, class_maintenance,
41c50c785cSJohn Marino   class_pseudo, class_tui, class_user, class_xdb,
42c50c785cSJohn Marino   no_set_class	/* Used for "show" commands that have no corresponding
43c50c785cSJohn Marino 		   "set" command.  */
445796c8dcSSimon Schubert };
455796c8dcSSimon Schubert 
465796c8dcSSimon Schubert /* FIXME: cagney/2002-03-17: Once cmd_type() has been removed, ``enum
475796c8dcSSimon Schubert    cmd_types'' can be moved from "command.h" to "cli-decode.h".  */
485796c8dcSSimon Schubert /* Not a set/show command.  Note that some commands which begin with
495796c8dcSSimon Schubert    "set" or "show" might be in this category, if their syntax does
505796c8dcSSimon Schubert    not fall into one of the following categories.  */
515796c8dcSSimon Schubert typedef enum cmd_types
525796c8dcSSimon Schubert   {
535796c8dcSSimon Schubert     not_set_cmd,
545796c8dcSSimon Schubert     set_cmd,
555796c8dcSSimon Schubert     show_cmd
565796c8dcSSimon Schubert   }
575796c8dcSSimon Schubert cmd_types;
585796c8dcSSimon Schubert 
595796c8dcSSimon Schubert /* Types of "set" or "show" command.  */
605796c8dcSSimon Schubert typedef enum var_types
615796c8dcSSimon Schubert   {
625796c8dcSSimon Schubert     /* "on" or "off".  *VAR is an integer which is nonzero for on,
635796c8dcSSimon Schubert        zero for off.  */
645796c8dcSSimon Schubert     var_boolean,
655796c8dcSSimon Schubert 
665796c8dcSSimon Schubert     /* "on" / "true" / "enable" or "off" / "false" / "disable" or
675796c8dcSSimon Schubert        "auto.  *VAR is an ``enum auto_boolean''.  NOTE: In general a
685796c8dcSSimon Schubert        custom show command will need to be implemented - one that for
695796c8dcSSimon Schubert        "auto" prints both the "auto" and the current auto-selected
705796c8dcSSimon Schubert        value.  */
715796c8dcSSimon Schubert     var_auto_boolean,
725796c8dcSSimon Schubert 
73c50c785cSJohn Marino     /* Unsigned Integer.  *VAR is an unsigned int.  The user can type
74c50c785cSJohn Marino        0 to mean "unlimited", which is stored in *VAR as UINT_MAX.  */
755796c8dcSSimon Schubert     var_uinteger,
765796c8dcSSimon Schubert 
77c50c785cSJohn Marino     /* Like var_uinteger but signed.  *VAR is an int.  The user can
78c50c785cSJohn Marino        type 0 to mean "unlimited", which is stored in *VAR as
79*ef5ccd6cSJohn Marino        INT_MAX.  The only remaining use of it is the Python API.
80*ef5ccd6cSJohn Marino        Don't use it elsewhere.  */
815796c8dcSSimon Schubert     var_integer,
825796c8dcSSimon Schubert 
83c50c785cSJohn Marino     /* String which the user enters with escapes (e.g. the user types
84c50c785cSJohn Marino        \n and it is a real newline in the stored string).
855796c8dcSSimon Schubert        *VAR is a malloc'd string, or NULL if the string is empty.  */
865796c8dcSSimon Schubert     var_string,
875796c8dcSSimon Schubert     /* String which stores what the user types verbatim.
885796c8dcSSimon Schubert        *VAR is a malloc'd string, or NULL if the string is empty.  */
895796c8dcSSimon Schubert     var_string_noescape,
905796c8dcSSimon Schubert     /* String which stores a filename.  (*VAR) is a malloc'd string,
915796c8dcSSimon Schubert        or "" if the string was empty.  */
925796c8dcSSimon Schubert     var_optional_filename,
935796c8dcSSimon Schubert     /* String which stores a filename.  (*VAR) is a malloc'd
945796c8dcSSimon Schubert        string.  */
955796c8dcSSimon Schubert     var_filename,
96*ef5ccd6cSJohn Marino     /* ZeroableInteger.  *VAR is an int.  Like var_integer except
975796c8dcSSimon Schubert        that zero really means zero.  */
985796c8dcSSimon Schubert     var_zinteger,
995796c8dcSSimon Schubert     /* ZeroableUnsignedInteger.  *VAR is an unsigned int.  Zero really
1005796c8dcSSimon Schubert        means zero.  */
1015796c8dcSSimon Schubert     var_zuinteger,
102*ef5ccd6cSJohn Marino     /* ZeroableUnsignedInteger with unlimited value.  *VAR is an int,
103*ef5ccd6cSJohn Marino        but its range is [0, INT_MAX].  -1 stands for unlimited and
104*ef5ccd6cSJohn Marino        other negative numbers are not allowed.  */
105*ef5ccd6cSJohn Marino     var_zuinteger_unlimited,
106c50c785cSJohn Marino     /* Enumerated type.  Can only have one of the specified values.
107c50c785cSJohn Marino        *VAR is a char pointer to the name of the element that we
108c50c785cSJohn Marino        find.  */
1095796c8dcSSimon Schubert     var_enum
1105796c8dcSSimon Schubert   }
1115796c8dcSSimon Schubert var_types;
1125796c8dcSSimon Schubert 
1135796c8dcSSimon Schubert /* This structure records one command'd definition.  */
1145796c8dcSSimon Schubert struct cmd_list_element;
1155796c8dcSSimon Schubert 
1165796c8dcSSimon Schubert /* Forward-declarations of the entry-points of cli/cli-decode.c.  */
1175796c8dcSSimon Schubert 
118*ef5ccd6cSJohn Marino /* API to the manipulation of command lists.  */
119*ef5ccd6cSJohn Marino 
120a45ae5f8SJohn Marino extern int valid_user_defined_cmd_name_p (const char *name);
121a45ae5f8SJohn Marino 
1225796c8dcSSimon Schubert extern struct cmd_list_element *add_cmd (char *, enum command_class,
1235796c8dcSSimon Schubert 					 void (*fun) (char *, int), char *,
1245796c8dcSSimon Schubert 					 struct cmd_list_element **);
1255796c8dcSSimon Schubert 
1265796c8dcSSimon Schubert extern struct cmd_list_element *add_alias_cmd (char *, char *,
1275796c8dcSSimon Schubert 					       enum command_class, int,
1285796c8dcSSimon Schubert 					       struct cmd_list_element **);
1295796c8dcSSimon Schubert 
1305796c8dcSSimon Schubert extern struct cmd_list_element *add_prefix_cmd (char *, enum command_class,
1315796c8dcSSimon Schubert 						void (*fun) (char *, int),
1325796c8dcSSimon Schubert 						char *,
1335796c8dcSSimon Schubert 						struct cmd_list_element **,
1345796c8dcSSimon Schubert 						char *, int,
1355796c8dcSSimon Schubert 						struct cmd_list_element **);
1365796c8dcSSimon Schubert 
1375796c8dcSSimon Schubert extern struct cmd_list_element *add_abbrev_prefix_cmd (char *,
1385796c8dcSSimon Schubert 						       enum command_class,
1395796c8dcSSimon Schubert 						       void (*fun) (char *,
1405796c8dcSSimon Schubert 								    int),
1415796c8dcSSimon Schubert 						       char *,
1425796c8dcSSimon Schubert 						       struct cmd_list_element
1435796c8dcSSimon Schubert 						       **, char *, int,
1445796c8dcSSimon Schubert 						       struct cmd_list_element
1455796c8dcSSimon Schubert 						       **);
1465796c8dcSSimon Schubert 
1475796c8dcSSimon Schubert /* Set the commands corresponding callback.  */
1485796c8dcSSimon Schubert 
1495796c8dcSSimon Schubert typedef void cmd_cfunc_ftype (char *args, int from_tty);
1505796c8dcSSimon Schubert extern void set_cmd_cfunc (struct cmd_list_element *cmd,
1515796c8dcSSimon Schubert 			   cmd_cfunc_ftype *cfunc);
1525796c8dcSSimon Schubert 
1535796c8dcSSimon Schubert typedef void cmd_sfunc_ftype (char *args, int from_tty,
1545796c8dcSSimon Schubert 			      struct cmd_list_element *c);
1555796c8dcSSimon Schubert extern void set_cmd_sfunc (struct cmd_list_element *cmd,
1565796c8dcSSimon Schubert 			   cmd_sfunc_ftype *sfunc);
1575796c8dcSSimon Schubert 
158*ef5ccd6cSJohn Marino typedef VEC (char_ptr) *completer_ftype (struct cmd_list_element *,
159*ef5ccd6cSJohn Marino 					 char *, char *);
160*ef5ccd6cSJohn Marino 
161*ef5ccd6cSJohn Marino extern void set_cmd_completer (struct cmd_list_element *, completer_ftype *);
1625796c8dcSSimon Schubert 
1635796c8dcSSimon Schubert /* HACK: cagney/2002-02-23: Code, mostly in tracepoints.c, grubs
1645796c8dcSSimon Schubert    around in cmd objects to test the value of the commands sfunc().  */
1655796c8dcSSimon Schubert extern int cmd_cfunc_eq (struct cmd_list_element *cmd,
1665796c8dcSSimon Schubert 			 void (*cfunc) (char *args, int from_tty));
1675796c8dcSSimon Schubert 
168c50c785cSJohn Marino /* Each command object has a local context attached to it.  */
169c50c785cSJohn Marino extern void set_cmd_context (struct cmd_list_element *cmd,
170c50c785cSJohn Marino 			     void *context);
1715796c8dcSSimon Schubert extern void *get_cmd_context (struct cmd_list_element *cmd);
1725796c8dcSSimon Schubert 
1735796c8dcSSimon Schubert 
1745796c8dcSSimon Schubert /* Execute CMD's pre/post hook.  Throw an error if the command fails.
1755796c8dcSSimon Schubert    If already executing this pre/post hook, or there is no pre/post
1765796c8dcSSimon Schubert    hook, the call is silently ignored.  */
1775796c8dcSSimon Schubert extern void execute_cmd_pre_hook (struct cmd_list_element *cmd);
1785796c8dcSSimon Schubert extern void execute_cmd_post_hook (struct cmd_list_element *cmd);
1795796c8dcSSimon Schubert 
1805796c8dcSSimon Schubert /* Return the type of the command.  */
1815796c8dcSSimon Schubert extern enum cmd_types cmd_type (struct cmd_list_element *cmd);
1825796c8dcSSimon Schubert 
183*ef5ccd6cSJohn Marino /* Flag for an ambiguous cmd_list result.  */
184*ef5ccd6cSJohn Marino #define CMD_LIST_AMBIGUOUS ((struct cmd_list_element *) -1)
1855796c8dcSSimon Schubert 
1865796c8dcSSimon Schubert extern struct cmd_list_element *lookup_cmd (char **,
1875796c8dcSSimon Schubert 					    struct cmd_list_element *, char *,
1885796c8dcSSimon Schubert 					    int, int);
1895796c8dcSSimon Schubert 
1905796c8dcSSimon Schubert extern struct cmd_list_element *lookup_cmd_1 (char **,
1915796c8dcSSimon Schubert 					      struct cmd_list_element *,
1925796c8dcSSimon Schubert 					      struct cmd_list_element **,
1935796c8dcSSimon Schubert 					      int);
1945796c8dcSSimon Schubert 
195c50c785cSJohn Marino extern struct cmd_list_element *deprecate_cmd (struct cmd_list_element *,
196c50c785cSJohn Marino 					       char * );
1975796c8dcSSimon Schubert 
198c50c785cSJohn Marino extern void deprecated_cmd_warning (char **);
1995796c8dcSSimon Schubert 
200c50c785cSJohn Marino extern int lookup_cmd_composition (char *text,
2015796c8dcSSimon Schubert 				   struct cmd_list_element **alias,
2025796c8dcSSimon Schubert 				   struct cmd_list_element **prefix_cmd,
2035796c8dcSSimon Schubert 				   struct cmd_list_element **cmd);
2045796c8dcSSimon Schubert 
2055796c8dcSSimon Schubert extern struct cmd_list_element *add_com (char *, enum command_class,
206c50c785cSJohn Marino 					 void (*fun) (char *, int),
207c50c785cSJohn Marino 					 char *);
2085796c8dcSSimon Schubert 
2095796c8dcSSimon Schubert extern struct cmd_list_element *add_com_alias (char *, char *,
2105796c8dcSSimon Schubert 					       enum command_class, int);
2115796c8dcSSimon Schubert 
212c50c785cSJohn Marino extern struct cmd_list_element *add_info (char *,
213c50c785cSJohn Marino 					  void (*fun) (char *, int),
2145796c8dcSSimon Schubert 					  char *);
2155796c8dcSSimon Schubert 
2165796c8dcSSimon Schubert extern struct cmd_list_element *add_info_alias (char *, char *, int);
2175796c8dcSSimon Schubert 
218*ef5ccd6cSJohn Marino extern VEC (char_ptr) *complete_on_cmdlist (struct cmd_list_element *,
219*ef5ccd6cSJohn Marino 					    char *, char *, int);
220*ef5ccd6cSJohn Marino 
221*ef5ccd6cSJohn Marino extern VEC (char_ptr) *complete_on_enum (const char *const *enumlist,
222c50c785cSJohn Marino 					 char *, char *);
2235796c8dcSSimon Schubert 
224*ef5ccd6cSJohn Marino /* Functions that implement commands about CLI commands.  */
2255796c8dcSSimon Schubert 
2265796c8dcSSimon Schubert extern void help_list (struct cmd_list_element *, char *,
2275796c8dcSSimon Schubert 		       enum command_class, struct ui_file *);
2285796c8dcSSimon Schubert 
2295796c8dcSSimon Schubert /* Method for show a set/show variable's VALUE on FILE.  If this
2305796c8dcSSimon Schubert    method isn't supplied deprecated_show_value_hack() is called (which
2315796c8dcSSimon Schubert    is not good).  */
2325796c8dcSSimon Schubert typedef void (show_value_ftype) (struct ui_file *file,
2335796c8dcSSimon Schubert 				 int from_tty,
2345796c8dcSSimon Schubert 				 struct cmd_list_element *cmd,
2355796c8dcSSimon Schubert 				 const char *value);
2365796c8dcSSimon Schubert /* NOTE: i18n: This function is not i18n friendly.  Callers should
2375796c8dcSSimon Schubert    instead print the value out directly.  */
2385796c8dcSSimon Schubert extern show_value_ftype deprecated_show_value_hack;
2395796c8dcSSimon Schubert 
2405796c8dcSSimon Schubert extern void add_setshow_enum_cmd (char *name,
2415796c8dcSSimon Schubert 				  enum command_class class,
242*ef5ccd6cSJohn Marino 				  const char *const *enumlist,
2435796c8dcSSimon Schubert 				  const char **var,
2445796c8dcSSimon Schubert 				  const char *set_doc,
2455796c8dcSSimon Schubert 				  const char *show_doc,
2465796c8dcSSimon Schubert 				  const char *help_doc,
2475796c8dcSSimon Schubert 				  cmd_sfunc_ftype *set_func,
2485796c8dcSSimon Schubert 				  show_value_ftype *show_func,
2495796c8dcSSimon Schubert 				  struct cmd_list_element **set_list,
2505796c8dcSSimon Schubert 				  struct cmd_list_element **show_list);
2515796c8dcSSimon Schubert 
2525796c8dcSSimon Schubert extern void add_setshow_auto_boolean_cmd (char *name,
2535796c8dcSSimon Schubert 					  enum command_class class,
2545796c8dcSSimon Schubert 					  enum auto_boolean *var,
2555796c8dcSSimon Schubert 					  const char *set_doc,
2565796c8dcSSimon Schubert 					  const char *show_doc,
2575796c8dcSSimon Schubert 					  const char *help_doc,
2585796c8dcSSimon Schubert 					  cmd_sfunc_ftype *set_func,
2595796c8dcSSimon Schubert 					  show_value_ftype *show_func,
2605796c8dcSSimon Schubert 					  struct cmd_list_element **set_list,
2615796c8dcSSimon Schubert 					  struct cmd_list_element **show_list);
2625796c8dcSSimon Schubert 
2635796c8dcSSimon Schubert extern void add_setshow_boolean_cmd (char *name,
2645796c8dcSSimon Schubert 				     enum command_class class,
2655796c8dcSSimon Schubert 				     int *var,
2665796c8dcSSimon Schubert 				     const char *set_doc, const char *show_doc,
2675796c8dcSSimon Schubert 				     const char *help_doc,
2685796c8dcSSimon Schubert 				     cmd_sfunc_ftype *set_func,
2695796c8dcSSimon Schubert 				     show_value_ftype *show_func,
2705796c8dcSSimon Schubert 				     struct cmd_list_element **set_list,
2715796c8dcSSimon Schubert 				     struct cmd_list_element **show_list);
2725796c8dcSSimon Schubert 
2735796c8dcSSimon Schubert extern void add_setshow_filename_cmd (char *name,
2745796c8dcSSimon Schubert 				      enum command_class class,
2755796c8dcSSimon Schubert 				      char **var,
2765796c8dcSSimon Schubert 				      const char *set_doc,
2775796c8dcSSimon Schubert 				      const char *show_doc,
2785796c8dcSSimon Schubert 				      const char *help_doc,
2795796c8dcSSimon Schubert 				      cmd_sfunc_ftype *set_func,
2805796c8dcSSimon Schubert 				      show_value_ftype *show_func,
2815796c8dcSSimon Schubert 				      struct cmd_list_element **set_list,
2825796c8dcSSimon Schubert 				      struct cmd_list_element **show_list);
2835796c8dcSSimon Schubert 
2845796c8dcSSimon Schubert extern void add_setshow_string_cmd (char *name,
2855796c8dcSSimon Schubert 				    enum command_class class,
2865796c8dcSSimon Schubert 				    char **var,
2875796c8dcSSimon Schubert 				    const char *set_doc,
2885796c8dcSSimon Schubert 				    const char *show_doc,
2895796c8dcSSimon Schubert 				    const char *help_doc,
2905796c8dcSSimon Schubert 				    cmd_sfunc_ftype *set_func,
2915796c8dcSSimon Schubert 				    show_value_ftype *show_func,
2925796c8dcSSimon Schubert 				    struct cmd_list_element **set_list,
2935796c8dcSSimon Schubert 				    struct cmd_list_element **show_list);
2945796c8dcSSimon Schubert 
295*ef5ccd6cSJohn Marino extern struct cmd_list_element *add_setshow_string_noescape_cmd
296*ef5ccd6cSJohn Marino 		      (char *name,
2975796c8dcSSimon Schubert 		       enum command_class class,
2985796c8dcSSimon Schubert 		       char **var,
2995796c8dcSSimon Schubert 		       const char *set_doc,
3005796c8dcSSimon Schubert 		       const char *show_doc,
3015796c8dcSSimon Schubert 		       const char *help_doc,
3025796c8dcSSimon Schubert 		       cmd_sfunc_ftype *set_func,
3035796c8dcSSimon Schubert 		       show_value_ftype *show_func,
3045796c8dcSSimon Schubert 		       struct cmd_list_element **set_list,
3055796c8dcSSimon Schubert 		       struct cmd_list_element **show_list);
3065796c8dcSSimon Schubert 
3075796c8dcSSimon Schubert extern void add_setshow_optional_filename_cmd (char *name,
3085796c8dcSSimon Schubert 					       enum command_class class,
3095796c8dcSSimon Schubert 					       char **var,
3105796c8dcSSimon Schubert 					       const char *set_doc,
3115796c8dcSSimon Schubert 					       const char *show_doc,
3125796c8dcSSimon Schubert 					       const char *help_doc,
3135796c8dcSSimon Schubert 					       cmd_sfunc_ftype *set_func,
3145796c8dcSSimon Schubert 					       show_value_ftype *show_func,
3155796c8dcSSimon Schubert 					       struct cmd_list_element **set_list,
3165796c8dcSSimon Schubert 					       struct cmd_list_element **show_list);
3175796c8dcSSimon Schubert 
3185796c8dcSSimon Schubert extern void add_setshow_integer_cmd (char *name,
3195796c8dcSSimon Schubert 				     enum command_class class,
3205796c8dcSSimon Schubert 				     int *var,
3215796c8dcSSimon Schubert 				     const char *set_doc,
3225796c8dcSSimon Schubert 				     const char *show_doc,
3235796c8dcSSimon Schubert 				     const char *help_doc,
3245796c8dcSSimon Schubert 				     cmd_sfunc_ftype *set_func,
3255796c8dcSSimon Schubert 				     show_value_ftype *show_func,
3265796c8dcSSimon Schubert 				     struct cmd_list_element **set_list,
3275796c8dcSSimon Schubert 				     struct cmd_list_element **show_list);
3285796c8dcSSimon Schubert 
3295796c8dcSSimon Schubert extern void add_setshow_uinteger_cmd (char *name,
3305796c8dcSSimon Schubert 				      enum command_class class,
3315796c8dcSSimon Schubert 				      unsigned int *var,
3325796c8dcSSimon Schubert 				      const char *set_doc,
3335796c8dcSSimon Schubert 				      const char *show_doc,
3345796c8dcSSimon Schubert 				      const char *help_doc,
3355796c8dcSSimon Schubert 				      cmd_sfunc_ftype *set_func,
3365796c8dcSSimon Schubert 				      show_value_ftype *show_func,
3375796c8dcSSimon Schubert 				      struct cmd_list_element **set_list,
3385796c8dcSSimon Schubert 				      struct cmd_list_element **show_list);
3395796c8dcSSimon Schubert 
3405796c8dcSSimon Schubert extern void add_setshow_zinteger_cmd (char *name,
3415796c8dcSSimon Schubert 				      enum command_class class,
3425796c8dcSSimon Schubert 				      int *var,
3435796c8dcSSimon Schubert 				      const char *set_doc,
3445796c8dcSSimon Schubert 				      const char *show_doc,
3455796c8dcSSimon Schubert 				      const char *help_doc,
3465796c8dcSSimon Schubert 				      cmd_sfunc_ftype *set_func,
3475796c8dcSSimon Schubert 				      show_value_ftype *show_func,
3485796c8dcSSimon Schubert 				      struct cmd_list_element **set_list,
3495796c8dcSSimon Schubert 				      struct cmd_list_element **show_list);
3505796c8dcSSimon Schubert 
3515796c8dcSSimon Schubert extern void add_setshow_zuinteger_cmd (char *name,
3525796c8dcSSimon Schubert 				       enum command_class class,
3535796c8dcSSimon Schubert 				       unsigned int *var,
3545796c8dcSSimon Schubert 				       const char *set_doc,
3555796c8dcSSimon Schubert 				       const char *show_doc,
3565796c8dcSSimon Schubert 				       const char *help_doc,
3575796c8dcSSimon Schubert 				       cmd_sfunc_ftype *set_func,
3585796c8dcSSimon Schubert 				       show_value_ftype *show_func,
3595796c8dcSSimon Schubert 				       struct cmd_list_element **set_list,
3605796c8dcSSimon Schubert 				       struct cmd_list_element **show_list);
3615796c8dcSSimon Schubert 
362*ef5ccd6cSJohn Marino extern void
363*ef5ccd6cSJohn Marino   add_setshow_zuinteger_unlimited_cmd (char *name,
364*ef5ccd6cSJohn Marino 				       enum command_class class,
365*ef5ccd6cSJohn Marino 				       int *var,
366*ef5ccd6cSJohn Marino 				       const char *set_doc,
367*ef5ccd6cSJohn Marino 				       const char *show_doc,
368*ef5ccd6cSJohn Marino 				       const char *help_doc,
369*ef5ccd6cSJohn Marino 				       cmd_sfunc_ftype *set_func,
370*ef5ccd6cSJohn Marino 				       show_value_ftype *show_func,
371*ef5ccd6cSJohn Marino 				       struct cmd_list_element **set_list,
372*ef5ccd6cSJohn Marino 				       struct cmd_list_element **show_list);
373*ef5ccd6cSJohn Marino 
3745796c8dcSSimon Schubert /* Do a "show" command for each thing on a command list.  */
3755796c8dcSSimon Schubert 
3765796c8dcSSimon Schubert extern void cmd_show_list (struct cmd_list_element *, int, char *);
3775796c8dcSSimon Schubert 
378cf7f2e2dSJohn Marino /* Used everywhere whenever at least one parameter is required and
379cf7f2e2dSJohn Marino    none is specified.  */
380cf7f2e2dSJohn Marino 
381cf7f2e2dSJohn Marino extern void error_no_arg (char *) ATTRIBUTE_NORETURN;
3825796c8dcSSimon Schubert 
3835796c8dcSSimon Schubert extern void dont_repeat (void);
3845796c8dcSSimon Schubert 
385c50c785cSJohn Marino extern struct cleanup *prevent_dont_repeat (void);
386c50c785cSJohn Marino 
3875796c8dcSSimon Schubert /* Used to mark commands that don't do anything.  If we just leave the
3885796c8dcSSimon Schubert    function field NULL, the command is interpreted as a help topic, or
3895796c8dcSSimon Schubert    as a class of commands.  */
3905796c8dcSSimon Schubert 
3915796c8dcSSimon Schubert extern void not_just_help_class_command (char *, int);
3925796c8dcSSimon Schubert 
393c50c785cSJohn Marino /* Check function pointer.  */
3945796c8dcSSimon Schubert extern int cmd_func_p (struct cmd_list_element *cmd);
3955796c8dcSSimon Schubert 
396c50c785cSJohn Marino /* Call the command function.  */
397c50c785cSJohn Marino extern void cmd_func (struct cmd_list_element *cmd,
398c50c785cSJohn Marino 		      char *args, int from_tty);
3995796c8dcSSimon Schubert 
4005796c8dcSSimon Schubert #endif /* !defined (COMMAND_H) */
401