# include "../bashhist.h"
#endif
-extern int interactive;
extern int noclobber, posixly_correct, ignoreeof, eof_encountered_limit;
+#if defined (HISTORY)
+extern int dont_save_function_defs;
+#endif
#if defined (READLINE)
extern int no_line_editing;
#endif /* READLINE */
noclobber same as -C
noexec same as -n
noglob same as -f
+ nolog currently accepted but ignored
notify same as -b
nounset same as -u
onecmd same as -t
ARGs are given, all shell variables are printed.
$END
-static int set_ignoreeof ();
-static int set_posix_mode ();
+static void print_minus_o_option __P((char *, int, int));
+static void print_all_shell_variables __P((void));
+
+static int set_ignoreeof __P((int, char *));
+static int set_posix_mode __P((int, char *));
#if defined (READLINE)
-static int set_edit_mode ();
-static int get_edit_mode ();
+static int set_edit_mode __P((int, char *));
+static int get_edit_mode __P((char *));
#endif
#if defined (HISTORY)
-static int bash_set_history ();
+static int bash_set_history __P((int, char *));
#endif
static char *on = "on";
{(char *)NULL, 0 },
};
+typedef int setopt_set_func_t __P((int, char *));
+typedef int setopt_get_func_t __P((char *));
+
struct {
char *name;
int *variable;
- Function *set_func;
- Function *get_func;
+ setopt_set_func_t *set_func;
+ setopt_get_func_t *get_func;
} binary_o_options[] = {
#if defined (HISTORY)
- { "history", &remember_on_history, bash_set_history, (Function *)NULL },
+ { "history", &remember_on_history, bash_set_history, (setopt_get_func_t *)NULL },
+#endif
+ { "ignoreeof", &ignoreeof, set_ignoreeof, (setopt_get_func_t *)NULL },
+ { "interactive-comments", &interactive_comments, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
+#if defined (HISTORY)
+ { "nolog", &dont_save_function_defs, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
#endif
- { "ignoreeof", &ignoreeof, set_ignoreeof, (Function *)NULL },
- { "interactive-comments", &interactive_comments, (Function *)NULL, (Function *)NULL },
- { "posix", &posixly_correct, set_posix_mode, (Function *)NULL },
+ { "posix", &posixly_correct, set_posix_mode, (setopt_get_func_t *)NULL },
#if defined (READLINE)
{ "emacs", (int *)NULL, set_edit_mode, get_edit_mode },
{ "vi", (int *)NULL, set_edit_mode, get_edit_mode },
#endif
- { (char *)NULL, (int *)NULL }
+ { (char *)NULL, (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL }
};
#define GET_BINARY_O_OPTION_VALUE(i, name) \
char *option_name;
{
int option_char;
- VFunction *set_func;
register int i;
for (i = 0; binary_o_options[i].name; i++)
}
}
- for (i = 0, option_char = -1, set_func = 0; o_options[i].name; i++)
+ for (i = 0, option_char = -1; o_options[i].name; i++)
{
if (STREQ (option_name, o_options[i].name))
{
if (GET_BINARY_O_OPTION_VALUE (i, binary_o_options[i].name))
vsize += strlen (binary_o_options[i].name) + 1;
- value = xmalloc (vsize + 1);
+ value = (char *)xmalloc (vsize + 1);
for (i = vptr = 0; o_options[i].name; i++)
{
name = list->word->word;
#if defined (ARRAY_VARS)
+ unset_array = 0;
if (!unset_function && valid_array_reference (name))
{
t = strchr (name, '[');