aboutsummaryrefslogtreecommitdiffstats
path: root/fm.c
diff options
context:
space:
mode:
authorverdant <im@verdant.ee>2026-07-27 20:37:07 +0800
committerverdant <im@verdant.ee>2026-07-27 20:37:07 +0800
commitabda1e9883555734f41c7a12e464b13a72c37a6d (patch)
tree42dd2f6d95ec9c5bf3de2f80192ba25a95c38332 /fm.c
parent19dbf0d0c12940ce1456ef9a251430ecbb66b9fe (diff)
downloadsf-abda1e9883555734f41c7a12e464b13a72c37a6d.tar.gz
sf-abda1e9883555734f41c7a12e464b13a72c37a6d.zip
Move two util functions to the bottom
Diffstat (limited to 'fm.c')
-rw-r--r--fm.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/fm.c b/fm.c
index c7a6ff1..afd390b 100644
--- a/fm.c
+++ b/fm.c
@@ -19,23 +19,6 @@
static magic_t g_magic_ctx = NULL;
-void magic_init(void)
-{
- if (!g_magic_ctx) {
- g_magic_ctx = magic_open(MAGIC_MIME_TYPE | MAGIC_SYMLINK);
- if (!g_magic_ctx)
- die("Cannot initialize magic");
- if (magic_load(g_magic_ctx, NULL) != 0)
- die("Magic load failed: %s", magic_error(g_magic_ctx));
- }
-}
-
-void magic_cleanup(void)
-{
- if (g_magic_ctx)
- magic_close(g_magic_ctx);
-}
-
/* Function forward declarations */
static fm_info *fm_w_init(terminal *term);
static void fm_file_list_init(file_list *l, int cap);
@@ -334,3 +317,20 @@ void fm_cd_down(fm_info *info)
free(next_dir);
}
+
+void magic_init(void)
+{
+ if (!g_magic_ctx) {
+ g_magic_ctx = magic_open(MAGIC_MIME_TYPE | MAGIC_SYMLINK);
+ if (!g_magic_ctx)
+ die("Cannot initialize magic");
+ if (magic_load(g_magic_ctx, NULL) != 0)
+ die("Magic load failed: %s", magic_error(g_magic_ctx));
+ }
+}
+
+void magic_cleanup(void)
+{
+ if (g_magic_ctx)
+ magic_close(g_magic_ctx);
+}