eec5444edfaedd0e7df368d2db8e3a28878f8d5d
[platform/upstream/bash.git] / builtins / common.h
1 /* common.h -- extern declarations for functions defined in common.c. */
2
3 /* Copyright (C) 1993 Free Software Foundation, Inc.
4
5    This file is part of GNU Bash, the Bourne Again SHell.
6
7    Bash is free software; you can redistribute it and/or modify it under
8    the terms of the GNU General Public License as published by the Free
9    Software Foundation; either version 2, or (at your option) any later
10    version.
11
12    Bash is distributed in the hope that it will be useful, but WITHOUT ANY
13    WARRANTY; without even the implied warranty of MERCHANTABILITY or
14    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
15    for more details.
16
17    You should have received a copy of the GNU General Public License along
18    with Bash; see the file COPYING.  If not, write to the Free Software
19    Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
20
21 #if  !defined (__COMMON_H)
22 #  define __COMMON_H
23
24 #include "../stdc.h"
25
26 #define ISOPTION(s, c)  (s[0] == '-' && !s[2] && s[1] == c)
27
28 /* Flag values for parse_and_execute () */
29 #define SEVAL_NONINT    0x01
30 #define SEVAL_INTERACT  0x02
31 #define SEVAL_NOHIST    0x04
32
33 extern void builtin_error __P((const char *, ...));
34 extern void builtin_usage ();
35 extern void bad_option ();
36
37 extern char **make_builtin_argv ();
38
39 extern int get_numeric_arg ();
40 extern void remember_args ();
41 extern void no_args ();
42 extern int no_options ();
43
44 extern int read_octal ();
45
46 extern void push_context (), pop_context ();
47 extern void push_dollar_vars (), pop_dollar_vars ();
48 extern void dispose_saved_dollar_vars ();
49 extern int dollar_vars_changed ();
50 extern void set_dollar_vars_unchanged (), set_dollar_vars_changed ();
51
52 /* Keeps track of the current working directory. */
53 extern char *the_current_working_directory;
54 extern char *get_working_directory ();
55 extern void set_working_directory ();
56
57 #if defined (JOB_CONTROL)
58 extern int get_job_spec ();
59 #endif
60
61 extern int display_signal_list ();
62
63 /* It's OK to declare a function as returning a Function * without
64    providing a definition of what a `Function' is. */
65 extern struct builtin *builtin_address_internal ();
66 extern Function *find_shell_builtin ();
67 extern Function *builtin_address ();
68 extern Function *find_special_builtin ();
69
70 extern void initialize_shell_builtins ();
71
72 extern char *single_quote ();
73 extern char *double_quote ();
74 extern char *backslash_quote ();
75 extern int contains_shell_metas ();
76
77 /* Functions from set.def */
78 extern void initialize_shell_options ();
79 extern void list_minus_o_opts ();
80 extern int set_minus_o_option ();
81 extern int minus_o_option_value ();
82 extern void reset_shell_options ();
83
84 /* Functions from shopt.def */
85 extern void reset_shopt_options ();
86
87 /* Functions from type.def */
88 extern int describe_command ();
89
90 /* Functions from setattr.def */
91 extern int set_or_show_attributes ();
92 extern int show_var_attributes ();
93 extern int show_name_attributes ();
94 extern void set_var_attribute ();
95
96 /* Functions from pushd.def */
97 extern char *get_dirstack_element ();
98 extern void set_dirstack_element ();
99 extern WORD_LIST *get_directory_stack ();
100
101 /* Functions from evalstring.c */
102 extern int parse_and_execute ();
103 extern void parse_and_execute_cleanup ();
104
105 /* Functions from evalfile.c */
106 extern int maybe_execute_file __P((char *, int));
107 extern int source_file __P((char *));
108
109 #endif /* !__COMMON_H */