mirror of https://github.com/tstack/lnav
[build] try to optimize compile time
parent
f2256c7aab
commit
4564e162d0
@ -0,0 +1,94 @@
|
||||
/**
|
||||
* Copyright (c) 2022, Timothy Stack
|
||||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* * Neither the name of Timothy Stack nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ''AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "fmt/format.h"
|
||||
#include "fs_util.hh"
|
||||
#include "opt_util.hh"
|
||||
|
||||
namespace lnav {
|
||||
namespace filesystem {
|
||||
|
||||
Result<std::pair<ghc::filesystem::path, int>, std::string>
|
||||
open_temp_file(const ghc::filesystem::path &pattern)
|
||||
{
|
||||
auto pattern_str = pattern.string();
|
||||
char pattern_copy[pattern_str.size() + 1];
|
||||
int fd;
|
||||
|
||||
strcpy(pattern_copy, pattern_str.c_str());
|
||||
if ((fd = mkstemp(pattern_copy)) == -1) {
|
||||
return Err(fmt::format("unable to create temporary file: {} -- {}",
|
||||
pattern.string(), strerror(errno)));
|
||||
}
|
||||
|
||||
return Ok(std::make_pair(ghc::filesystem::path(pattern_copy), fd));
|
||||
}
|
||||
|
||||
Result<std::string, std::string> read_file(const ghc::filesystem::path &path)
|
||||
{
|
||||
try {
|
||||
ghc::filesystem::ifstream file_stream(path);
|
||||
|
||||
if (!file_stream) {
|
||||
return Err(std::string(strerror(errno)));
|
||||
}
|
||||
|
||||
std::string retval;
|
||||
retval.assign((std::istreambuf_iterator<char>(file_stream)),
|
||||
std::istreambuf_iterator<char>());
|
||||
return Ok(retval);
|
||||
} catch (const std::exception& e) {
|
||||
return Err(std::string(e.what()));
|
||||
}
|
||||
}
|
||||
|
||||
std::string build_path(const std::vector<ghc::filesystem::path> &paths)
|
||||
{
|
||||
std::string retval;
|
||||
|
||||
for (const auto &path : paths) {
|
||||
if (path.empty()) {
|
||||
continue;
|
||||
}
|
||||
if (!retval.empty()) {
|
||||
retval += ":";
|
||||
}
|
||||
retval += path.string();
|
||||
}
|
||||
auto env_path = getenv_opt("PATH");
|
||||
if (env_path) {
|
||||
retval += ":" + std::string(*env_path);
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
/**
|
||||
* Copyright (c) 2022, Timothy Stack
|
||||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* * Neither the name of Timothy Stack nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ''AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef lnav_fs_util_hh
|
||||
#define lnav_fs_util_hh
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "result.h"
|
||||
#include "ghc/filesystem.hpp"
|
||||
|
||||
namespace lnav {
|
||||
namespace filesystem {
|
||||
|
||||
inline int statp(const ghc::filesystem::path &path, struct stat *buf) {
|
||||
return stat(path.c_str(), buf);
|
||||
}
|
||||
|
||||
inline int openp(const ghc::filesystem::path &path, int flags) {
|
||||
return open(path.c_str(), flags);
|
||||
}
|
||||
|
||||
inline int openp(const ghc::filesystem::path &path, int flags, mode_t mode) {
|
||||
return open(path.c_str(), flags, mode);
|
||||
}
|
||||
|
||||
Result<std::pair<ghc::filesystem::path, int>, std::string>
|
||||
open_temp_file(const ghc::filesystem::path &pattern);
|
||||
|
||||
Result<std::string, std::string> read_file(const ghc::filesystem::path &path);
|
||||
|
||||
std::string build_path(const std::vector<ghc::filesystem::path> &paths);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
@ -0,0 +1,172 @@
|
||||
/**
|
||||
* Copyright (c) 2022, Timothy Stack
|
||||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* * Neither the name of Timothy Stack nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ''AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* @file readline_context.hh
|
||||
*/
|
||||
|
||||
#ifndef readline_context_hh
|
||||
#define readline_context_hh
|
||||
|
||||
#include <string>
|
||||
#include <set>
|
||||
#include <readline/history.h>
|
||||
|
||||
#include "base/result.h"
|
||||
#include "help_text.hh"
|
||||
|
||||
class attr_line_t;
|
||||
struct exec_context;
|
||||
|
||||
typedef void (*readline_highlighter_t)(attr_line_t &line, int x);
|
||||
|
||||
/**
|
||||
* Container for information related to different readline contexts. Since
|
||||
* lnav uses readline for different inputs, we need a way to keep things like
|
||||
* history and tab-completions separate.
|
||||
*/
|
||||
class readline_context {
|
||||
public:
|
||||
typedef Result<std::string, std::string> (*command_func_t)(exec_context &ec,
|
||||
std::string cmdline, std::vector<std::string> &args);
|
||||
typedef std::string (*prompt_func_t)(exec_context &ec,
|
||||
const std::string &cmdline);
|
||||
typedef struct _command_t {
|
||||
const char *c_name;
|
||||
command_func_t c_func;
|
||||
|
||||
struct help_text c_help;
|
||||
prompt_func_t c_prompt{nullptr};
|
||||
|
||||
_command_t(const char *name,
|
||||
command_func_t func,
|
||||
help_text help = {},
|
||||
prompt_func_t prompt = nullptr) noexcept
|
||||
: c_name(name), c_func(func), c_help(std::move(help)), c_prompt(prompt) {};
|
||||
|
||||
_command_t(command_func_t func) noexcept
|
||||
: c_name("anon"), c_func(func) {};
|
||||
} command_t;
|
||||
typedef std::map<std::string, command_t *> command_map_t;
|
||||
|
||||
readline_context(std::string name,
|
||||
command_map_t *commands = nullptr,
|
||||
bool case_sensitive = true);
|
||||
|
||||
const std::string &get_name() const { return this->rc_name; };
|
||||
|
||||
void load();
|
||||
|
||||
void save();
|
||||
|
||||
void add_possibility(const std::string& type, const std::string& value)
|
||||
{
|
||||
this->rc_possibilities[type].insert(value);
|
||||
};
|
||||
|
||||
void rem_possibility(const std::string& type, const std::string& value)
|
||||
{
|
||||
this->rc_possibilities[type].erase(value);
|
||||
};
|
||||
|
||||
void clear_possibilities(const std::string& type)
|
||||
{
|
||||
this->rc_possibilities[type].clear();
|
||||
};
|
||||
|
||||
bool is_case_sensitive() const
|
||||
{
|
||||
return this->rc_case_sensitive;
|
||||
};
|
||||
|
||||
readline_context &set_append_character(int ch) {
|
||||
this->rc_append_character = ch;
|
||||
|
||||
return *this;
|
||||
};
|
||||
|
||||
int get_append_character() const {
|
||||
return this->rc_append_character;
|
||||
}
|
||||
|
||||
readline_context &set_highlighter(readline_highlighter_t hl) {
|
||||
this->rc_highlighter = hl;
|
||||
return *this;
|
||||
};
|
||||
|
||||
readline_context &set_quote_chars(const char *qc) {
|
||||
this->rc_quote_chars = qc;
|
||||
|
||||
return *this;
|
||||
};
|
||||
|
||||
readline_context &with_readline_var(char **var, const char *val) {
|
||||
this->rc_vars.emplace_back(var, val);
|
||||
|
||||
return *this;
|
||||
};
|
||||
|
||||
readline_highlighter_t get_highlighter() const {
|
||||
return this->rc_highlighter;
|
||||
};
|
||||
|
||||
static int command_complete(int, int);
|
||||
|
||||
std::map<std::string, std::string> rc_prefixes;
|
||||
private:
|
||||
static char **attempted_completion(const char *text, int start, int end);
|
||||
static char *completion_generator(const char *text, int state);
|
||||
|
||||
static readline_context * loaded_context;
|
||||
static std::set<std::string> *arg_possibilities;
|
||||
|
||||
struct readline_var {
|
||||
readline_var(char **dst, const char *val) {
|
||||
this->rv_dst.ch = dst;
|
||||
this->rv_val.ch = val;
|
||||
}
|
||||
|
||||
union {
|
||||
char **ch;
|
||||
} rv_dst;
|
||||
union {
|
||||
const char *ch;
|
||||
} rv_val;
|
||||
};
|
||||
|
||||
std::string rc_name;
|
||||
HISTORY_STATE rc_history;
|
||||
std::map<std::string, std::set<std::string>> rc_possibilities;
|
||||
std::map<std::string, std::vector<std::string>> rc_prototypes;
|
||||
bool rc_case_sensitive;
|
||||
int rc_append_character;
|
||||
const char *rc_quote_chars;
|
||||
readline_highlighter_t rc_highlighter;
|
||||
std::vector<readline_var> rc_vars;
|
||||
};
|
||||
|
||||
#endif
|
@ -0,0 +1,66 @@
|
||||
/**
|
||||
* Copyright (c) 2015, Timothy Stack
|
||||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* * Neither the name of Timothy Stack nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ''AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* @file shlex.resolver.hh
|
||||
*/
|
||||
|
||||
#ifndef lnav_shlex_resolver_hh
|
||||
#define lnav_shlex_resolver_hh
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
class scoped_resolver {
|
||||
public:
|
||||
scoped_resolver(std::initializer_list<std::map<std::string, std::string> *> l) {
|
||||
this->sr_stack.insert(this->sr_stack.end(), l.begin(), l.end());
|
||||
};
|
||||
|
||||
typedef std::map<std::string, std::string>::const_iterator const_iterator;
|
||||
|
||||
const_iterator find(const std::string &str) const {
|
||||
const_iterator retval;
|
||||
|
||||
for (auto scope : this->sr_stack) {
|
||||
if ((retval = scope->find(str)) != scope->end()) {
|
||||
return retval;
|
||||
}
|
||||
}
|
||||
|
||||
return this->end();
|
||||
};
|
||||
|
||||
const_iterator end() const {
|
||||
return this->sr_stack.back()->end();
|
||||
}
|
||||
|
||||
std::vector<const std::map<std::string, std::string> *> sr_stack;
|
||||
};
|
||||
|
||||
#endif
|
@ -0,0 +1,56 @@
|
||||
/**
|
||||
* Copyright (c) 2022, Timothy Stack
|
||||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* * Neither the name of Timothy Stack nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ''AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* @file sql_help.hh
|
||||
*/
|
||||
|
||||
#ifndef sql_help_hh
|
||||
#define sql_help_hh
|
||||
|
||||
#include <map>
|
||||
|
||||
#include "help_text.hh"
|
||||
#include "attr_line.hh"
|
||||
|
||||
extern string_attr_type SQL_COMMAND_ATTR;
|
||||
extern string_attr_type SQL_KEYWORD_ATTR;
|
||||
extern string_attr_type SQL_IDENTIFIER_ATTR;
|
||||
extern string_attr_type SQL_FUNCTION_ATTR;
|
||||
extern string_attr_type SQL_STRING_ATTR;
|
||||
extern string_attr_type SQL_OPERATOR_ATTR;
|
||||
extern string_attr_type SQL_PAREN_ATTR;
|
||||
extern string_attr_type SQL_GARBAGE_ATTR;
|
||||
|
||||
void annotate_sql_statement(attr_line_t &al_inout);
|
||||
|
||||
extern std::multimap<std::string, help_text *> sqlite_function_help;
|
||||
|
||||
std::string sql_keyword_re();
|
||||
std::vector<const help_text *> find_sql_help_for_line(const attr_line_t &al, size_t x);
|
||||
|
||||
#endif
|
@ -0,0 +1,38 @@
|
||||
/**
|
||||
* Copyright (c) 2022, Timothy Stack
|
||||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* * Neither the name of Timothy Stack nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ''AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* @file sqlitepp.hh
|
||||
*/
|
||||
|
||||
#ifndef lnav_sqlitepp_hh
|
||||
#define lnav_sqlitepp_hh
|
||||
|
||||
/* XXX figure out how to do this with the template */
|
||||
void sqlite_close_wrapper(void *mem);
|
||||
|
||||
#endif
|
@ -0,0 +1,41 @@
|
||||
/**
|
||||
* Copyright (c) 2022, Timothy Stack
|
||||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* * Neither the name of Timothy Stack nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ''AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* @file view_helpers.examples.hh
|
||||
*/
|
||||
|
||||
#ifndef lnav_view_helpers_examples_hh
|
||||
#define lnav_view_helpers_examples_hh
|
||||
|
||||
#include "help_text.hh"
|
||||
#include "attr_line.hh"
|
||||
|
||||
void execute_examples();
|
||||
attr_line_t eval_example(const help_text &ht, const help_example &ex);
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue