summaryrefslogtreecommitdiffstats
path: root/src/static_file_vtab.cc
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/static_file_vtab.cc24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/static_file_vtab.cc b/src/static_file_vtab.cc
index f884cb3..a953a8d 100644
--- a/src/static_file_vtab.cc
+++ b/src/static_file_vtab.cc
@@ -31,26 +31,17 @@
#include "static_file_vtab.hh"
-#include <stdlib.h>
#include <string.h>
#include "base/auto_mem.hh"
#include "base/fs_util.hh"
#include "base/lnav_log.hh"
-#include "base/paths.hh"
#include "config.h"
#include "ghc/filesystem.hpp"
#include "lnav.hh"
#include "vtab_module.hh"
-const char* const STATIC_FILE_CREATE_STMT = R"(
--- Access static files in the lnav configuration directories
-CREATE TABLE lnav_static_files (
- name TEXT PRIMARY KEY,
- filepath TEXT,
- content BLOB HIDDEN
-);
-)";
+namespace {
struct static_file_vtab {
sqlite3_vtab base;
@@ -163,7 +154,7 @@ sfvt_open(sqlite3_vtab* p_svt, sqlite3_vtab_cursor** pp_cursor)
{
static_file_vtab* p_vt = (static_file_vtab*) p_svt;
- p_vt->base.zErrMsg = NULL;
+ p_vt->base.zErrMsg = nullptr;
sf_vtab_cursor* p_cur = (sf_vtab_cursor*) new sf_vtab_cursor();
@@ -309,6 +300,17 @@ static sqlite3_module static_file_vtab_module = {
nullptr, /* xFindFunction - function overloading */
};
+} // namespace
+
+const char* const STATIC_FILE_CREATE_STMT = R"(
+-- Access static files in the lnav configuration directories
+CREATE TABLE lnav_static_files (
+ name TEXT PRIMARY KEY,
+ filepath TEXT,
+ content BLOB HIDDEN
+);
+)";
+
int
register_static_file_vtab(sqlite3* db)
{