чување 7e1912b2d16aa548710c1c6e82cea0092110dd4c
родитељ 34fb0fa641444bdcc22905468e7e69b33ab8080c
Аутор: Страхиња Радић <contact@strahinja.org>
Датум: Mon, 1 Jul 2024 18:31:29 +0200
Tidy up includes; remove ONLY_DEFS
Diffstat:
измењених датотека: 5, додавања: 11(+), брисања: 17(-)
diff --git a/config.def.h b/config.def.h
@@ -2,8 +2,6 @@
* any later version. Copyright (C) 2022-2024 Страхиња Радић.
* See the file LICENSE for exact copyright and license details. */
-#ifndef ONLY_DEFS
-
#define DLG_FG TB_BLACK
#define DLG_BG TB_WHITE
#define ERROR_FG TB_WHITE | TB_BOLD
@@ -263,4 +261,3 @@ static const struct StatusSegment status_segments[] = {
.alignment = RIGHT},
};
/* clang-format on */
-#endif /* ONLY_DEFS */
diff --git a/draw.c b/draw.c
@@ -7,11 +7,11 @@
#include <stdlib.h>
#include <string.h>
-#include "version.h"
-#include "limit.h"
-#include "util.h"
#include "draw.h"
#include "config.h"
+#include "limit.h"
+#include "util.h"
+#include "version.h"
enum {
UNKNOWN_MODE,
diff --git a/draw.h b/draw.h
@@ -8,8 +8,11 @@
#include <wchar.h>
#define TB_OPT_V1_COMPAT
+
#include "termbox.h"
+#define TB_KEY_CTRL_SPACE 0x00
+
#define BORDER_NW ((uint32_t)0x250c)
#define BORDER_NE ((uint32_t)0x2510)
#define BORDER_SW ((uint32_t)0x2514)
diff --git a/sled.c b/sled.c
@@ -13,9 +13,6 @@
#include <sys/stat.h>
#include <unistd.h>
-#define TB_OPT_V1_COMPAT
-#define TB_IMPL
-
#define COPYRIGHT \
(" This program is licensed under the terms of GNU GPL v3" \
" or (at your option)\n" \
@@ -28,17 +25,16 @@
" LICENSE.termbox.\n")
#define SLED_C_GLOBALS
-#define ONLY_DEFS
-#include "config.h"
+#define TB_OPT_V1_COMPAT
+#define TB_IMPL
+
#include "draw.h"
-#include "limit.h"
#include "sled.h"
+#include "config.h"
+#include "limit.h"
#include "util.h"
#include "version.h"
-#undef ONLY_DEFS
-#include "config.h"
-
#define SEL_NOT_EMPTY(state) \
((state->sel_start.row != state->sel_end.row) \
|| (state->sel_start.col != state->sel_end.col))
diff --git a/util.h b/util.h
@@ -115,8 +115,6 @@ enum {
enum { ACT_WRITING, ACT_READING, ACT_WRAPPING };
-#define TB_KEY_CTRL_SPACE 0x00
-
size_t u8_string_to_unicode(uint32_t* us, const char* s, const size_t max);
size_t unicode_string_to_u8(char* s, const uint32_t* us, const size_t max);
int u32_has_nonblanks(const uint32_t* s);