IWYU-guided #include rejiggering.

Let's hope this doesn't causes build failures for e.g. musl: I just
know it's good on macOS and our Linux CI.

It's been a long time.

One fix this brings, is I discovered we #include assert.h or cassert
in a lot of places. If those ever happen to be in a file that doesn't
include common.h, or we are before common.h gets included, we're
unawaringly working with the system 'assert' macro again, which
may get disabled for debug builds or at least has different
behavior on crash. We undef 'assert' and redefine it in common.h.

Those were all eliminated, except in one catch-22 spot for
maybe.h: it can't include common.h. A fix might be to
make a fish_assert.h that *usually* common.h exports.
This commit is contained in:
Aaron Gyes 2022-08-20 23:14:48 -07:00
parent 1d81ec3730
commit 14d2a6d8ff
158 changed files with 632 additions and 582 deletions

View file

@ -3,12 +3,18 @@
#include "ast.h" #include "ast.h"
#include <array> #include <array>
#include <algorithm>
#include <cstdarg>
#include <cstdlib>
#include <string>
#include "common.h" #include "common.h"
#include "enum_map.h"
#include "flog.h" #include "flog.h"
#include "parse_constants.h" #include "parse_constants.h"
#include "parse_tree.h" #include "parse_tree.h"
#include "wutil.h" #include "tokenizer.h"
#include "wutil.h" // IWYU pragma: keep
namespace { namespace {

View file

@ -3,16 +3,20 @@
#ifndef FISH_AST_H #ifndef FISH_AST_H
#define FISH_AST_H #define FISH_AST_H
#include <array> #include <cstddef>
#include <tuple> #include <cstdint>
#include <initializer_list>
#include <iterator>
#include <memory>
#include <type_traits> #include <type_traits>
#include <utility>
#include <vector>
#include "flog.h" #include "common.h"
#include "maybe.h"
#include "parse_constants.h" #include "parse_constants.h"
#include "tokenizer.h"
namespace ast { namespace ast {
/** /**
* This defines the fish abstract syntax tree. * This defines the fish abstract syntax tree.
* The fish ast is a tree data structure. The nodes of the tree * The fish ast is a tree data structure. The nodes of the tree

View file

@ -3,11 +3,15 @@
#include "autoload.h" #include "autoload.h"
#include <algorithm>
#include <chrono> #include <chrono>
#include <functional>
#include <utility>
#include <vector>
#include "common.h" #include "common.h"
#include "env.h" #include "env.h"
#include "exec.h" #include "io.h"
#include "lru.h" #include "lru.h"
#include "parser.h" #include "parser.h"
#include "wutil.h" // IWYU pragma: keep #include "wutil.h" // IWYU pragma: keep

View file

@ -4,13 +4,14 @@
#include "config.h" // IWYU pragma: keep #include "config.h" // IWYU pragma: keep
#include <cassert> #include <cstddef>
#include <memory> #include <memory>
#include <string>
#include <unordered_map> #include <unordered_map>
#include <unordered_set> #include <unordered_set>
#include "common.h" #include "common.h"
#include "env.h" #include "maybe.h"
#include "wutil.h" #include "wutil.h"
class autoload_file_cache_t; class autoload_file_cache_t;

View file

@ -22,11 +22,10 @@
#include <unistd.h> #include <unistd.h>
#include <algorithm>
#include <cerrno> #include <cerrno>
#include <cstdlib>
#include <cstring> #include <cstring>
#include <cwchar> #include <cwchar>
#include <deque>
#include <memory> #include <memory>
#include <string> #include <string>
@ -66,12 +65,11 @@
#include "builtins/type.h" #include "builtins/type.h"
#include "builtins/ulimit.h" #include "builtins/ulimit.h"
#include "builtins/wait.h" #include "builtins/wait.h"
#include "common.h"
#include "complete.h" #include "complete.h"
#include "exec.h"
#include "fallback.h" // IWYU pragma: keep #include "fallback.h" // IWYU pragma: keep
#include "flog.h" #include "flog.h"
#include "io.h" #include "io.h"
#include "null_terminated_array.h"
#include "parse_constants.h" #include "parse_constants.h"
#include "parse_util.h" #include "parse_util.h"
#include "parser.h" #include "parser.h"

View file

@ -2,13 +2,12 @@
#ifndef FISH_BUILTIN_H #ifndef FISH_BUILTIN_H
#define FISH_BUILTIN_H #define FISH_BUILTIN_H
#include <stddef.h>
#include <vector> #include <vector>
#include "common.h" #include "common.h"
#include "complete.h"
#include "maybe.h"
class completion_t;
class parser_t; class parser_t;
class proc_status_t; class proc_status_t;
class output_stream_t; class output_stream_t;

View file

@ -5,9 +5,7 @@
#include "argparse.h" #include "argparse.h"
#include <algorithm>
#include <cerrno> #include <cerrno>
#include <cstddef>
#include <cstdint> #include <cstdint>
#include <cwchar> #include <cwchar>
#include <memory> #include <memory>
@ -22,6 +20,7 @@
#include "../exec.h" #include "../exec.h"
#include "../fallback.h" // IWYU pragma: keep #include "../fallback.h" // IWYU pragma: keep
#include "../io.h" #include "../io.h"
#include "../maybe.h"
#include "../parser.h" #include "../parser.h"
#include "../wcstringutil.h" #include "../wcstringutil.h"
#include "../wgetopt.h" // IWYU pragma: keep #include "../wgetopt.h" // IWYU pragma: keep

View file

@ -4,14 +4,16 @@
#include "bg.h" #include "bg.h"
#include <cerrno> #include <cerrno>
#include <cstdlib> #include <deque>
#include <memory> #include <memory>
#include <sys/types.h>
#include <vector> #include <vector>
#include "../builtin.h" #include "../builtin.h"
#include "../common.h" #include "../common.h"
#include "../fallback.h" // IWYU pragma: keep #include "../fallback.h" // IWYU pragma: keep
#include "../io.h" #include "../io.h"
#include "../maybe.h"
#include "../job_group.h" #include "../job_group.h"
#include "../parser.h" #include "../parser.h"
#include "../proc.h" #include "../proc.h"

View file

@ -5,18 +5,18 @@
#include <cerrno> #include <cerrno>
#include <cstddef> #include <cstddef>
#include <memory>
#include <set> #include <set>
#include <string> #include <string>
#include <vector> #include <vector>
#include "../builtin.h" #include "../builtin.h"
#include "../common.h" #include "../common.h"
#include "../fallback.h" // IWYU pragma: keep #include "../fallback.h" // IWYU pragma: keep
#include "../input.h" // IWYU pragma: keep #include "../input.h"
#include "../io.h" // IWYU pragma: keep #include "../io.h"
#include "../maybe.h"
#include "../wgetopt.h" #include "../wgetopt.h"
#include "../wutil.h" // IWYU pragma: keep #include "../wutil.h" // IWYU pragma: keep
enum { BIND_INSERT, BIND_ERASE, BIND_KEY_NAMES, BIND_FUNCTION_NAMES }; enum { BIND_INSERT, BIND_ERASE, BIND_KEY_NAMES, BIND_FUNCTION_NAMES };
struct bind_cmd_opts_t { struct bind_cmd_opts_t {

View file

@ -2,8 +2,6 @@
#ifndef FISH_BUILTIN_BIND_H #ifndef FISH_BUILTIN_BIND_H
#define FISH_BUILTIN_BIND_H #define FISH_BUILTIN_BIND_H
#include <cwchar>
#include "../maybe.h" #include "../maybe.h"
class parser_t; class parser_t;

View file

@ -4,12 +4,13 @@
#include "block.h" #include "block.h"
#include <cstddef> #include <cstddef>
#include <deque>
#include "../builtin.h" #include "../builtin.h"
#include "../common.h" #include "../common.h"
#include "../event.h"
#include "../fallback.h" // IWYU pragma: keep #include "../fallback.h" // IWYU pragma: keep
#include "../io.h" #include "../io.h"
#include "../maybe.h"
#include "../parser.h" #include "../parser.h"
#include "../wgetopt.h" #include "../wgetopt.h"
#include "../wutil.h" // IWYU pragma: keep #include "../wutil.h" // IWYU pragma: keep

View file

@ -4,13 +4,13 @@
#include "builtin.h" #include "builtin.h"
#include <algorithm> #include <algorithm>
#include <cstddef>
#include <string> #include <string>
#include "../builtin.h" #include "../builtin.h"
#include "../common.h" #include "../common.h"
#include "../fallback.h" // IWYU pragma: keep #include "../fallback.h" // IWYU pragma: keep
#include "../io.h" #include "../io.h"
#include "../maybe.h"
#include "../wgetopt.h" #include "../wgetopt.h"
#include "../wutil.h" // IWYU pragma: keep #include "../wutil.h" // IWYU pragma: keep

View file

@ -4,18 +4,23 @@
#include "cd.h" #include "cd.h"
#include <fcntl.h> #include <fcntl.h>
#include <sys/stat.h> #include <unistd.h>
#include <cerrno> #include <cerrno>
#include <memory>
#include <string>
#include <utility>
#include <vector>
#include "../builtin.h" #include "../builtin.h"
#include "../common.h" #include "../common.h"
#include "../env.h" #include "../env.h"
#include "../fallback.h" // IWYU pragma: keep #include "../fallback.h" // IWYU pragma: keep
#include "../fds.h"
#include "../io.h" #include "../io.h"
#include "../maybe.h"
#include "../parser.h" #include "../parser.h"
#include "../path.h" #include "../path.h"
#include "../proc.h"
#include "../wutil.h" // IWYU pragma: keep #include "../wutil.h" // IWYU pragma: keep
/// The cd builtin. Changes the current directory to the one specified or to $HOME if none is /// The cd builtin. Changes the current directory to the one specified or to $HOME if none is

View file

@ -3,14 +3,14 @@
#include "command.h" #include "command.h"
#include <unistd.h>
#include <string> #include <string>
#include "../builtin.h" #include "../builtin.h"
#include "../common.h" #include "../common.h"
#include "../env.h"
#include "../fallback.h" // IWYU pragma: keep #include "../fallback.h" // IWYU pragma: keep
#include "../io.h" #include "../io.h"
#include "../maybe.h"
#include "../parser.h" #include "../parser.h"
#include "../path.h" #include "../path.h"
#include "../wgetopt.h" #include "../wgetopt.h"

View file

@ -3,15 +3,19 @@
#include "commandline.h" #include "commandline.h"
#include <algorithm>
#include <cerrno> #include <cerrno>
#include <cstddef>
#include <cstdlib>
#include <cwchar> #include <cwchar>
#include <string>
#include "../builtin.h" #include "../builtin.h"
#include "../common.h" #include "../common.h"
#include "../fallback.h" // IWYU pragma: keep #include "../fallback.h" // IWYU pragma: keep
#include "../io.h"
#include "../maybe.h"
#include "../input.h" #include "../input.h"
#include "../input_common.h"
#include "../parse_constants.h"
#include "../parse_util.h" #include "../parse_util.h"
#include "../parser.h" #include "../parser.h"
#include "../proc.h" #include "../proc.h"
@ -20,8 +24,6 @@
#include "../wgetopt.h" #include "../wgetopt.h"
#include "../wutil.h" // IWYU pragma: keep #include "../wutil.h" // IWYU pragma: keep
class parser_t;
/// Which part of the comandbuffer are we operating on. /// Which part of the comandbuffer are we operating on.
enum { enum {
STRING_MODE = 1, // operate on entire buffer STRING_MODE = 1, // operate on entire buffer

View file

@ -2,13 +2,10 @@
#ifndef FISH_BUILTIN_COMMANDLINE_H #ifndef FISH_BUILTIN_COMMANDLINE_H
#define FISH_BUILTIN_COMMANDLINE_H #define FISH_BUILTIN_COMMANDLINE_H
#include <cstring>
#include <cwchar>
#include "../io.h"
#include "../maybe.h" #include "../maybe.h"
class parser_t; class parser_t;
struct io_streams_t;
maybe_t<int> builtin_commandline(parser_t &parser, io_streams_t &streams, const wchar_t **argv); maybe_t<int> builtin_commandline(parser_t &parser, io_streams_t &streams, const wchar_t **argv);
#endif #endif

View file

@ -3,19 +3,21 @@
#include "complete.h" #include "complete.h"
#include <cstddef> #include <unistd.h>
#include <cwchar>
#include <memory> #include <functional>
#include <string> #include <string>
#include <utility>
#include <vector> #include <vector>
#include "../builtin.h" #include "../builtin.h"
#include "../color.h"
#include "../common.h" #include "../common.h"
#include "../complete.h" #include "../complete.h"
#include "../env.h" #include "../env.h"
#include "../fallback.h" // IWYU pragma: keep #include "../fallback.h" // IWYU pragma: keep
#include "../highlight.h" #include "../highlight.h"
#include "../io.h"
#include "../maybe.h"
#include "../parse_constants.h" #include "../parse_constants.h"
#include "../parse_util.h" #include "../parse_util.h"
#include "../parser.h" #include "../parser.h"

View file

@ -2,13 +2,10 @@
#ifndef FISH_BUILTIN_COMPLETE_H #ifndef FISH_BUILTIN_COMPLETE_H
#define FISH_BUILTIN_COMPLETE_H #define FISH_BUILTIN_COMPLETE_H
#include <cstring>
#include <cwchar>
#include "../io.h"
#include "../maybe.h" #include "../maybe.h"
class parser_t; class parser_t;
struct io_streams_t;
maybe_t<int> builtin_complete(parser_t &parser, io_streams_t &streams, const wchar_t **argv); maybe_t<int> builtin_complete(parser_t &parser, io_streams_t &streams, const wchar_t **argv);
#endif #endif

View file

@ -3,14 +3,13 @@
#include "contains.h" #include "contains.h"
#include <unistd.h>
#include <cwchar> #include <cwchar>
#include "../builtin.h" #include "../builtin.h"
#include "../common.h" #include "../common.h"
#include "../fallback.h" // IWYU pragma: keep #include "../fallback.h" // IWYU pragma: keep
#include "../io.h" #include "../io.h"
#include "../maybe.h"
#include "../wgetopt.h" #include "../wgetopt.h"
#include "../wutil.h" // IWYU pragma: keep #include "../wutil.h" // IWYU pragma: keep

View file

@ -5,12 +5,15 @@
#include <cerrno> #include <cerrno>
#include <csignal> #include <csignal>
#include <set> #include <deque>
#include <memory>
#include <vector>
#include "../builtin.h" #include "../builtin.h"
#include "../common.h" #include "../common.h"
#include "../fallback.h" // IWYU pragma: keep #include "../fallback.h" // IWYU pragma: keep
#include "../io.h" #include "../io.h"
#include "../maybe.h"
#include "../parser.h" #include "../parser.h"
#include "../proc.h" #include "../proc.h"
#include "../wutil.h" // IWYU pragma: keep #include "../wutil.h" // IWYU pragma: keep

View file

@ -3,13 +3,13 @@
#include "echo.h" #include "echo.h"
#include <climits>
#include <cstddef> #include <cstddef>
#include "../builtin.h" #include "../builtin.h"
#include "../common.h" #include "../common.h"
#include "../fallback.h" // IWYU pragma: keep #include "../fallback.h" // IWYU pragma: keep
#include "../io.h" #include "../io.h"
#include "../maybe.h"
#include "../wgetopt.h" #include "../wgetopt.h"
#include "../wutil.h" // IWYU pragma: keep #include "../wutil.h" // IWYU pragma: keep

View file

@ -3,11 +3,14 @@
#include "emit.h" #include "emit.h"
#include <utility>
#include "../builtin.h" #include "../builtin.h"
#include "../common.h" #include "../common.h"
#include "../event.h" #include "../event.h"
#include "../fallback.h" // IWYU pragma: keep #include "../fallback.h" // IWYU pragma: keep
#include "../io.h" #include "../io.h"
#include "../maybe.h"
#include "../wutil.h" // IWYU pragma: keep #include "../wutil.h" // IWYU pragma: keep
/// Implementation of the builtin emit command, used to create events. /// Implementation of the builtin emit command, used to create events.

View file

@ -1,17 +1,18 @@
// Functions for executing the eval builtin. // Functions for executing the eval builtin.
#include "config.h" // IWYU pragma: keep #include "config.h" // IWYU pragma: keep
#include <cerrno> #include <unistd.h>
#include <cstddef>
#include <memory>
#include <utility>
#include "../builtin.h" #include "../builtin.h"
#include "../common.h" #include "../common.h"
#include "../exec.h"
#include "../fallback.h" // IWYU pragma: keep #include "../fallback.h" // IWYU pragma: keep
#include "../io.h" #include "../io.h"
#include "../maybe.h"
#include "../parser.h" #include "../parser.h"
#include "../proc.h" #include "../proc.h"
#include "../wgetopt.h"
#include "../wutil.h" // IWYU pragma: keep #include "../wutil.h" // IWYU pragma: keep
/// Implementation of eval builtin. /// Implementation of eval builtin.

View file

@ -4,15 +4,13 @@
#include "exit.h" #include "exit.h"
#include <cerrno> #include <cerrno>
#include <cstddef>
#include "../builtin.h" #include "../builtin.h"
#include "../common.h" #include "../common.h"
#include "../fallback.h" // IWYU pragma: keep #include "../fallback.h" // IWYU pragma: keep
#include "../io.h" #include "../io.h"
#include "../maybe.h"
#include "../parser.h" #include "../parser.h"
#include "../proc.h"
#include "../reader.h"
#include "../wgetopt.h" #include "../wgetopt.h"
#include "../wutil.h" // IWYU pragma: keep #include "../wutil.h" // IWYU pragma: keep

View file

@ -3,16 +3,24 @@
#include "fg.h" #include "fg.h"
#include <termios.h>
#include <unistd.h>
#include <cerrno> #include <cerrno>
#include <cstdio> #include <cstdio>
#include <cstdlib> #include <cstdlib>
#include <cwchar> #include <cwchar>
#include <deque>
#include <memory>
#include <utility>
#include "../builtin.h" #include "../builtin.h"
#include "../common.h" #include "../common.h"
#include "../env.h" #include "../env.h"
#include "../fallback.h" // IWYU pragma: keep #include "../fallback.h" // IWYU pragma: keep
#include "../fds.h"
#include "../io.h" #include "../io.h"
#include "../maybe.h"
#include "../job_group.h" #include "../job_group.h"
#include "../parser.h" #include "../parser.h"
#include "../proc.h" #include "../proc.h"

View file

@ -6,23 +6,29 @@
#include <unistd.h> #include <unistd.h>
#include <cerrno> #include <cerrno>
#include <cstddef> #include <cwchar>
#include <cstdlib> #include <map>
#include <memory> #include <memory>
#include <string> #include <string>
#include <utility>
#include <vector> #include <vector>
#include "../builtin.h" #include "../builtin.h"
#include "../common.h" #include "../common.h"
#include "../complete.h" #include "../complete.h"
#include "../env.h"
#include "../event.h" #include "../event.h"
#include "../fallback.h" // IWYU pragma: keep #include "../fallback.h" // IWYU pragma: keep
#include "../function.h" #include "../function.h"
#include "../io.h" #include "../io.h"
#include "../maybe.h"
#include "../null_terminated_array.h"
#include "../parser.h" #include "../parser.h"
#include "../parser_keywords.h" #include "../parser_keywords.h"
#include "../parse_tree.h"
#include "../proc.h" #include "../proc.h"
#include "../signal.h" #include "../signal.h"
#include "../wait_handle.h"
#include "../wgetopt.h" #include "../wgetopt.h"
#include "../wutil.h" // IWYU pragma: keep #include "../wutil.h" // IWYU pragma: keep

View file

@ -3,13 +3,14 @@
#define FISH_BUILTIN_FUNCTION_H #define FISH_BUILTIN_FUNCTION_H
#include "../common.h" #include "../common.h"
#include "../maybe.h"
#include "../parse_tree.h" #include "../parse_tree.h"
class parser_t; class parser_t;
struct io_streams_t; struct io_streams_t;
namespace ast { namespace ast {
struct block_statement_t; struct block_statement_t;
} }
maybe_t<int> builtin_function(parser_t &parser, io_streams_t &streams, maybe_t<int> builtin_function(parser_t &parser, io_streams_t &streams,

View file

@ -6,29 +6,22 @@
#include <unistd.h> #include <unistd.h>
#include <algorithm> #include <algorithm>
#include <cstddef>
#include <cwchar>
#include <map>
#include <memory> #include <memory>
#include <string> #include <string>
#include <utility>
#include <vector> #include <vector>
#include "../builtin.h" #include "../builtin.h"
#include "../common.h" #include "../common.h"
#include "../complete.h"
#include "../env.h" #include "../env.h"
#include "../event.h" #include "../event.h"
#include "../fallback.h" // IWYU pragma: keep #include "../fallback.h" // IWYU pragma: keep
#include "../function.h" #include "../function.h"
#include "../highlight.h" #include "../highlight.h"
#include "../io.h" #include "../io.h"
#include "../maybe.h"
#include "../parser.h" #include "../parser.h"
#include "../parser_keywords.h" #include "../parser_keywords.h"
#include "../proc.h"
#include "../signal.h"
#include "../termsize.h" #include "../termsize.h"
#include "../wcstringutil.h"
#include "../wgetopt.h" #include "../wgetopt.h"
#include "../wutil.h" // IWYU pragma: keep #include "../wutil.h" // IWYU pragma: keep

View file

@ -6,16 +6,17 @@
#include <cerrno> #include <cerrno>
#include <cstddef> #include <cstddef>
#include <cstdint> #include <cstdint>
#include <cwchar> #include <memory>
#include <string> #include <string>
#include <vector>
#include "../builtin.h" #include "../builtin.h"
#include "../common.h" #include "../common.h"
#include "../env.h"
#include "../enum_map.h" #include "../enum_map.h"
#include "../fallback.h" // IWYU pragma: keep #include "../fallback.h" // IWYU pragma: keep
#include "../history.h" #include "../history.h"
#include "../io.h" #include "../io.h"
#include "../maybe.h"
#include "../parser.h" #include "../parser.h"
#include "../reader.h" #include "../reader.h"
#include "../wgetopt.h" #include "../wgetopt.h"

View file

@ -1,22 +1,20 @@
// Functions for executing the jobs builtin. // Functions for executing the jobs builtin.
#include "config.h" // IWYU pragma: keep #include "config.h" // IWYU pragma: keep
#include <sys/time.h>
#include <cerrno> #include <cerrno>
#include <cstddef> #include <deque>
#include <memory>
#include "../builtin.h" #include "../builtin.h"
#include "../common.h" #include "../common.h"
#include "../fallback.h" // IWYU pragma: keep #include "../fallback.h" // IWYU pragma: keep
#include "../io.h" #include "../io.h"
#include "../maybe.h"
#include "../parser.h" #include "../parser.h"
#include "../proc.h" #include "../proc.h"
#include "../wgetopt.h" #include "../wgetopt.h"
#include "../wutil.h" // IWYU pragma: keep #include "../wutil.h" // IWYU pragma: keep
class parser_t;
/// Print modes for the jobs builtin. /// Print modes for the jobs builtin.
enum { enum {
JOBS_DEFAULT, // print lots of general info JOBS_DEFAULT, // print lots of general info

View file

@ -3,11 +3,9 @@
#include "math.h" #include "math.h"
#include <algorithm>
#include <cerrno> #include <cerrno>
#include <cmath> #include <cmath>
#include <cstddef> #include <cwchar>
#include <cstring>
#include <limits> #include <limits>
#include <string> #include <string>
@ -15,6 +13,7 @@
#include "../common.h" #include "../common.h"
#include "../fallback.h" // IWYU pragma: keep #include "../fallback.h" // IWYU pragma: keep
#include "../io.h" #include "../io.h"
#include "../maybe.h"
#include "../tinyexpr.h" #include "../tinyexpr.h"
#include "../wgetopt.h" #include "../wgetopt.h"
#include "../wutil.h" // IWYU pragma: keep #include "../wutil.h" // IWYU pragma: keep

View file

@ -5,17 +5,25 @@
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/types.h> #include <sys/types.h>
#include <stdint.h>
#include <unistd.h> #include <unistd.h>
#include <algorithm>
#include <climits>
#include <ctime> #include <ctime>
#include <cstdarg>
#include <cwchar>
#include <map>
#include <string> #include <string>
#include <unordered_map>
#include <utility> #include <utility>
#include <vector>
#include "../builtin.h" #include "../builtin.h"
#include "../common.h" #include "../common.h"
#include "../env.h"
#include "../fallback.h" // IWYU pragma: keep #include "../fallback.h" // IWYU pragma: keep
#include "../io.h" #include "../io.h"
#include "../maybe.h"
#include "../parser.h" #include "../parser.h"
#include "../path.h" #include "../path.h"
#include "../util.h" #include "../util.h"
@ -30,7 +38,7 @@
static void path_error(io_streams_t &streams, const wchar_t *fmt, ...) { static void path_error(io_streams_t &streams, const wchar_t *fmt, ...) {
streams.err.append(L"path "); streams.err.append(L"path ");
va_list va; std::va_list va;
va_start(va, fmt); va_start(va, fmt);
streams.err.append_formatv(fmt, va); streams.err.append_formatv(fmt, va);
va_end(va); va_end(va);

View file

@ -1,13 +1,10 @@
#ifndef FISH_BUILTIN_PATH_H #ifndef FISH_BUILTIN_PATH_H
#define FISH_BUILTIN_PATH_H #define FISH_BUILTIN_PATH_H
#include <cstring>
#include <cwchar>
#include "../io.h"
#include "../maybe.h" #include "../maybe.h"
class parser_t; class parser_t;
struct io_streams_t;
maybe_t<int> builtin_path(parser_t &parser, io_streams_t &streams, const wchar_t **argv); maybe_t<int> builtin_path(parser_t &parser, io_streams_t &streams, const wchar_t **argv);
#endif #endif

View file

@ -52,21 +52,22 @@
#include "printf.h" #include "printf.h"
#include <sys/types.h>
#include <cerrno> #include <cerrno>
#include <climits> #include <climits>
#include <clocale>
#include <cstdarg> #include <cstdarg>
#include <cstddef>
#include <cstdint> #include <cstdint>
#include <cstdlib>
#include <cstring> #include <cstring>
#include <cwchar> #include <cwchar>
#include <cwctype> #include <cwctype>
#include <locale>
#ifdef HAVE_XLOCALE_H
#include <xlocale.h>
#endif
#include "../builtin.h" #include "../builtin.h"
#include "../common.h" #include "../common.h"
#include "../io.h"
#include "../maybe.h"
#include "../wcstringutil.h" #include "../wcstringutil.h"
#include "../wutil.h" // IWYU pragma: keep #include "../wutil.h" // IWYU pragma: keep

View file

@ -2,13 +2,10 @@
#ifndef FISH_BUILTIN_PRINTF_H #ifndef FISH_BUILTIN_PRINTF_H
#define FISH_BUILTIN_PRINTF_H #define FISH_BUILTIN_PRINTF_H
#include <cstring>
#include <cwchar>
#include "../io.h"
#include "../maybe.h" #include "../maybe.h"
class parser_t; class parser_t;
struct io_streams_t;
maybe_t<int> builtin_printf(parser_t &parser, io_streams_t &streams, const wchar_t **argv); maybe_t<int> builtin_printf(parser_t &parser, io_streams_t &streams, const wchar_t **argv);
#endif #endif

View file

@ -3,12 +3,17 @@
#include "pwd.h" #include "pwd.h"
#include <cerrno>
#include <cstring> #include <cstring>
#include <string>
#include <utility>
#include "../builtin.h" #include "../builtin.h"
#include "../common.h" #include "../common.h"
#include "../env.h"
#include "../fallback.h" // IWYU pragma: keep #include "../fallback.h" // IWYU pragma: keep
#include "../io.h" #include "../io.h"
#include "../maybe.h"
#include "../parser.h" #include "../parser.h"
#include "../wgetopt.h" #include "../wgetopt.h"
#include "../wutil.h" // IWYU pragma: keep #include "../wutil.h" // IWYU pragma: keep

View file

@ -3,7 +3,6 @@
#include "random.h" #include "random.h"
#include <algorithm>
#include <cerrno> #include <cerrno>
#include <cstdint> #include <cstdint>
#include <cwchar> #include <cwchar>
@ -13,6 +12,7 @@
#include "../common.h" #include "../common.h"
#include "../fallback.h" // IWYU pragma: keep #include "../fallback.h" // IWYU pragma: keep
#include "../io.h" #include "../io.h"
#include "../maybe.h"
#include "../wutil.h" // IWYU pragma: keep #include "../wutil.h" // IWYU pragma: keep
/// \return a random-seeded engine. /// \return a random-seeded engine.

View file

@ -3,34 +3,26 @@
#include "read.h" #include "read.h"
#include <termios.h>
#include <unistd.h> #include <unistd.h>
#include <algorithm> #include <algorithm>
#include <cerrno> #include <cerrno>
#include <climits>
#include <cstddef>
#include <cstdio> #include <cstdio>
#include <cstdlib> #include <cstdlib>
#include <cstring> #include <cstring>
#include <cwchar> #include <cwchar>
#include <memory>
#include <numeric>
#include <string> #include <string>
#include <vector> #include <utility>
#include "../builtin.h" #include "../builtin.h"
#include "../common.h" #include "../common.h"
#include "../complete.h"
#include "../env.h" #include "../env.h"
#include "../event.h"
#include "../fallback.h" // IWYU pragma: keep #include "../fallback.h" // IWYU pragma: keep
#include "../highlight.h"
#include "../history.h"
#include "../io.h" #include "../io.h"
#include "../maybe.h"
#include "../parser.h" #include "../parser.h"
#include "../proc.h"
#include "../reader.h" #include "../reader.h"
#include "../tokenizer.h"
#include "../wcstringutil.h" #include "../wcstringutil.h"
#include "../wgetopt.h" #include "../wgetopt.h"
#include "../wutil.h" // IWYU pragma: keep #include "../wutil.h" // IWYU pragma: keep

View file

@ -3,15 +3,15 @@
#include "realpath.h" #include "realpath.h"
#include <cstdio> #include <cerrno>
#include <cstdlib>
#include <cstring> #include <cstring>
#include <cwchar>
#include "../builtin.h" #include "../builtin.h"
#include "../common.h" #include "../common.h"
#include "../env.h"
#include "../fallback.h" // IWYU pragma: keep #include "../fallback.h" // IWYU pragma: keep
#include "../io.h" #include "../io.h"
#include "../maybe.h"
#include "../parser.h" #include "../parser.h"
#include "../path.h" #include "../path.h"
#include "../wcstringutil.h" #include "../wcstringutil.h"

View file

@ -4,14 +4,14 @@
#include "return.h" #include "return.h"
#include <cerrno> #include <cerrno>
#include <cstddef> #include <deque>
#include "../builtin.h" #include "../builtin.h"
#include "../common.h" #include "../common.h"
#include "../fallback.h" // IWYU pragma: keep #include "../fallback.h" // IWYU pragma: keep
#include "../io.h" #include "../io.h"
#include "../maybe.h"
#include "../parser.h" #include "../parser.h"
#include "../proc.h"
#include "../wgetopt.h" #include "../wgetopt.h"
#include "../wutil.h" // IWYU pragma: keep #include "../wutil.h" // IWYU pragma: keep

View file

@ -3,31 +3,26 @@
#include "set.h" #include "set.h"
#include <sys/stat.h>
#include <unistd.h>
#include <algorithm> #include <algorithm>
#include <cerrno> #include <cerrno>
#include <cstddef>
#include <cstdlib>
#include <cstring>
#include <cwchar> #include <cwchar>
#include <iterator> #include <functional>
#include <map>
#include <memory> #include <memory>
#include <set>
#include <string> #include <string>
#include <utility>
#include <vector> #include <vector>
#include "../builtin.h" #include "../builtin.h"
#include "../common.h" #include "../common.h"
#include "../env.h" #include "../env.h"
#include "../expand.h" #include "../expand.h"
#include "../event.h"
#include "../fallback.h" // IWYU pragma: keep #include "../fallback.h" // IWYU pragma: keep
#include "../history.h" #include "../history.h"
#include "../io.h" #include "../io.h"
#include "../maybe.h"
#include "../parser.h" #include "../parser.h"
#include "../proc.h"
#include "../wcstringutil.h"
#include "../wgetopt.h" #include "../wgetopt.h"
#include "../wutil.h" // IWYU pragma: keep #include "../wutil.h" // IWYU pragma: keep

View file

@ -2,8 +2,6 @@
#ifndef FISH_BUILTIN_SET_H #ifndef FISH_BUILTIN_SET_H
#define FISH_BUILTIN_SET_H #define FISH_BUILTIN_SET_H
#include <cwchar>
#include "../maybe.h" #include "../maybe.h"
class parser_t; class parser_t;

View file

@ -3,11 +3,12 @@
#include "set_color.h" #include "set_color.h"
#include <cstddef> #include <unistd.h>
#include <cstdlib> #include <cstdlib>
#if HAVE_CURSES_H #if HAVE_CURSES_H
#include <curses.h> #include <curses.h> // IWYU pragma: keep
#elif HAVE_NCURSES_H #elif HAVE_NCURSES_H
#include <ncurses.h> #include <ncurses.h>
#elif HAVE_NCURSES_CURSES_H #elif HAVE_NCURSES_CURSES_H
@ -19,7 +20,6 @@
#include <ncurses/term.h> #include <ncurses/term.h>
#endif #endif
#include <memory>
#include <string> #include <string>
#include <vector> #include <vector>
@ -27,8 +27,10 @@
#include "../color.h" #include "../color.h"
#include "../common.h" #include "../common.h"
#include "../env.h" #include "../env.h"
#include "../fallback.h" // IWYU pragma: keep
#include "../io.h"
#include "../maybe.h"
#include "../output.h" #include "../output.h"
#include "../parser.h"
#include "../wgetopt.h" #include "../wgetopt.h"
#include "../wutil.h" // IWYU pragma: keep #include "../wutil.h" // IWYU pragma: keep

View file

@ -2,13 +2,10 @@
#ifndef FISH_BUILTIN_SET_COLOR_H #ifndef FISH_BUILTIN_SET_COLOR_H
#define FISH_BUILTIN_SET_COLOR_H #define FISH_BUILTIN_SET_COLOR_H
#include <cstring>
#include <cwchar>
#include "../io.h"
#include "../maybe.h" #include "../maybe.h"
class parser_t; class parser_t;
struct io_streams_t;
maybe_t<int> builtin_set_color(parser_t &parser, io_streams_t &streams, const wchar_t **argv); maybe_t<int> builtin_set_color(parser_t &parser, io_streams_t &streams, const wchar_t **argv);
#endif #endif

View file

@ -8,14 +8,19 @@
#include <unistd.h> #include <unistd.h>
#include <cwchar> #include <cwchar>
#include <memory>
#include <string>
#include <utility>
#include "../builtin.h" #include "../builtin.h"
#include "../common.h" #include "../common.h"
#include "../env.h" #include "../env.h"
#include "../fallback.h" // IWYU pragma: keep #include "../fallback.h" // IWYU pragma: keep
#include "../fds.h"
#include "../io.h" #include "../io.h"
#include "../maybe.h"
#include "../null_terminated_array.h"
#include "../parser.h" #include "../parser.h"
#include "../proc.h"
#include "../reader.h" #include "../reader.h"
#include "../wutil.h" // IWYU pragma: keep #include "../wutil.h" // IWYU pragma: keep

View file

@ -3,17 +3,24 @@
#include "status.h" #include "status.h"
#include <cstddef> #include <unistd.h>
#include <algorithm>
#include <cerrno>
#include <cstring> #include <cstring>
#include <cwchar> #include <cwchar>
#include <limits>
#include <memory>
#include <string> #include <string>
#include "../builtin.h" #include "../builtin.h"
#include "../common.h" #include "../common.h"
#include "../enum_map.h" #include "../enum_map.h"
#include "../env.h"
#include "../fallback.h" // IWYU pragma: keep #include "../fallback.h" // IWYU pragma: keep
#include "../future_feature_flags.h" #include "../future_feature_flags.h"
#include "../io.h" #include "../io.h"
#include "../maybe.h"
#include "../parser.h" #include "../parser.h"
#include "../proc.h" #include "../proc.h"
#include "../wgetopt.h" #include "../wgetopt.h"

View file

@ -6,15 +6,11 @@
#include <climits> #include <climits>
#include <cstdarg> #include <cstdarg>
#include <cstddef> #include <cstddef>
#include <cstdint>
#include <cstdlib>
#include <cwchar> #include <cwchar>
#include <cwctype> #include <cwctype>
#include <functional> #include <map>
#include <iterator>
#include <memory> #include <memory>
#include <string> #include <string>
#include <unordered_map>
#include <utility> #include <utility>
#include <vector> #include <vector>
@ -23,6 +19,8 @@
#include "../env.h" #include "../env.h"
#include "../fallback.h" // IWYU pragma: keep #include "../fallback.h" // IWYU pragma: keep
#include "../future_feature_flags.h" #include "../future_feature_flags.h"
#include "../io.h"
#include "../maybe.h"
#include "../parse_util.h" #include "../parse_util.h"
#include "../parser.h" #include "../parser.h"
#include "../re.h" #include "../re.h"

View file

@ -10,19 +10,23 @@
#include <unistd.h> #include <unistd.h>
#include <cerrno> #include <cerrno>
#include <climits>
#include <cmath> #include <cmath>
#include <cstdarg> #include <cstdarg>
#include <cstring> #include <cstring>
#include <cwchar> #include <cwchar>
#include <cwctype> #include <cwctype>
#include <map>
#include <memory> #include <memory>
#include <string> #include <string>
#include <type_traits>
#include <utility> #include <utility>
#include <vector>
#include "../builtin.h" #include "../builtin.h"
#include "../common.h" #include "../common.h"
#include "../fallback.h" // IWYU pragma: keep
#include "../io.h" #include "../io.h"
#include "../maybe.h"
#include "../parser.h" #include "../parser.h"
#include "../wutil.h" // IWYU pragma: keep #include "../wutil.h" // IWYU pragma: keep

View file

@ -5,19 +5,20 @@
#include <unistd.h> #include <unistd.h>
#include <memory>
#include <string> #include <string>
#include <vector>
#include "../builtin.h" #include "../builtin.h"
#include "../common.h" #include "../common.h"
#include "../complete.h" #include "../env.h"
#include "../fallback.h" // IWYU pragma: keep #include "../fallback.h" // IWYU pragma: keep
#include "../function.h" #include "../function.h"
#include "../highlight.h" #include "../highlight.h"
#include "../io.h" #include "../io.h"
#include "../maybe.h"
#include "../parser.h" #include "../parser.h"
#include "../path.h" #include "../path.h"
#include "../signal.h"
#include "../wcstringutil.h"
#include "../wgetopt.h" #include "../wgetopt.h"
#include "../wutil.h" // IWYU pragma: keep #include "../wutil.h" // IWYU pragma: keep

View file

@ -5,12 +5,15 @@
#include <sys/resource.h> #include <sys/resource.h>
#include <algorithm>
#include <cerrno> #include <cerrno>
#include <cstddef> #include <cwchar>
#include "../builtin.h" #include "../builtin.h"
#include "../common.h" #include "../common.h"
#include "../fallback.h" // IWYU pragma: keep #include "../fallback.h" // IWYU pragma: keep
#include "../io.h"
#include "../maybe.h"
#include "../wgetopt.h" #include "../wgetopt.h"
#include "../wutil.h" // IWYU pragma: keep #include "../wutil.h" // IWYU pragma: keep

View file

@ -2,12 +2,10 @@
#ifndef FISH_BUILTIN_ULIMIT_H #ifndef FISH_BUILTIN_ULIMIT_H
#define FISH_BUILTIN_ULIMIT_H #define FISH_BUILTIN_ULIMIT_H
#include <cstring> #include "../maybe.h"
#include <cwchar>
#include "../io.h"
class parser_t; class parser_t;
struct io_streams_t;
maybe_t<int> builtin_ulimit(parser_t &parser, io_streams_t &streams, const wchar_t **argv); maybe_t<int> builtin_ulimit(parser_t &parser, io_streams_t &streams, const wchar_t **argv);
#endif #endif

View file

@ -3,16 +3,24 @@
#include "wait.h" #include "wait.h"
#include <sys/wait.h>
#include <algorithm> #include <algorithm>
#include <cerrno>
#include <csignal>
#include <deque>
#include <list>
#include <memory>
#include <string>
#include <utility>
#include <vector> #include <vector>
#include "../builtin.h" #include "../builtin.h"
#include "../common.h" #include "../common.h"
#include "../io.h"
#include "../maybe.h"
#include "../parser.h" #include "../parser.h"
#include "../proc.h" #include "../proc.h"
#include "../signal.h" #include "../signal.h"
#include "../topic_monitor.h"
#include "../wait_handle.h" #include "../wait_handle.h"
#include "../wgetopt.h" #include "../wgetopt.h"
#include "../wutil.h" #include "../wutil.h"

View file

@ -4,11 +4,10 @@
#include "color.h" #include "color.h"
#include <algorithm> #include <algorithm>
#include <cstddef> #include <iterator>
#include <cstdint> #include <cstdint>
#include <cstdlib> #include <cstdlib>
#include <cwchar> // IWYU pragma: keep #include <cwchar> // IWYU pragma: keep
#include <cwctype>
#include "common.h" #include "common.h"
#include "fallback.h" // IWYU pragma: keep #include "fallback.h" // IWYU pragma: keep

View file

@ -4,6 +4,7 @@
#include <cstring> #include <cstring>
#include <string> #include <string>
#include <cstdint>
#include "common.h" #include "common.h"

View file

@ -10,21 +10,12 @@
#include <errno.h> #include <errno.h>
#include <fcntl.h> #include <fcntl.h>
#include <limits.h> #include <limits.h>
#include <paths.h>
#include <pthread.h> #include <pthread.h>
#include <stdarg.h> #include <stdarg.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <sys/time.h> #include <sys/time.h>
#include <termios.h> #include <termios.h>
#include <unistd.h> #include <unistd.h>
#include <wctype.h>
#include <cstring>
#include <cwchar>
#ifdef HAVE_EXECINFO_H #ifdef HAVE_EXECINFO_H
#include <execinfo.h> #include <execinfo.h>
#endif #endif
@ -35,21 +26,21 @@
#endif #endif
#include <algorithm> #include <algorithm>
#include <atomic> #include <csignal>
#include <memory> // IWYU pragma: keep #include <cstring>
#include <type_traits> #include <cstdlib>
#include <cwchar>
#include <memory>
#include "common.h" #include "common.h"
#include "env.h"
#include "expand.h" #include "expand.h"
#include "fallback.h" // IWYU pragma: keep #include "fallback.h" // IWYU pragma: keep
#include "flog.h" #include "flog.h"
#include "future_feature_flags.h" #include "future_feature_flags.h"
#include "global_safety.h" #include "global_safety.h"
#include "iothread.h" #include "iothread.h"
#include "parser.h"
#include "proc.h"
#include "signal.h" #include "signal.h"
#include "topic_monitor.h"
#include "termsize.h" #include "termsize.h"
#include "wcstringutil.h" #include "wcstringutil.h"
#include "wildcard.h" #include "wildcard.h"
@ -57,10 +48,10 @@
// Keep after "common.h" // Keep after "common.h"
#ifdef HAVE_SYS_SYSCTL_H #ifdef HAVE_SYS_SYSCTL_H
#include <sys/sysctl.h> #include <sys/sysctl.h> // IWYU pragma: keep
#endif #endif
#if defined(__APPLE__) #if defined(__APPLE__)
#include <mach-o/dyld.h> #include <mach-o/dyld.h> // IWYU pragma: keep
#endif #endif
struct termios shell_modes; struct termios shell_modes;

View file

@ -10,14 +10,18 @@
#ifdef HAVE_SYS_IOCTL_H #ifdef HAVE_SYS_IOCTL_H
#include <sys/ioctl.h> // IWYU pragma: keep #include <sys/ioctl.h> // IWYU pragma: keep
#endif #endif
#include <sys/types.h>
#include <termios.h>
#include <algorithm> #include <algorithm>
#include <atomic> #include <cstdint>
#include <cmath> #include <cwchar>
#include <functional> #include <functional>
#include <iterator>
#include <memory> #include <memory>
#include <mutex> #include <mutex>
#include <string> #include <string>
#include <utility>
#include <vector> #include <vector>
#include "fallback.h" // IWYU pragma: keep #include "fallback.h" // IWYU pragma: keep

View file

@ -7,43 +7,45 @@
#include "complete.h" #include "complete.h"
#include <pthread.h>
#include <pwd.h> #include <pwd.h>
#include <stddef.h>
#include <wctype.h> #include <wctype.h>
#include <algorithm> #include <algorithm>
#include <atomic>
#include <cstddef> #include <cstddef>
#include <cwchar> #include <cwchar>
#include <forward_list> #include <forward_list>
#include <functional> #include <functional>
#include <iterator> #include <iterator>
#include <map>
#include <memory> #include <memory>
#include <numeric> #include <mutex>
#include <set> #include <set>
#include <string> #include <string>
#include <type_traits>
#include <unordered_map> #include <unordered_map>
#include <unordered_set>
#include <utility> #include <utility>
#include "autoload.h" #include "autoload.h"
#include "builtin.h" #include "builtin.h"
#include "common.h" #include "common.h"
#include "enum_set.h"
#include "env.h" #include "env.h"
#include "exec.h" #include "exec.h"
#include "expand.h" #include "expand.h"
#include "fallback.h" // IWYU pragma: keep #include "fallback.h" // IWYU pragma: keep
#include "flog.h"
#include "function.h" #include "function.h"
#include "global_safety.h"
#include "history.h" #include "history.h"
#include "iothread.h" #include "maybe.h"
#include "operation_context.h"
#include "parse_constants.h" #include "parse_constants.h"
#include "parse_util.h" #include "parse_util.h"
#include "parser.h" #include "parser.h"
#include "parser_keywords.h" #include "parser_keywords.h"
#include "path.h" #include "path.h"
#include "proc.h" #include "tokenizer.h"
#include "reader.h"
#include "util.h" #include "util.h"
#include "wcstringutil.h" #include "wcstringutil.h"
#include "wildcard.h" #include "wildcard.h"

View file

@ -5,11 +5,15 @@
#ifndef FISH_COMPLETE_H #ifndef FISH_COMPLETE_H
#define FISH_COMPLETE_H #define FISH_COMPLETE_H
#include <stdint.h> #include "config.h" // IWYU pragma: keep
#include <cstdint>
#include <cstddef>
#include <functional> #include <functional>
#include <utility>
#include <vector> #include <vector>
//#include "expand.h"
#include "common.h" #include "common.h"
#include "wcstringutil.h" #include "wcstringutil.h"
@ -25,7 +29,6 @@ struct completion_mode_t {
/// Character that separates the completion and description on programmable completions. /// Character that separates the completion and description on programmable completions.
#define PROG_COMPLETE_SEP L'\t' #define PROG_COMPLETE_SEP L'\t'
class environment_t;
class parser_t; class parser_t;
enum { enum {
@ -124,7 +127,6 @@ struct completion_request_options_t {
} }
}; };
class completion_t;
using completion_list_t = std::vector<completion_t>; using completion_list_t = std::vector<completion_t>;
/// A completion receiver accepts completions. It is essentially a wrapper around std::vector with /// A completion receiver accepts completions. It is essentially a wrapper around std::vector with

View file

@ -3,7 +3,6 @@
#include <array> #include <array>
#include <bitset> #include <bitset>
#include <cassert>
#include <iterator> #include <iterator>
/// A type (to specialize) that provides a count for an enum. /// A type (to specialize) that provides a count for an enum.

View file

@ -12,14 +12,12 @@
#include <unistd.h> #include <unistd.h>
#include <algorithm> #include <algorithm>
#include <iterator>
#include <map> #include <map>
#include <mutex> #include <mutex>
#include <set> #include <set>
#include <utility> #include <utility>
#include <vector> #include <vector>
#include "builtins/bind.h"
#include "common.h" #include "common.h"
#include "env_dispatch.h" #include "env_dispatch.h"
#include "env_universal_common.h" #include "env_universal_common.h"
@ -31,6 +29,7 @@
#include "history.h" #include "history.h"
#include "input.h" #include "input.h"
#include "kill.h" #include "kill.h"
#include "null_terminated_array.h"
#include "path.h" #include "path.h"
#include "proc.h" #include "proc.h"
#include "reader.h" #include "reader.h"

View file

@ -10,10 +10,12 @@
#include <string> #include <string>
#include <unordered_map> #include <unordered_map>
#include <vector> #include <vector>
#include <utility>
#include "common.h" #include "common.h"
#include "maybe.h" #include "maybe.h"
#include "null_terminated_array.h"
class owning_null_terminated_array_t;
extern size_t read_byte_limit; extern size_t read_byte_limit;
extern bool curses_initialized; extern bool curses_initialized;

View file

@ -4,20 +4,19 @@
#include <errno.h> #include <errno.h>
#include <limits.h> #include <limits.h>
#include <locale.h> #include <locale.h>
#include <stddef.h>
#include <stdlib.h>
#include <time.h> #include <time.h>
#include <unistd.h> #include <unistd.h>
#include <cstdlib>
#include <cstring> #include <cstring>
#include <cwchar> #include <cwchar>
#if HAVE_CURSES_H #if HAVE_CURSES_H
#include <curses.h> #include <curses.h> // IWYU pragma: keep
#elif HAVE_NCURSES_H #elif HAVE_NCURSES_H
#include <ncurses.h> #include <ncurses.h> // IWYU pragma: keep
#elif HAVE_NCURSES_CURSES_H #elif HAVE_NCURSES_CURSES_H
#include <ncurses/curses.h> #include <ncurses/curses.h> // IWYU pragma: keep
#endif #endif
#if HAVE_TERM_H #if HAVE_TERM_H
#include <term.h> #include <term.h>
@ -25,8 +24,6 @@
#include <ncurses/term.h> #include <ncurses/term.h>
#endif #endif
#include <assert.h>
#include <algorithm> #include <algorithm>
#include <functional> #include <functional>
#include <memory> #include <memory>
@ -38,8 +35,6 @@
#include "complete.h" #include "complete.h"
#include "env.h" #include "env.h"
#include "env_dispatch.h" #include "env_dispatch.h"
#include "env_universal_common.h"
#include "event.h"
#include "fallback.h" // IWYU pragma: keep #include "fallback.h" // IWYU pragma: keep
#include "flog.h" #include "flog.h"
#include "function.h" #include "function.h"
@ -48,14 +43,13 @@
#include "input_common.h" #include "input_common.h"
#include "maybe.h" #include "maybe.h"
#include "output.h" #include "output.h"
#include "parser.h"
#include "proc.h" #include "proc.h"
#include "reader.h" #include "reader.h"
#include "screen.h" #include "screen.h"
#include "termsize.h" #include "termsize.h"
#include "trace.h" #include "trace.h"
#include "wutil.h" // IWYU pragma: keep #include "wcstringutil.h"
#include "wutil.h"
// Limit `read` to 100 MiB (bytes not wide chars) by default. This can be overridden by the // Limit `read` to 100 MiB (bytes not wide chars) by default. This can be overridden by the
// fish_read_limit variable. // fish_read_limit variable.

View file

@ -4,14 +4,10 @@
#include "config.h" // IWYU pragma: keep #include "config.h" // IWYU pragma: keep
#include <memory>
#include "common.h" #include "common.h"
#include "env_universal_common.h"
class environment_t; class environment_t;
class env_stack_t; class env_stack_t;
class parser_t;
/// Initialize variable dispatch. /// Initialize variable dispatch.
void env_dispatch_init(const environment_t &vars); void env_dispatch_init(const environment_t &vars);

View file

@ -4,38 +4,33 @@
#include <arpa/inet.h> // IWYU pragma: keep #include <arpa/inet.h> // IWYU pragma: keep
#include <errno.h> #include <errno.h>
#include <fcntl.h> #include <fcntl.h>
#include <unistd.h>
// We need the sys/file.h for the flock() declaration on Linux but not OS X. // We need the sys/file.h for the flock() declaration on Linux but not OS X.
#include <sys/file.h> // IWYU pragma: keep #include <sys/file.h> // IWYU pragma: keep
// We need the ioctl.h header so we can check if SIOCGIFHWADDR is defined by it so we know if we're // We need the ioctl.h header so we can check if SIOCGIFHWADDR is defined by it so we know if we're
// on a Linux system. // on a Linux system.
#include <limits.h>
#include <netinet/in.h> // IWYU pragma: keep #include <netinet/in.h> // IWYU pragma: keep
#include <sys/ioctl.h> // IWYU pragma: keep #include <sys/ioctl.h> // IWYU pragma: keep
#if !defined(__APPLE__) && !defined(__CYGWIN__)
#include <pwd.h>
#endif
#include <stddef.h>
#include <stdint.h>
#include <stdlib.h>
#include <cstring>
#ifdef __CYGWIN__ #ifdef __CYGWIN__
#include <sys/mman.h> #include <sys/mman.h>
#endif #endif
#ifdef HAVE_SYS_SELECT_H #ifdef HAVE_SYS_SELECT_H
#include <sys/select.h> // IWYU pragma: keep #include <sys/select.h> // IWYU pragma: keep
#endif #endif
#include <signal.h> #if !defined(__APPLE__) && !defined(__CYGWIN__)
#include <pwd.h>
#endif
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/time.h> // IWYU pragma: keep #include <sys/time.h> // IWYU pragma: keep
#include <sys/types.h> // IWYU pragma: keep #include <sys/types.h> // IWYU pragma: keep
#include <unistd.h>
#include <atomic> #include <algorithm>
#include <cstring>
#include <cstdio>
#include <cwchar> #include <cwchar>
#include <map> #include <functional>
#include <string> #include <string>
#include <type_traits> #include <unordered_map>
#include <utility> #include <utility>
#include "common.h" #include "common.h"
@ -44,7 +39,6 @@
#include "fallback.h" // IWYU pragma: keep #include "fallback.h" // IWYU pragma: keep
#include "flog.h" #include "flog.h"
#include "path.h" #include "path.h"
#include "signal.h"
#include "utf8.h" #include "utf8.h"
#include "util.h" // IWYU pragma: keep #include "util.h" // IWYU pragma: keep
#include "wcstringutil.h" #include "wcstringutil.h"

View file

@ -2,16 +2,17 @@
#define FISH_ENV_UNIVERSAL_COMMON_H #define FISH_ENV_UNIVERSAL_COMMON_H
#include "config.h" // IWYU pragma: keep #include "config.h" // IWYU pragma: keep
#include <pthread.h> #include <cstdint>
#include <stdio.h>
#include <memory> #include <memory>
#include <string>
#include <unordered_set> #include <unordered_set>
#include <utility>
#include <vector> #include <vector>
#include "common.h" #include "common.h"
#include "env.h" #include "env.h"
#include "fds.h" #include "fds.h"
#include "maybe.h"
#include "wutil.h" #include "wutil.h"
/// Callback data, reflecting a change in universal variables. /// Callback data, reflecting a change in universal variables.

View file

@ -4,21 +4,20 @@
#include "event.h" #include "event.h"
#include <signal.h> #include <signal.h>
#include <stddef.h>
#include <unistd.h> #include <unistd.h>
#include <algorithm> #include <algorithm>
#include <array> #include <array>
#include <atomic> #include <atomic>
#include <functional> #include <bitset>
#include <memory> #include <memory>
#include <string> #include <string>
#include <type_traits>
#include "common.h" #include "common.h"
#include "fallback.h" // IWYU pragma: keep #include "fallback.h" // IWYU pragma: keep
#include "input_common.h" #include "flog.h"
#include "io.h" #include "io.h"
#include "maybe.h"
#include "parser.h" #include "parser.h"
#include "proc.h" #include "proc.h"
#include "signal.h" #include "signal.h"

View file

@ -8,12 +8,15 @@
#include <unistd.h> #include <unistd.h>
#include <map> #include <cstdint>
#include <memory> #include <memory>
#include <utility>
#include <vector> #include <vector>
#include "common.h" #include "common.h"
#include "io.h" #include "global_safety.h"
struct io_streams_t;
/// The process id that is used to match any process id. /// The process id that is used to match any process id.
#define EVENT_ANY_PID 0 #define EVENT_ANY_PID 0

View file

@ -4,51 +4,52 @@
// performed have been massive. // performed have been massive.
#include "config.h" #include "config.h"
#include <ctype.h>
#include <errno.h> #include <errno.h>
#include <fcntl.h> #include <fcntl.h>
#ifdef HAVE_SIGINFO_H #ifdef HAVE_SIGINFO_H
#include <siginfo.h> #include <siginfo.h>
#endif #endif
#include <signal.h>
#ifdef HAVE_SPAWN_H
#include <spawn.h>
#endif
#include <paths.h> #include <paths.h>
#include <stdio.h> #include <stdio.h>
#include <sys/wait.h>
#include <unistd.h> #include <unistd.h>
#include <algorithm> #include <algorithm>
#include <cstring> #include <cstring>
#include <cstdint>
#include <cstdlib>
#include <functional> #include <functional>
#include <initializer_list>
#include <map> #include <map>
#include <memory> #include <memory>
#include <stack>
#include <string> #include <string>
#include <type_traits>
#include <vector> #include <vector>
#include <utility>
#include "ast.h"
#include "builtin.h" #include "builtin.h"
#include "common.h" #include "common.h"
#include "env.h" #include "env.h"
#include "exec.h" #include "exec.h"
#include "fallback.h" // IWYU pragma: keep #include "fallback.h" // IWYU pragma: keep
#include "fds.h"
#include "flog.h" #include "flog.h"
#include "function.h" #include "function.h"
#include "global_safety.h"
#include "io.h" #include "io.h"
#include "iothread.h" #include "iothread.h"
#include "job_group.h" #include "job_group.h"
#include "maybe.h"
#include "null_terminated_array.h" #include "null_terminated_array.h"
#include "parse_tree.h" #include "parse_tree.h"
#include "parser.h" #include "parser.h"
#include "path.h"
#include "postfork.h" #include "postfork.h"
#include "proc.h" #include "proc.h"
#include "reader.h" #include "reader.h"
#include "redirection.h" #include "redirection.h"
#include "signal.h"
#include "timer.h" #include "timer.h"
#include "trace.h" #include "trace.h"
#include "wait_handle.h"
#include "wcstringutil.h" #include "wcstringutil.h"
#include "wutil.h" // IWYU pragma: keep #include "wutil.h" // IWYU pragma: keep

View file

@ -2,13 +2,17 @@
#ifndef FISH_EXEC_H #ifndef FISH_EXEC_H
#define FISH_EXEC_H #define FISH_EXEC_H
#include <stddef.h> #include "config.h"
#include <vector> #include <csignal>
#include <memory>
#include "common.h" #include "flog.h"
#include "io.h"
#include "proc.h" #include "proc.h"
class parser_t;
/// Execute the processes specified by \p j in the parser \p. /// Execute the processes specified by \p j in the parser \p.
/// On a true return, the job was successfully launched and the parser will take responsibility for /// On a true return, the job was successfully launched and the parser will take responsibility for
/// cleaning it up. On a false return, the job could not be launched and the caller must clean it /// cleaning it up. On a false return, the job could not be launched and the caller must clean it

View file

@ -1,12 +1,9 @@
// String expansion functions. These functions perform several kinds of parameter expansion. // String expansion functions. These functions perform several kinds of parameter expansion.
// IWYU pragma: no_include <cstddef> #include "config.h" // IWYU pragma: keep
#include "config.h"
#include <errno.h> #include <errno.h>
#include <pwd.h> #include <pwd.h>
#include <stdarg.h> #include <stdarg.h>
#include <stddef.h>
#include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#include <wctype.h> #include <wctype.h>
@ -16,20 +13,11 @@
#ifdef SunOS #ifdef SunOS
#include <procfs.h> #include <procfs.h>
#endif #endif
#ifdef __APPLE__
#include <sys/time.h> // Required to build with old SDK versions
// proc.h needs to be included *after* time.h, this comment stops clang-format from reordering.
#include <sys/proc.h>
#else
#include <dirent.h>
#include <sys/stat.h>
#endif
#include <algorithm> #include <algorithm>
#include <functional>
#include <map> #include <map>
#include <memory> // IWYU pragma: keep #include <memory>
#include <type_traits> #include <unordered_map>
#include <utility> #include <utility>
#include <vector> #include <vector>
@ -40,13 +28,10 @@
#include "expand.h" #include "expand.h"
#include "fallback.h" // IWYU pragma: keep #include "fallback.h" // IWYU pragma: keep
#include "history.h" #include "history.h"
#include "iothread.h" #include "operation_context.h"
#include "parse_constants.h" #include "parse_constants.h"
#include "parse_util.h" #include "parse_util.h"
#include "parser.h"
#include "path.h" #include "path.h"
#include "proc.h"
#include "reader.h"
#include "util.h" #include "util.h"
#include "wcstringutil.h" #include "wcstringutil.h"
#include "wildcard.h" #include "wildcard.h"

View file

@ -7,8 +7,7 @@
#include "config.h" #include "config.h"
#include <stddef.h> #include <initializer_list>
#include <map> #include <map>
#include <string> #include <string>
#include <vector> #include <vector>
@ -18,7 +17,6 @@
#include "maybe.h" #include "maybe.h"
#include "parse_constants.h" #include "parse_constants.h"
class environment_t;
class env_var_t; class env_var_t;
class environment_t; class environment_t;
class operation_context_t; class operation_context_t;

View file

@ -5,41 +5,35 @@
#include "config.h" #include "config.h"
// IWYU likes to recommend adding term.h when we want ncurses.h. // IWYU likes to recommend adding term.h when we want ncurses.h.
// IWYU pragma: no_include term.h // IWYU pragma: no_include "term.h"
#include <dirent.h> // IWYU pragma: keep
#include <errno.h> // IWYU pragma: keep #include <errno.h> // IWYU pragma: keep
#include <fcntl.h> // IWYU pragma: keep #include <fcntl.h> // IWYU pragma: keep
#include <limits.h> // IWYU pragma: keep #include <limits.h> // IWYU pragma: keep
#include <stdarg.h> // IWYU pragma: keep
#include <stdio.h> // IWYU pragma: keep
#include <stdlib.h> #include <stdlib.h>
#include <sys/stat.h> // IWYU pragma: keep
#include <sys/types.h> // IWYU pragma: keep
#include <unistd.h> #include <unistd.h>
#include <wctype.h> #include <wctype.h>
#include <algorithm>
#include <cstring> #include <cstring>
#include <cwchar> #include <cwchar>
#if HAVE_GETTEXT #if HAVE_GETTEXT
#include <libintl.h> #include <libintl.h>
#endif #endif
#if defined(TPARM_SOLARIS_KLUDGE)
#if HAVE_CURSES_H #if HAVE_CURSES_H
#include <curses.h> #include <curses.h> // IWYU pragma: keep
#elif HAVE_NCURSES_H #elif HAVE_NCURSES_H
#include <ncurses.h> // IWYU pragma: keep #include <ncurses.h> // IWYU pragma: keep
#elif HAVE_NCURSES_CURSES_H #elif HAVE_NCURSES_CURSES_H
#include <ncurses/curses.h> #include <ncurses/curses.h> // IWYU pragma: keep
#endif #endif
#if HAVE_TERM_H #if HAVE_TERM_H
#include <term.h> // IWYU pragma: keep #include <term.h> // IWYU pragma: keep
#elif HAVE_NCURSES_TERM_H #elif HAVE_NCURSES_TERM_H
#include <ncurses/term.h> #include <ncurses/term.h>
#endif #endif
#endif
#include <signal.h> // IWYU pragma: keep #include <signal.h> // IWYU pragma: keep
#include <cwchar> // IWYU pragma: keep
#include "common.h" // IWYU pragma: keep #include "common.h" // IWYU pragma: keep
#include "fallback.h" // IWYU pragma: keep #include "fallback.h" // IWYU pragma: keep
@ -138,11 +132,11 @@ char *fish_gettext(const char *msgid) { return (char *)msgid; }
char *fish_bindtextdomain(const char *domainname, const char *dirname) { char *fish_bindtextdomain(const char *domainname, const char *dirname) {
UNUSED(domainname); UNUSED(domainname);
UNUSED(dirname); UNUSED(dirname);
return NULL; return nullptr;
} }
char *fish_textdomain(const char *domainname) { char *fish_textdomain(const char *domainname) {
UNUSED(domainname); UNUSED(domainname);
return NULL; return nullptr;
} }
#endif #endif

View file

@ -3,9 +3,7 @@
#include "config.h" #include "config.h"
#include <stddef.h>
#include <stdint.h> #include <stdint.h>
#include <unistd.h>
// The following include must be kept despite what IWYU says. That's because of the interaction // The following include must be kept despite what IWYU says. That's because of the interaction
// between the weak linking of `wcsdup` and `wcscasecmp` via `#define`s below and the declarations // between the weak linking of `wcsdup` and `wcscasecmp` via `#define`s below and the declarations
// in <wchar.h>. At least on OS X if we don't do this we get compilation errors do to the macro // in <wchar.h>. At least on OS X if we don't do this we get compilation errors do to the macro

View file

@ -3,11 +3,14 @@
#include "fd_monitor.h" #include "fd_monitor.h"
#include <cstring> #include <errno.h>
#include <algorithm>
#include <iterator>
#include <thread> //this_thread::sleep_for #include <thread> //this_thread::sleep_for
#include <type_traits>
#include "flog.h" #include "flog.h"
#include "io.h"
#include "iothread.h" #include "iothread.h"
#include "wutil.h" #include "wutil.h"

View file

@ -4,6 +4,9 @@
#include <chrono> #include <chrono>
#include <cstdint> #include <cstdint>
#include <functional> #include <functional>
#include <utility>
#include <vector>
// Needed for musl // Needed for musl
#include <sys/select.h> // IWYU pragma: keep #include <sys/select.h> // IWYU pragma: keep
@ -11,8 +14,6 @@
#include "fds.h" #include "fds.h"
#include "maybe.h" #include "maybe.h"
class fd_monitor_t;
/// Each item added to fd_monitor_t is assigned a unique ID, which is not recycled. /// Each item added to fd_monitor_t is assigned a unique ID, which is not recycled.
/// Items may have their callback triggered immediately by passing the ID. /// Items may have their callback triggered immediately by passing the ID.
/// Zero is a sentinel. /// Zero is a sentinel.

View file

@ -8,7 +8,7 @@
#include <fcntl.h> #include <fcntl.h>
#include <unistd.h> #include <unistd.h>
#include <cstring> #include <algorithm>
#include "flog.h" #include "flog.h"
#include "wutil.h" #include "wutil.h"

View file

@ -3,16 +3,16 @@
#ifndef FISH_FDS_H #ifndef FISH_FDS_H
#define FISH_FDS_H #define FISH_FDS_H
#include "config.h" // IWYU pragma: keep #include "config.h" // IWYU pragma: keep
#include <poll.h> #include <poll.h> // IWYU pragma: keep
#include <sys/select.h> #include <sys/select.h> // IWYU pragma: keep
#include <sys/types.h> #include <sys/types.h>
#include <algorithm> #include <cstdint>
#include <limits> #include <limits>
#include <string> #include <string>
#include <vector> #include <utility>
#include "common.h" #include "common.h"
#include "maybe.h" #include "maybe.h"

View file

@ -18,37 +18,42 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h" #include "config.h"
#include <errno.h>
#include <fcntl.h> #include <fcntl.h>
#include <getopt.h> #include <getopt.h>
#include <limits.h> #include <limits.h>
#include <locale.h> #include <locale.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <strings.h>
#include <sys/resource.h> #include <sys/resource.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <unistd.h> #include <unistd.h>
#include <algorithm>
#include <cstring> #include <cstring>
#include <cwchar> #include <cwchar>
#include <memory> #include <memory>
#include <string> #include <string>
#include <utility>
#include <vector> #include <vector>
#include "builtin.h" #include "ast.h"
#include "common.h" #include "common.h"
#include "env.h" #include "env.h"
#include "event.h" #include "event.h"
#include "expand.h" #include "expand.h"
#include "fallback.h" // IWYU pragma: keep #include "fallback.h" // IWYU pragma: keep
#include "fds.h"
#include "fish_version.h" #include "fish_version.h"
#include "flog.h" #include "flog.h"
#include "function.h" #include "function.h"
#include "future_feature_flags.h" #include "future_feature_flags.h"
#include "global_safety.h"
#include "history.h" #include "history.h"
#include "io.h" #include "io.h"
#include "maybe.h"
#include "parse_constants.h"
#include "parse_tree.h"
#include "parse_util.h" #include "parse_util.h"
#include "parser.h" #include "parser.h"
#include "path.h" #include "path.h"

View file

@ -23,18 +23,19 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
#include <stddef.h> #include <stddef.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <wctype.h>
#include <algorithm>
#include <cstdint>
#include <cstring> #include <cstring>
#include <cwctype>
#include <cwchar> #include <cwchar>
#include <memory> #include <memory>
#include <stack>
#include <string> #include <string>
#include <tuple> #include <type_traits>
#include <utility>
#include <vector> #include <vector>
#include "ast.h" #include "ast.h"
#include "color.h"
#include "common.h" #include "common.h"
#include "env.h" #include "env.h"
#include "expand.h" #include "expand.h"
@ -42,12 +43,14 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
#include "fish_version.h" #include "fish_version.h"
#include "flog.h" #include "flog.h"
#include "future_feature_flags.h" #include "future_feature_flags.h"
#include "global_safety.h"
#include "highlight.h" #include "highlight.h"
#include "maybe.h"
#include "operation_context.h" #include "operation_context.h"
#include "output.h"
#include "parse_constants.h" #include "parse_constants.h"
#include "parse_util.h" #include "parse_util.h"
#include "print_help.h" #include "print_help.h"
#include "tokenizer.h"
#include "wcstringutil.h" #include "wcstringutil.h"
#include "wutil.h" // IWYU pragma: keep #include "wutil.h" // IWYU pragma: keep

View file

@ -8,10 +8,7 @@
// Type "exit" or "quit" to terminate the program. // Type "exit" or "quit" to terminate the program.
#include "config.h" // IWYU pragma: keep #include "config.h" // IWYU pragma: keep
#include <errno.h>
#include <getopt.h> #include <getopt.h>
#include <signal.h>
#include <stddef.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <termios.h> #include <termios.h>
@ -19,7 +16,6 @@
#include <cstring> #include <cstring>
#include <cwchar> #include <cwchar>
#include <memory>
#include <string> #include <string>
#include <vector> #include <vector>
@ -29,6 +25,7 @@
#include "fish_version.h" #include "fish_version.h"
#include "input.h" #include "input.h"
#include "input_common.h" #include "input_common.h"
#include "maybe.h"
#include "parser.h" #include "parser.h"
#include "print_help.h" #include "print_help.h"
#include "proc.h" #include "proc.h"

View file

@ -1,42 +1,44 @@
// Various bug and feature tests. Compiled and run by make test. // Various bug and feature tests. Compiled and run by make test.
#include "config.h" // IWYU pragma: keep #include "config.h" // IWYU pragma: keep
// IWYU pragma: no_include <cstring>
// IWYU pragma: no_include <cstddef>
#include <errno.h>
#include <fcntl.h> #include <fcntl.h>
#include <libgen.h> #include <libgen.h>
#include <limits.h> #include <limits.h>
#include <math.h>
#include <pthread.h> #include <pthread.h>
#include <signal.h> #include <signal.h>
#include <stdarg.h> #include <stdarg.h>
#include <stddef.h>
#include <stdint.h> #include <stdint.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <sys/select.h> #include <sys/resource.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/utsname.h> #include <sys/utsname.h>
#include <sys/wait.h>
#include <time.h> #include <time.h>
#include <unistd.h> #include <unistd.h>
#include <wctype.h>
#include <algorithm> #include <algorithm>
#include <array> #include <array>
#include <atomic> #include <atomic>
#include <chrono> #include <chrono>
#include <cerrno>
#include <clocale>
#include <cmath> #include <cmath>
#include <cstring> #include <cstring>
#include <cwchar> #include <cwchar>
#include <functional> #include <functional>
#include <future>
#include <initializer_list>
#include <iterator>
#include <limits>
#include <list>
#include <map>
#include <memory> #include <memory>
#include <mutex>
#include <set> #include <set>
#include <string> #include <string>
#include <thread> #include <thread>
#include <type_traits>
#include <unordered_map>
#include <utility> #include <utility>
#include <vector> #include <vector>
@ -46,16 +48,18 @@
#include "color.h" #include "color.h"
#include "common.h" #include "common.h"
#include "complete.h" #include "complete.h"
#include "enum_set.h"
#include "env.h" #include "env.h"
#include "env_universal_common.h" #include "env_universal_common.h"
#include "event.h"
#include "expand.h" #include "expand.h"
#include "fallback.h" // IWYU pragma: keep #include "fallback.h" // IWYU pragma: keep
#include "fds.h"
#include "fd_monitor.h" #include "fd_monitor.h"
#include "function.h" #include "function.h"
#include "future_feature_flags.h" #include "future_feature_flags.h"
#include "highlight.h" #include "highlight.h"
#include "history.h" #include "history.h"
#include "global_safety.h"
#include "input.h" #include "input.h"
#include "input_common.h" #include "input_common.h"
#include "io.h" #include "io.h"
@ -63,6 +67,7 @@
#include "kill.h" #include "kill.h"
#include "lru.h" #include "lru.h"
#include "maybe.h" #include "maybe.h"
#include "null_terminated_array.h"
#include "operation_context.h" #include "operation_context.h"
#include "pager.h" #include "pager.h"
#include "parse_constants.h" #include "parse_constants.h"
@ -82,6 +87,7 @@
#include "topic_monitor.h" #include "topic_monitor.h"
#include "utf8.h" #include "utf8.h"
#include "util.h" #include "util.h"
#include "wait_handle.h"
#include "wcstringutil.h" #include "wcstringutil.h"
#include "wildcard.h" #include "wildcard.h"
#include "wutil.h" // IWYU pragma: keep #include "wutil.h" // IWYU pragma: keep
@ -6629,8 +6635,8 @@ static void test_fd_event_signaller() {
static void test_timer_format() { static void test_timer_format() {
say(L"Testing timer format"); say(L"Testing timer format");
// This test uses numeric output, so we need to set the locale. // This test uses numeric output, so we need to set the locale.
char *saved_locale = strdup(setlocale(LC_NUMERIC, nullptr)); char *saved_locale = strdup(std::setlocale(LC_NUMERIC, nullptr));
setlocale(LC_NUMERIC, "C"); std::setlocale(LC_NUMERIC, "C");
auto t1 = timer_snapshot_t::take(); auto t1 = timer_snapshot_t::take();
t1.cpu_fish.ru_utime.tv_usec = 0; t1.cpu_fish.ru_utime.tv_usec = 0;
t1.cpu_fish.ru_stime.tv_usec = 0; t1.cpu_fish.ru_stime.tv_usec = 0;
@ -6657,7 +6663,7 @@ Executed in 500.00 micros fish external
err(L"Failed to format timer snapshot\nExpected: %ls\nActual:%ls\n", expected, err(L"Failed to format timer snapshot\nExpected: %ls\nActual:%ls\n", expected,
actual.c_str()); actual.c_str());
} }
setlocale(LC_NUMERIC, saved_locale); std::setlocale(LC_NUMERIC, saved_locale);
free(saved_locale); free(saved_locale);
} }
@ -7043,7 +7049,7 @@ void list_tests() {
/// Main test. /// Main test.
int main(int argc, char **argv) { int main(int argc, char **argv) {
setlocale(LC_ALL, ""); std::setlocale(LC_ALL, "");
if (argc >= 2 && std::strcmp(argv[1], "--list") == 0) { if (argc >= 2 && std::strcmp(argv[1], "--list") == 0) {
list_tests(); list_tests();

View file

@ -1,12 +1,18 @@
// fish logging /// fish logging
#include "config.h" #include "config.h" // IWYU pragma: keep
#include "flog.h" #include "flog.h"
#include <unistd.h>
#include <stdarg.h>
#include <algorithm>
#include <cstring>
#include <cwchar>
#include <memory>
#include <vector> #include <vector>
#include "common.h" #include "common.h"
#include "enum_set.h"
#include "global_safety.h" #include "global_safety.h"
#include "parse_util.h" #include "parse_util.h"
#include "wcstringutil.h" #include "wcstringutil.h"

View file

@ -4,20 +4,20 @@
#include "config.h" // IWYU pragma: keep #include "config.h" // IWYU pragma: keep
#include <errno.h>
#include <stdio.h> #include <stdio.h>
#include <cstdint>
#include <string> #include <string>
#include <type_traits> #include <type_traits>
#include <utility> #include <vector>
#include "common.h"
#include "global_safety.h" #include "global_safety.h"
using wcstring = std::wstring; using wcstring = std::wstring;
using wcstring_list_t = std::vector<wcstring>; using wcstring_list_t = std::vector<wcstring>;
template <typename T>
class owning_lock;
namespace flog_details { namespace flog_details {
class category_list_t; class category_list_t;

View file

@ -4,12 +4,9 @@
// //
#include "config.h" // IWYU pragma: keep #include "config.h" // IWYU pragma: keep
// IWYU pragma: no_include <type_traits>
#include <dirent.h>
#include <pthread.h>
#include <stddef.h>
#include <algorithm> #include <algorithm>
#include <cstdint>
#include <cwchar> #include <cwchar>
#include <map> #include <map>
#include <memory> #include <memory>
@ -17,17 +14,20 @@
#include <unordered_map> #include <unordered_map>
#include <unordered_set> #include <unordered_set>
#include <utility> #include <utility>
#include <vector>
#include "ast.h"
#include "autoload.h" #include "autoload.h"
#include "common.h" #include "common.h"
#include "complete.h"
#include "env.h" #include "env.h"
#include "event.h" #include "event.h"
#include "exec.h"
#include "fallback.h" // IWYU pragma: keep #include "fallback.h" // IWYU pragma: keep
#include "function.h" #include "function.h"
#include "maybe.h"
#include "parse_constants.h"
#include "parser.h" #include "parser.h"
#include "parser_keywords.h" #include "parser_keywords.h"
#include "reader.h"
#include "signal.h" #include "signal.h"
#include "wcstringutil.h" #include "wcstringutil.h"
#include "wutil.h" // IWYU pragma: keep #include "wutil.h" // IWYU pragma: keep

View file

@ -5,11 +5,10 @@
#define FISH_FUNCTION_H #define FISH_FUNCTION_H
#include <map> #include <map>
#include <vector> #include <memory>
#include <string>
#include "common.h" #include "common.h"
#include "env.h"
#include "event.h"
#include "parse_tree.h" #include "parse_tree.h"
class parser_t; class parser_t;

View file

@ -3,6 +3,7 @@
#include "future_feature_flags.h" #include "future_feature_flags.h"
#include <cwchar> #include <cwchar>
#include <string>
#include "wcstringutil.h" #include "wcstringutil.h"

View file

@ -2,10 +2,7 @@
#ifndef FISH_FUTURE_FEATURE_FLAGS_H #ifndef FISH_FUTURE_FEATURE_FLAGS_H
#define FISH_FUTURE_FEATURE_FLAGS_H #define FISH_FUTURE_FEATURE_FLAGS_H
#include <assert.h>
#include <atomic> #include <atomic>
#include <unordered_map>
#include "common.h" #include "common.h"

View file

@ -5,7 +5,6 @@
#include "config.h" // IWYU pragma: keep #include "config.h" // IWYU pragma: keep
#include <atomic> #include <atomic>
#include <cassert>
#include "common.h" #include "common.h"

View file

@ -1,17 +1,16 @@
// Functions for syntax highlighting. // Functions for syntax highlighting.
#include "config.h" // IWYU pragma: keep #include "config.h" // IWYU pragma: keep
// IWYU pragma: no_include <cstddef>
#include <dirent.h> #include <dirent.h>
#include <errno.h> #include <errno.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <unistd.h> #include <unistd.h>
#include <algorithm> #include <algorithm>
#include <climits>
#include <cwchar> #include <cwchar>
#include <memory> #include <functional>
#include <string> #include <string>
#include <type_traits>
#include <unordered_map> #include <unordered_map>
#include <unordered_set> #include <unordered_set>
#include <utility> #include <utility>
@ -27,11 +26,13 @@
#include "future_feature_flags.h" #include "future_feature_flags.h"
#include "highlight.h" #include "highlight.h"
#include "history.h" #include "history.h"
#include "maybe.h"
#include "output.h" #include "output.h"
#include "operation_context.h"
#include "parse_constants.h" #include "parse_constants.h"
#include "parse_util.h" #include "parse_util.h"
#include "parser.h"
#include "path.h" #include "path.h"
#include "redirection.h"
#include "tokenizer.h" #include "tokenizer.h"
#include "wcstringutil.h" #include "wcstringutil.h"
#include "wildcard.h" #include "wildcard.h"

View file

@ -3,14 +3,18 @@
#define FISH_HIGHLIGHT_H #define FISH_HIGHLIGHT_H
#include <stddef.h> #include <stddef.h>
#include <stdint.h>
#include <cstddef>
#include <cstdint>
#include <memory>
#include <string>
#include <unordered_map> #include <unordered_map>
#include <vector> #include <vector>
#include "color.h" #include "color.h"
#include "common.h" #include "flog.h"
#include "env.h"
class environment_t;
/// Describes the role of a span of text. /// Describes the role of a span of text.
enum class highlight_role_t : uint8_t { enum class highlight_role_t : uint8_t {

View file

@ -1,50 +1,42 @@
// History functions, part of the user interface. // History functions, part of the user interface.
#include "config.h" // IWYU pragma: keep #include "config.h" // IWYU pragma: keep
#include <ctype.h>
#include <errno.h> #include <errno.h>
#include <fcntl.h> #include <fcntl.h>
#include <pthread.h>
#include <stddef.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include <cstdint>
#include <cstring> #include <cstring>
// We need the sys/file.h for the flock() declaration on Linux but not OS X. // We need the sys/file.h for the flock() declaration on Linux but not OS X.
#include <sys/file.h> // IWYU pragma: keep #include <sys/file.h> // IWYU pragma: keep
#include <sys/stat.h> #include <sys/stat.h>
#include <unistd.h> #include <unistd.h>
#include <wctype.h>
#include <algorithm> #include <algorithm>
#include <atomic>
#include <chrono> #include <chrono>
#include <cwchar> #include <cwchar>
#include <functional> #include <functional>
#include <iterator> #include <iterator>
#include <map> #include <map>
#include <numeric>
#include <random> #include <random>
#include <type_traits>
#include <unordered_set> #include <unordered_set>
#include "ast.h" #include "ast.h"
#include "common.h" #include "common.h"
#include "env.h" #include "env.h"
#include "expand.h"
#include "fallback.h" // IWYU pragma: keep #include "fallback.h" // IWYU pragma: keep
#include "fds.h"
#include "flog.h" #include "flog.h"
#include "global_safety.h" #include "global_safety.h"
#include "history.h" #include "history.h"
#include "history_file.h" #include "history_file.h"
#include "io.h" #include "io.h"
#include "iothread.h" #include "iothread.h"
#include "operation_context.h"
#include "lru.h" #include "lru.h"
#include "parse_constants.h" #include "parse_constants.h"
#include "parse_util.h" #include "parse_util.h"
#include "parser.h"
#include "path.h" #include "path.h"
#include "reader.h"
#include "wcstringutil.h" #include "wcstringutil.h"
#include "wildcard.h" // IWYU pragma: keep #include "wildcard.h" // IWYU pragma: keep
#include "wutil.h" // IWYU pragma: keep #include "wutil.h" // IWYU pragma: keep

View file

@ -2,14 +2,12 @@
#ifndef FISH_HISTORY_H #ifndef FISH_HISTORY_H
#define FISH_HISTORY_H #define FISH_HISTORY_H
// IWYU pragma: no_include <cstddef>
#include <pthread.h>
#include <stddef.h>
#include <stdint.h> #include <stdint.h>
#include <stdio.h> #include <stdio.h>
#include <time.h> #include <time.h>
#include <wctype.h> #include <wctype.h>
#include <algorithm>
#include <deque> #include <deque>
#include <memory> #include <memory>
#include <string> #include <string>
@ -19,6 +17,7 @@
#include <vector> #include <vector>
#include "common.h" #include "common.h"
#include "maybe.h"
#include "wutil.h" // IWYU pragma: keep #include "wutil.h" // IWYU pragma: keep
struct io_streams_t; struct io_streams_t;

View file

@ -1,13 +1,23 @@
#include "config.h" #include "config.h" // IWYU pragma: keep
#include "history_file.h" #include "history_file.h"
#include <ctype.h>
#include <errno.h>
#include <unistd.h>
#include <algorithm>
#include <cstdlib>
#include <cstring> #include <cstring>
#include <cstdint>
#include <cstdio>
#include <cwchar>
#include <utility>
#include "common.h" #include "common.h"
#include "fds.h"
#include "history.h" #include "history.h"
#include "path.h" #include "path.h"
#include "wutil.h"
// Some forward declarations. // Some forward declarations.
static history_item_t decode_item_fish_2_0(const char *base, size_t len); static history_item_t decode_item_fish_2_0(const char *base, size_t len);

View file

@ -1,19 +1,18 @@
#ifndef FISH_HISTORY_FILE_H #ifndef FISH_HISTORY_FILE_H
#define FISH_HISTORY_FILE_H #define FISH_HISTORY_FILE_H
#include "config.h" #include "config.h" // IWYU pragma: keep
#include <sys/mman.h> #include <sys/mman.h>
#include <cassert>
#include <ctime> #include <ctime>
#include <memory> #include <memory>
#include <string>
#include "common.h" #include "common.h"
#include "maybe.h" #include "maybe.h"
class history_item_t; class history_item_t;
class history_tests_t;
// History file types. // History file types.
enum history_file_type_t { history_type_fish_2_0, history_type_fish_1_x }; enum history_file_type_t { history_type_fish_2_0, history_type_fish_1_x };

View file

@ -2,11 +2,9 @@
#include "config.h" #include "config.h"
#include <errno.h> #include <errno.h>
#include <wctype.h>
#include <cwchar>
#if HAVE_TERM_H #if HAVE_TERM_H
#include <curses.h> #include <curses.h> // IWYU pragma: keep
#include <term.h> #include <term.h>
#elif HAVE_NCURSES_TERM_H #elif HAVE_NCURSES_TERM_H
#include <ncurses/term.h> #include <ncurses/term.h>
@ -14,7 +12,6 @@
#include <termios.h> #include <termios.h>
#include <algorithm> #include <algorithm>
#include <atomic>
#include <memory> #include <memory>
#include <string> #include <string>
#include <utility> #include <utility>
@ -24,10 +21,10 @@
#include "env.h" #include "env.h"
#include "event.h" #include "event.h"
#include "fallback.h" // IWYU pragma: keep #include "fallback.h" // IWYU pragma: keep
#include "flog.h"
#include "global_safety.h" #include "global_safety.h"
#include "input.h" #include "input.h"
#include "input_common.h" #include "input_common.h"
#include "io.h"
#include "parser.h" #include "parser.h"
#include "proc.h" #include "proc.h"
#include "reader.h" #include "reader.h"

View file

@ -4,11 +4,15 @@
#define FISH_INPUT_H #define FISH_INPUT_H
#include <stddef.h> #include <stddef.h>
#include <unistd.h>
#include <functional>
#include <memory>
#include <vector> #include <vector>
#include "common.h" #include "common.h"
#include "input_common.h" #include "input_common.h"
#include "maybe.h"
#define FISH_BIND_MODE_VAR L"fish_bind_mode" #define FISH_BIND_MODE_VAR L"fish_bind_mode"
#define DEFAULT_BIND_MODE L"default" #define DEFAULT_BIND_MODE L"default"

View file

@ -3,31 +3,26 @@
#include <errno.h> #include <errno.h>
#include <signal.h> #include <signal.h>
#include <unistd.h> #include <stdio.h>
#include <sys/types.h>
#include <cstring>
#ifdef HAVE_SYS_SELECT_H #ifdef HAVE_SYS_SELECT_H
#include <sys/select.h> #include <sys/select.h>
#endif #endif
#include <stdio.h>
#include <stdlib.h>
#include <sys/select.h>
#include <sys/time.h>
#include <sys/types.h>
#include <algorithm>
#include <climits>
#include <cstring>
#include <cstdlib>
#include <cwchar> #include <cwchar>
#include <deque> #include <deque>
#include <list>
#include <memory>
#include <type_traits>
#include <utility> #include <utility>
#include "common.h" #include "common.h"
#include "env.h" #include "env.h"
#include "env_universal_common.h" #include "env_universal_common.h"
#include "fallback.h" // IWYU pragma: keep #include "fallback.h" // IWYU pragma: keep
#include "fds.h"
#include "flog.h" #include "flog.h"
#include "global_safety.h"
#include "input_common.h" #include "input_common.h"
#include "iothread.h" #include "iothread.h"
#include "wutil.h" #include "wutil.h"

View file

@ -2,9 +2,12 @@
#ifndef INPUT_COMMON_H #ifndef INPUT_COMMON_H
#define INPUT_COMMON_H #define INPUT_COMMON_H
#include <stddef.h> #include <unistd.h>
#include <queue> #include <cstdint>
#include <deque>
#include <string>
#include <utility>
#include "common.h" #include "common.h"
#include "maybe.h" #include "maybe.h"

View file

@ -5,19 +5,18 @@
#include <errno.h> #include <errno.h>
#include <fcntl.h> #include <fcntl.h>
#include <stddef.h>
#include <stdio.h> #include <stdio.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <unistd.h> #include <unistd.h>
#include <cstring>
#include <cwchar> #include <cwchar>
#include <functional>
#include "common.h" #include "common.h"
#include "exec.h"
#include "fallback.h" // IWYU pragma: keep #include "fallback.h" // IWYU pragma: keep
#include "fd_monitor.h" #include "fd_monitor.h"
#include "iothread.h" #include "flog.h"
#include "maybe.h"
#include "path.h" #include "path.h"
#include "redirection.h" #include "redirection.h"
#include "wutil.h" // IWYU pragma: keep #include "wutil.h" // IWYU pragma: keep

View file

@ -1,23 +1,20 @@
#ifndef FISH_IO_H #ifndef FISH_IO_H
#define FISH_IO_H #define FISH_IO_H
#include <pthread.h>
#include <stdarg.h> #include <stdarg.h>
#include <stddef.h> #include <unistd.h>
#include <stdlib.h>
#include <atomic> #include <cstdint>
#include <cwchar>
#include <future> #include <future>
#include <memory> #include <memory>
#include <mutex> #include <string>
#include <utility>
#include <vector> #include <vector>
#include "common.h" #include "common.h"
#include "env.h"
#include "fds.h" #include "fds.h"
#include "flog.h"
#include "global_safety.h" #include "global_safety.h"
#include "maybe.h"
#include "redirection.h" #include "redirection.h"
using std::shared_ptr; using std::shared_ptr;
@ -238,7 +235,6 @@ class io_pipe_t final : public io_data_t {
}; };
class io_buffer_t; class io_buffer_t;
class io_chain_t;
/// Represents filling an io_buffer_t. Very similar to io_pipe_t. /// Represents filling an io_buffer_t. Very similar to io_pipe_t.
class io_bufferfill_t final : public io_data_t { class io_bufferfill_t final : public io_data_t {
@ -275,8 +271,6 @@ class io_bufferfill_t final : public io_data_t {
static separated_buffer_t finish(std::shared_ptr<io_bufferfill_t> &&filler); static separated_buffer_t finish(std::shared_ptr<io_bufferfill_t> &&filler);
}; };
class output_stream_t;
/// An io_buffer_t is a buffer which can populate itself by reading from an fd. /// An io_buffer_t is a buffer which can populate itself by reading from an fd.
/// It is not an io_data_t. /// It is not an io_data_t.
class io_buffer_t { class io_buffer_t {

Some files were not shown because too many files have changed in this diff Show more