]> git.ipfire.org Git - thirdparty/bash.git/blame - builtins/common.h
Imported from ../bash-2.05.tar.gz.
[thirdparty/bash.git] / builtins / common.h
CommitLineData
726f6388
JA
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
bb70624e 19 Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
726f6388
JA
20
21#if !defined (__COMMON_H)
22# define __COMMON_H
23
bb70624e 24#include "stdc.h"
ccc6cda3 25
726f6388
JA
26#define ISOPTION(s, c) (s[0] == '-' && !s[2] && s[1] == c)
27
d166f048
JA
28/* Flag values for parse_and_execute () */
29#define SEVAL_NONINT 0x01
30#define SEVAL_INTERACT 0x02
31#define SEVAL_NOHIST 0x04
32
cce855bc 33/* Functions from common.c */
ccc6cda3 34extern void builtin_error __P((const char *, ...));
cce855bc
JA
35extern void builtin_usage __P((void));
36extern void no_args __P((WORD_LIST *));
37extern void bad_option __P((char *));
38extern int no_options __P((WORD_LIST *));
39
40extern char **make_builtin_argv __P((WORD_LIST *, int *));
41extern void remember_args __P((WORD_LIST *, int));
42
43extern void push_context __P((void));
44extern void pop_context __P((void));
45extern void push_dollar_vars __P((void));
46extern void pop_dollar_vars __P((void));
47extern void dispose_saved_dollar_vars __P((void));
48extern int dollar_vars_changed __P((void));
49extern void set_dollar_vars_unchanged __P((void));
50extern void set_dollar_vars_changed __P((void));
51
52extern int get_numeric_arg __P((WORD_LIST *, int));
53extern int read_octal __P((char *));
726f6388
JA
54
55/* Keeps track of the current working directory. */
56extern char *the_current_working_directory;
cce855bc
JA
57extern char *get_working_directory __P((char *));
58extern void set_working_directory __P((char *));
726f6388
JA
59
60#if defined (JOB_CONTROL)
cce855bc 61extern int get_job_spec __P((WORD_LIST *));
726f6388 62#endif
cce855bc 63extern int display_signal_list __P((WORD_LIST *, int));
726f6388
JA
64
65/* It's OK to declare a function as returning a Function * without
66 providing a definition of what a `Function' is. */
cce855bc
JA
67extern struct builtin *builtin_address_internal __P((char *, int));
68extern Function *find_shell_builtin __P((char *));
69extern Function *builtin_address __P((char *));
70extern Function *find_special_builtin __P((char *));
71extern void initialize_shell_builtins __P((void));
726f6388 72
ccc6cda3 73/* Functions from set.def */
cce855bc
JA
74extern void initialize_shell_options __P((int));
75extern void list_minus_o_opts __P((int, int));
76extern int set_minus_o_option __P((int, char *));
77extern int minus_o_option_value __P((char *));
78extern void reset_shell_options __P((void));
bb70624e 79extern char **get_minus_o_opts __P((void));
d166f048
JA
80
81/* Functions from shopt.def */
cce855bc 82extern void reset_shopt_options __P((void));
bb70624e 83extern char **get_shopt_options __P((void));
ccc6cda3
JA
84
85/* Functions from type.def */
cce855bc 86extern int describe_command __P((char *, int, int));
ccc6cda3
JA
87
88/* Functions from setattr.def */
cce855bc
JA
89extern int set_or_show_attributes __P((WORD_LIST *, int, int));
90extern int show_var_attributes __P((SHELL_VAR *, int, int));
91extern int show_name_attributes __P((char *, int));
92extern void set_var_attribute __P((char *, int, int));
ccc6cda3
JA
93
94/* Functions from pushd.def */
cce855bc
JA
95extern char *get_dirstack_from_string __P((char *));
96extern char *get_dirstack_element __P((int, int));
97extern void set_dirstack_element __P((int, int, char *));
98extern WORD_LIST *get_directory_stack __P((void));
ccc6cda3
JA
99
100/* Functions from evalstring.c */
cce855bc
JA
101extern int parse_and_execute __P((char *, char *, int));
102extern void parse_and_execute_cleanup __P((void));
ccc6cda3
JA
103
104/* Functions from evalfile.c */
105extern int maybe_execute_file __P((char *, int));
106extern int source_file __P((char *));
28ef6c31 107extern int fc_execute_file __P((char *));
726f6388
JA
108
109#endif /* !__COMMON_H */