aboutsummaryrefslogtreecommitdiffstats
path: root/libfonts_used_environs.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2023-01-08 16:23:56 +0100
committerMattias Andrée <maandree@kth.se>2023-01-08 16:23:56 +0100
commit627e5b9789c663343c74dac6535724ddc63aae1c (patch)
treeaf78890b546b774267ff82520f0756dd159f8d86 /libfonts_used_environs.c
parentImprove libfonts_get_default_font_name and draft implementation of libfonts_get_default_font (diff)
downloadlibfonts-627e5b9789c663343c74dac6535724ddc63aae1c.tar.gz
libfonts-627e5b9789c663343c74dac6535724ddc63aae1c.tar.bz2
libfonts-627e5b9789c663343c74dac6535724ddc63aae1c.tar.xz
Add environment spoofing
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'libfonts_used_environs.c')
-rw-r--r--libfonts_used_environs.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/libfonts_used_environs.c b/libfonts_used_environs.c
new file mode 100644
index 0000000..54232b4
--- /dev/null
+++ b/libfonts_used_environs.c
@@ -0,0 +1,34 @@
+/* See LICENSE file for copyright and license details. */
+#include "common.h"
+#ifndef TEST
+
+
+const char *const libfonts_used_environs[] = {
+ "LIBFONTS_DEFAULT_SANS_SERIF",
+ "LIBFONTS_DEFAULT_SERIF",
+ "LIBFONTS_DEFAULT_MONOSPACE",
+ "XDG_CONFIG_HOME",
+ "HOME",
+ NULL
+};
+
+
+#else
+
+
+int
+main(void)
+{
+ size_t i, j, n;
+ for (n = 0; n < 100; n++)
+ if (!libfonts_used_environs[n])
+ break;
+ ASSERT(n < 100);
+ for (i = 0; i < n; i++)
+ for (j = i + 1; j < n; j++)
+ ASSERT(strcmp(libfonts_used_environs[i], libfonts_used_environs[j]));
+ return 0;
+}
+
+
+#endif