diff options
| author | verdant <im@verdant.ee> | 2026-07-27 20:37:07 +0800 |
|---|---|---|
| committer | verdant <im@verdant.ee> | 2026-07-27 20:37:07 +0800 |
| commit | abda1e9883555734f41c7a12e464b13a72c37a6d (patch) | |
| tree | 42dd2f6d95ec9c5bf3de2f80192ba25a95c38332 | |
| parent | 19dbf0d0c12940ce1456ef9a251430ecbb66b9fe (diff) | |
| download | sf-abda1e9883555734f41c7a12e464b13a72c37a6d.tar.gz sf-abda1e9883555734f41c7a12e464b13a72c37a6d.zip | |
Move two util functions to the bottom
| -rw-r--r-- | fm.c | 34 |
1 files changed, 17 insertions, 17 deletions
@@ -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); +} |
