From 853c0cf2e20ae80d26be86e5d1f51b92b48af74d Mon Sep 17 00:00:00 2001 From: Jason Lee Date: Tue, 11 Feb 2025 13:07:45 -0700 Subject: [PATCH] remove old test macros OPENDB ADDQUERYFUNCS SQL_EXEC --- docs/latex/sections/build.tex | 20 -------------------- src/CMakeLists.txt | 32 -------------------------------- src/gufi_query/PoolArgs.c | 2 -- src/gufi_query/processdir.c | 6 ------ src/gufi_query/query.c | 2 -- 5 files changed, 62 deletions(-) diff --git a/docs/latex/sections/build.tex b/docs/latex/sections/build.tex index 1f0630840..b409d38eb 100644 --- a/docs/latex/sections/build.tex +++ b/docs/latex/sections/build.tex @@ -214,26 +214,6 @@ \subsubsection{Testing} \end{tabularx} \end{table} -Do not turn these off unless you know what you are doing: - -\begin{table}[H] -\centering -\begin{tabularx}{1.2\textwidth}{| l | X |} - \hline - \texttt{-D=} & Description \\ - \hline - \texttt{RUN\_ADDQUERYFUNCS=} - & Compile \gufiquery without calls to \texttt{addqueryfuncs}. \\ - \hline - \texttt{RUN\_OPENDB=} - & Compile \gufiquery without calls to \texttt{opendb}. \\ - \hline - \texttt{RUN\_SQL\_EXEC=} - & Compile \gufiquery without calls to \texttt{sqlite3\_exec}. \\ - \hline -\end{tabularx} -\end{table} - \subsubsection{Docs} \begin{table}[H] \centering diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index bcfca263c..a7843c2da 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -66,38 +66,6 @@ if (LOCALTIME_R) add_definitions(-DLOCALTIME_R) endif() -# ########################################## -# flags that can be used to modify code -# behavior at compile time for some binaries. -# -# All of these should be left at their -# default values when running the ctest. -# -# All binaries should be able to run -# even if all of the values are changed. -# - -# opendb can be turned off -# addqueryfuncs fails silently if not turned off -# sqlite3_exec fails with error message if not turned off -option(RUN_OPENDB "Whether or not to enable opening databases" ON) -if (RUN_OPENDB) - add_definitions(-DOPENDB=1) -endif() - -# addqueryfuncs can be turned off -option(RUN_ADDQUERYFUNCS "Add custom functions to opened databases" ON) -if (RUN_ADDQUERYFUNCS) - add_definitions(-DADDQUERYFUNCS=1) -endif() - -# sqlite3_exec can be turned off -option(RUN_SQL_EXEC "Call sqlite3_exec" ON) -if (RUN_SQL_EXEC) - add_definitions(-DSQL_EXEC=1) -endif() -# ########################################## - # create the GUFI library, which contains all of the common source files set(GUFI_SOURCES BottomUp.c diff --git a/src/gufi_query/PoolArgs.c b/src/gufi_query/PoolArgs.c index 45e18c304..bd3b8832b 100644 --- a/src/gufi_query/PoolArgs.c +++ b/src/gufi_query/PoolArgs.c @@ -105,11 +105,9 @@ int PoolArgs_init(PoolArgs_t *pa, struct input *in, pthread_mutex_t *global_mute break; } - #ifdef ADDQUERYFUNCS if (addqueryfuncs(ta->outdb) != 0) { fprintf(stderr, "Warning: Could not add functions to sqlite\n"); } - #endif /* create empty xattr tables to UNION to */ char *err = NULL; diff --git a/src/gufi_query/processdir.c b/src/gufi_query/processdir.c index 39154fd2c..2c58985df 100644 --- a/src/gufi_query/processdir.c +++ b/src/gufi_query/processdir.c @@ -183,18 +183,14 @@ int processdir(QPTPool_t *ctx, const size_t id, void *data, void *args) { } if (gqw->work.level >= in->min_level) { - #if OPENDB db = attachdb(dbname, ta->outdb, ATTACH_NAME, in->open_flags, 1); - #endif /* this is needed to add some query functions like path() uidtouser() gidtogroup() */ - #ifdef ADDQUERYFUNCS if (db) { if (addqueryfuncs_with_context(db, &gqw->work) != 0) { fprintf(stderr, "Could not add functions to sqlite\n"); } } - #endif } /* get number of subdirs walked on first call to process_queries */ @@ -346,11 +342,9 @@ int processdir(QPTPool_t *ctx, const size_t id, void *data, void *args) { process_queries(pa, ctx, id, dir, gqw, db, dbname, dbname_len, 1, &subdirs_walked_count); } - #ifdef OPENDB if (db) { detachdb_cached(dbname, db, pa->detach, 1); } - #endif /* restore mtime and atime */ if (db) { diff --git a/src/gufi_query/query.c b/src/gufi_query/query.c index 6f3e769b6..fd66726a5 100644 --- a/src/gufi_query/query.c +++ b/src/gufi_query/query.c @@ -83,7 +83,6 @@ void querydb(struct work *work, }; char *err = NULL; -#ifdef SQL_EXEC if (sqlite3_exec(db, query, callback, &args, &err) != SQLITE_OK) { char buf[MAXPATH]; present_user_path(dbname, dbname_len, @@ -91,7 +90,6 @@ void querydb(struct work *work, buf, sizeof(buf)); sqlite_print_err_and_free(err, stderr, "Error: %s: %s: \"%s\"\n", err, buf, query); } -#endif *rc = args.rows; }