forked from bminor/bash
-
Notifications
You must be signed in to change notification settings - Fork 0
/
builtins.hh
54 lines (41 loc) · 1.81 KB
/
builtins.hh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/* builtins.hh -- What a builtin looks like, and where to find them. */
/* Copyright (C) 1987-2009 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
Bash is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Bash is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Bash. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef BUILTINS_H
#define BUILTINS_H
#include "bashtypes.hh"
namespace bash
{
/* Flags describing various things about a builtin. */
enum builtin_flags
{
BUILTIN_ENABLED = 0x01, // This builtin is enabled.
BUILTIN_DELETED = 0x02, // This has been deleted with enable -d.
STATIC_BUILTIN = 0x04, // This builtin is not dynamically loaded.
SPECIAL_BUILTIN = 0x08, // This is a Posix `special' builtin.
ASSIGNMENT_BUILTIN = 0x10, // This builtin takes assignment statements.
POSIX_BUILTIN
= 0x20, // This builtin is special in the Posix command search order.
LOCALVAR_BUILTIN = 0x40, // This builtin creates local variables.
ARRAYREF_BUILTIN = 0x80 // This builtin takes array references as arguments.
};
static inline builtin_flags
operator| (const builtin_flags &a, const builtin_flags &b)
{
return static_cast<builtin_flags> (static_cast<uint32_t> (a)
| static_cast<uint32_t> (b));
}
constexpr int BASE_INDENT = 4;
} // namespace bash
#endif /* BUILTINS_H */