From a2f65852e35148adab4c5395a7e927e2d0938866 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Sun, 10 Mar 2024 11:11:18 +0300 Subject: [PATCH] Merge lib/utilunix.h into lib/util.h. Signed-off-by: Andrew Borodin --- lib/Makefile.am | 2 +- lib/util.h | 5 ++++ lib/utilunix.c | 2 -- lib/utilunix.h | 25 ------------------- src/execute.h | 2 +- src/vfs/sfs/sfs.c | 2 -- tests/lib/utilunix__my_system-fork_child.c | 1 - .../utilunix__my_system-fork_child_shell.c | 1 - tests/lib/utilunix__my_system-fork_fail.c | 1 - 9 files changed, 7 insertions(+), 34 deletions(-) delete mode 100644 lib/utilunix.h diff --git a/lib/Makefile.am b/lib/Makefile.am index 97845735f..e9c39a6c2 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -23,7 +23,7 @@ SUBLIB_includes = \ widget.h SRC_mc_utils = \ - utilunix.c utilunix.h \ + utilunix.c \ unixcompat.h \ util.c util.h diff --git a/lib/util.h b/lib/util.h index 1ead0fb97..a59e2c698 100644 --- a/lib/util.h +++ b/lib/util.h @@ -57,6 +57,11 @@ /* Difference or zero */ #define DOZ(a, b) ((a) > (b) ? (a) - (b) : 0) +/* flags for shell_execute */ +#define EXECUTE_INTERNAL (1 << 0) +#define EXECUTE_AS_SHELL (1 << 2) +#define EXECUTE_HIDE (1 << 3) + /*** enums ***************************************************************************************/ /* Pathname canonicalization */ diff --git a/lib/utilunix.c b/lib/utilunix.c index cec0dab41..1a43cee28 100644 --- a/lib/utilunix.c +++ b/lib/utilunix.c @@ -70,8 +70,6 @@ #include "lib/charsets.h" #endif -#include "utilunix.h" - /*** global variables ****************************************************************************/ struct sigaction startup_handler; diff --git a/lib/utilunix.h b/lib/utilunix.h deleted file mode 100644 index 922d2657a..000000000 --- a/lib/utilunix.h +++ /dev/null @@ -1,25 +0,0 @@ -/** \file execute.h - * \brief Header: execution routines - */ - -#ifndef MC__UTILUNIX_H -#define MC__UTILUNIX_H - -/*** typedefs(not structures) and defined constants **********************************************/ - -/* flags for shell_execute */ -#define EXECUTE_INTERNAL (1 << 0) -#define EXECUTE_AS_SHELL (1 << 2) -#define EXECUTE_HIDE (1 << 3) - -/*** enums ***************************************************************************************/ - -/*** structures declarations (and typedefs of structures)*****************************************/ - -/*** global variables defined in .c file *********************************************************/ - -/*** declarations of public functions ************************************************************/ - -/*** inline functions ****************************************************************************/ - -#endif /* MC__UTILUNIX_H */ diff --git a/src/execute.h b/src/execute.h index a326806df..8e1a205f4 100644 --- a/src/execute.h +++ b/src/execute.h @@ -5,7 +5,7 @@ #ifndef MC__EXECUTE_H #define MC__EXECUTE_H -#include "lib/utilunix.h" +#include "lib/util.h" #include "lib/vfs/vfs.h" /*** typedefs(not structures) and defined constants **********************************************/ diff --git a/src/vfs/sfs/sfs.c b/src/vfs/sfs/sfs.c index 58ce5a22d..7ebd2de19 100644 --- a/src/vfs/sfs/sfs.c +++ b/src/vfs/sfs/sfs.c @@ -47,8 +47,6 @@ #include "lib/util.h" #include "lib/widget.h" /* D_ERROR, D_NORMAL */ -#include "src/execute.h" /* EXECUTE_AS_SHELL */ - #include "lib/vfs/vfs.h" #include "lib/vfs/utilvfs.h" #include "lib/vfs/xdirentry.h" diff --git a/tests/lib/utilunix__my_system-fork_child.c b/tests/lib/utilunix__my_system-fork_child.c index 10d972e52..8c44bc781 100644 --- a/tests/lib/utilunix__my_system-fork_child.c +++ b/tests/lib/utilunix__my_system-fork_child.c @@ -28,7 +28,6 @@ #include "tests/mctest.h" #include "lib/util.h" -#include "lib/utilunix.h" #include "utilunix__my_system-common.c" diff --git a/tests/lib/utilunix__my_system-fork_child_shell.c b/tests/lib/utilunix__my_system-fork_child_shell.c index 6c9cb89d5..daceb80f8 100644 --- a/tests/lib/utilunix__my_system-fork_child_shell.c +++ b/tests/lib/utilunix__my_system-fork_child_shell.c @@ -28,7 +28,6 @@ #include "tests/mctest.h" #include "lib/util.h" -#include "lib/utilunix.h" #include "utilunix__my_system-common.c" diff --git a/tests/lib/utilunix__my_system-fork_fail.c b/tests/lib/utilunix__my_system-fork_fail.c index 975045d1a..94bf895cb 100644 --- a/tests/lib/utilunix__my_system-fork_fail.c +++ b/tests/lib/utilunix__my_system-fork_fail.c @@ -31,7 +31,6 @@ #include #include "lib/util.h" -#include "lib/utilunix.h" #include "utilunix__my_system-common.c"