diff options
Diffstat (limited to '')
-rw-r--r-- | src/lnav.hh | 54 |
1 files changed, 33 insertions, 21 deletions
diff --git a/src/lnav.hh b/src/lnav.hh index e235067..b260333 100644 --- a/src/lnav.hh +++ b/src/lnav.hh @@ -34,20 +34,14 @@ #include <list> #include <map> -#include <memory> -#include <set> -#include <stack> #include <unordered_map> #include <signal.h> #include <sys/time.h> -#include "archive_manager.hh" #include "base/ansi_scrubber.hh" -#include "base/future_util.hh" #include "base/isc.hh" #include "bottom_status_source.hh" -#include "bound_tags.hh" #include "command_executor.hh" #include "config.h" #include "db_sub_source.hh" @@ -55,20 +49,14 @@ #include "file_collection.hh" #include "files_sub_source.hh" #include "filter_status_source.hh" -#include "grep_highlighter.hh" +#include "gantt_status_source.hh" #include "hist_source.hh" #include "input_dispatcher.hh" -#include "listview_curses.hh" -#include "log_format_loader.hh" #include "log_vtab_impl.hh" -#include "logfile.hh" -#include "piper_proc.hh" #include "plain_text_source.hh" #include "preview_status_source.hh" #include "readline_curses.hh" -#include "relative_time.hh" -#include "safe/safe.h" -#include "sql_util.hh" +#include "sqlitepp.hh" #include "statusview_curses.hh" #include "textfile_sub_source.hh" #include "view_helpers.hh" @@ -85,8 +73,10 @@ typedef enum { LNS_FILTER, LNS_FILTER_HELP, LNS_DOC, - LNS_PREVIEW, + LNS_PREVIEW0, + LNS_PREVIEW1, LNS_SPECTRO, + LNS_GANTT, LNS__MAX } lnav_status_t; @@ -157,7 +147,12 @@ struct key_repeat_history { }; }; -using file_location_t = mapbox::util::variant<vis_line_t, std::string>; +enum class lnav_exec_phase : int { + INIT, + PRELOAD, + LOADING, + INTERACTIVE, +}; struct lnav_data_t { std::map<std::string, std::list<session_pair_t>> ld_session_id; @@ -174,7 +169,8 @@ struct lnav_data_t { std::list<child_poller> ld_child_pollers; std::list<std::pair<std::string, file_location_t>> ld_files_to_front; bool ld_stdout_used; - sig_atomic_t ld_looping; + std::atomic_uint32_t ld_sigint_count{0}; + sig_atomic_t ld_looping{true}; sig_atomic_t ld_winched; sig_atomic_t ld_child_terminated; unsigned long ld_flags; @@ -187,8 +183,9 @@ struct lnav_data_t { filter_status_source ld_filter_status_source; filter_help_status_source ld_filter_help_status_source; doc_status_source ld_doc_status_source; - preview_status_source ld_preview_status_source; + preview_status_source ld_preview_status_source[2]; std::unique_ptr<spectro_status_source> ld_spectro_status_source; + gantt_status_source ld_gantt_status_source; bool ld_preview_hidden; int64_t ld_preview_generation{0}; action_broadcaster<listview_curses> ld_scroll_broadcaster; @@ -206,14 +203,16 @@ struct lnav_data_t { textview_curses ld_example_view; plain_text_source ld_match_source; textview_curses ld_match_view; - plain_text_source ld_preview_source; - textview_curses ld_preview_view; + plain_text_source ld_preview_source[2]; + textview_curses ld_preview_view[2]; plain_text_source ld_user_message_source; textview_curses ld_user_message_view; std::chrono::time_point<std::chrono::steady_clock> ld_user_message_expiration; textview_curses ld_spectro_details_view; plain_text_source ld_spectro_no_details_source; + textview_curses ld_gantt_details_view; + plain_text_source ld_gantt_details_source; view_stack<textview_curses> ld_view_stack; textview_curses* ld_last_view; @@ -233,6 +232,8 @@ struct lnav_data_t { db_label_source ld_db_row_source; db_overlay_source ld_db_overlay; + db_label_source ld_db_preview_source[2]; + db_overlay_source ld_db_preview_overlay_source[2]; std::vector<std::string> ld_db_key_names; vis_line_t ld_last_pretty_print_top; @@ -243,7 +244,6 @@ struct lnav_data_t { std::unordered_map<std::string, std::string> ld_table_ddl; std::list<pid_t> ld_children; - std::list<std::shared_ptr<piper_proc>> ld_pipers; input_state_tracker ld_input_state; input_dispatcher ld_input_dispatcher; @@ -256,6 +256,8 @@ struct lnav_data_t { bool ld_initial_build{false}; bool ld_show_help_view{false}; + bool ld_treat_stdin_as_log{false}; + lnav_exec_phase ld_exec_phase{lnav_exec_phase::INIT}; lnav::func::scoped_cb ld_status_refresher; @@ -270,17 +272,27 @@ class main_looper public: }; +enum class verbosity_t : int { + quiet, + standard, + verbose, +}; + extern struct lnav_data_t lnav_data; +extern verbosity_t verbosity; extern readline_context::command_map_t lnav_commands; extern const int ZOOM_LEVELS[]; extern const ssize_t ZOOM_COUNT; +#define HELP_MSG_CTRL(x, msg) "Press '" ANSI_BOLD("CTRL-" #x) "' " msg + #define HELP_MSG_1(x, msg) "Press '" ANSI_BOLD(#x) "' " msg #define HELP_MSG_2(x, y, msg) "Press " ANSI_BOLD(#x) "/" ANSI_BOLD(#y) " " msg bool setup_logline_table(exec_context& ec); void wait_for_children(); +void wait_for_pipers(nonstd::optional<timeval> deadline = nonstd::nullopt); #endif |