aboutsummaryrefslogtreecommitdiffstats
path: root/libenv_get_complete_list.c
diff options
context:
space:
mode:
authorMattias Andrée <m@maandree.se>2025-01-31 19:59:22 +0100
committerMattias Andrée <m@maandree.se>2025-01-31 19:59:22 +0100
commit66ff79748a73888b802bab4866b350989a48a136 (patch)
tree0c194581586468f3f8630e55bc83ef04d989ca80 /libenv_get_complete_list.c
parentFix some mistakes (diff)
downloadlibenv-66ff79748a73888b802bab4866b350989a48a136.tar.gz
libenv-66ff79748a73888b802bab4866b350989a48a136.tar.bz2
libenv-66ff79748a73888b802bab4866b350989a48a136.tar.xz
Fix mistakes and add tests
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to '')
-rw-r--r--libenv_get_complete_list.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/libenv_get_complete_list.c b/libenv_get_complete_list.c
index 9a542c9..e40ed91 100644
--- a/libenv_get_complete_list.c
+++ b/libenv_get_complete_list.c
@@ -1,8 +1,7 @@
/* See LICENSE file for copyright and license details. */
+#ifndef TEST_C
#include "common.h"
-#define NCLASSWORDS 1U
-
#define _(E) ((uint64_t)1 << (E))
@@ -48,10 +47,11 @@ DECLARE(classes__exec__path, _(LIBENV_EXEC) | SU_SAFE | LOGIN_UNSAFE | PATH);
#undef REMOTE_UNSAFE
#undef PATH
#undef DECLARE
+
#define V(S) {S, CLASSES}
-static struct libenv_variable list[] = {
+static struct libenv_variable list[] = { /* TODO validate */
#define CLASSES classes__display
V("DISPLAY"),
@@ -199,9 +199,11 @@ static struct libenv_variable list[] = {
#undef V
+#endif
+
const struct libenv_variable *
-libenv_get_complete_list(size_t *nclasswords_out, size_t *count_out) /* TODO test */
+libenv_get_complete_list(size_t *nclasswords_out, size_t *count_out)
{
if (nclasswords_out)
*nclasswords_out = NCLASSWORDS;