mirror of
https://github.com/ksherlock/mpw-shell.git
synced 2024-09-27 18:58:56 +00:00
lunix/gcc updates.
This commit is contained in:
parent
469f0a23c1
commit
f8c596668f
@ -20,6 +20,7 @@
|
|||||||
#include <sysexits.h>
|
#include <sysexits.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
|
#include <sys/wait.h>
|
||||||
|
|
||||||
extern std::atomic<int> control_c;
|
extern std::atomic<int> control_c;
|
||||||
|
|
||||||
|
@ -177,7 +177,7 @@ namespace {
|
|||||||
|
|
||||||
void Environment::echo(const char *fmt, ...) const {
|
void Environment::echo(const char *fmt, ...) const {
|
||||||
if (_echo && !_startup) {
|
if (_echo && !_startup) {
|
||||||
for (unsigned i = 0; i < _indent; ++i) {
|
for (unsigned i = 0; i <= _indent; ++i) {
|
||||||
fputc(' ', stderr);
|
fputc(' ', stderr);
|
||||||
fputc(' ', stderr);
|
fputc(' ', stderr);
|
||||||
}
|
}
|
||||||
|
@ -68,21 +68,21 @@ public:
|
|||||||
|
|
||||||
std::string get(const std::string &k) const;
|
std::string get(const std::string &k) const;
|
||||||
|
|
||||||
constexpr bool echo() const noexcept { return _echo; }
|
bool echo() const noexcept { return _echo; }
|
||||||
constexpr bool test() const noexcept { return _test; }
|
bool test() const noexcept { return _test; }
|
||||||
constexpr bool exit() const noexcept { return _exit; }
|
bool exit() const noexcept { return _exit; }
|
||||||
constexpr int status() const noexcept { return _status; }
|
int status() const noexcept { return _status; }
|
||||||
constexpr int pound() const noexcept { return _pound; }
|
int pound() const noexcept { return _pound; }
|
||||||
|
|
||||||
int status(int i, bool throw_up = true);
|
int status(int i, bool throw_up = true);
|
||||||
int status(int i, const std::nothrow_t &);
|
int status(int i, const std::nothrow_t &);
|
||||||
|
|
||||||
constexpr bool startup() const noexcept { return _startup; }
|
bool startup() const noexcept { return _startup; }
|
||||||
constexpr void startup(bool tf) noexcept { _startup = tf; }
|
void startup(bool tf) noexcept { _startup = tf; }
|
||||||
|
|
||||||
|
|
||||||
constexpr bool passthrough() const noexcept { return _passthrough; }
|
bool passthrough() const noexcept { return _passthrough; }
|
||||||
constexpr void passthrough(bool tf) noexcept { _passthrough = tf; }
|
void passthrough(bool tf) noexcept { _passthrough = tf; }
|
||||||
|
|
||||||
template<class FX>
|
template<class FX>
|
||||||
void foreach(FX && fx) { for (const auto &kv : _table) { fx(kv.first, kv.second); }}
|
void foreach(FX && fx) { for (const auto &kv : _table) { fx(kv.first, kv.second); }}
|
||||||
@ -117,7 +117,7 @@ public:
|
|||||||
catch (...) { _indent = i; _loop = j; throw; }
|
catch (...) { _indent = i; _loop = j; throw; }
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr bool loop() const noexcept { return _loop; }
|
bool loop() const noexcept { return _loop; }
|
||||||
|
|
||||||
const alias_table_type &aliases() const { return _alias_table; }
|
const alias_table_type &aliases() const { return _alias_table; }
|
||||||
|
|
||||||
|
2
error.h
2
error.h
@ -12,7 +12,7 @@ public:
|
|||||||
mpw_error(int status, const char *s) : std::runtime_error(s), _status(status)
|
mpw_error(int status, const char *s) : std::runtime_error(s), _status(status)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
constexpr int status() const noexcept { return _status; }
|
int status() const noexcept { return _status; }
|
||||||
private:
|
private:
|
||||||
int _status;
|
int _status;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user