diff --git a/lib/Makefile.am b/lib/Makefile.am index 95e4bbf05..00f489a9d 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -32,6 +32,7 @@ SRC_mc_utils = \ libmc_la_SOURCES = \ $(SUBLIB_includes) \ $(SRC_mc_utils) \ + file-entry.h \ fileloc.h \ fs.h \ hook.c hook.h \ diff --git a/lib/file-entry.h b/lib/file-entry.h new file mode 100644 index 000000000..d758e646e --- /dev/null +++ b/lib/file-entry.h @@ -0,0 +1,49 @@ +/** \file lib/file-entry.h + * \brief Header: file entry definition + */ + +#ifndef MC__ILE_ENTRY_H +#define MC__ILE_ENTRY_H + +#include +#include + +#include "lib/global.h" /* include */ + +/*** typedefs(not structures) and defined constants **********************************************/ + +/*** enums ***************************************************************************************/ + +/*** structures declarations (and typedefs of structures)*****************************************/ + +/* keys are set only during sorting */ +typedef struct +{ + /* File name */ + GString *fname; + /* File attributes */ + struct stat st; + /* Key used for comparing names */ + char *sort_key; + /* Key used for comparing extensions */ + char *second_sort_key; + + /* Flags */ + struct + { + unsigned int marked:1; /* File marked in pane window */ + unsigned int link_to_dir:1; /* If this is a link, does it point to directory? */ + unsigned int stale_link:1; /* If this is a symlink and points to Charon's land */ + unsigned int dir_size_computed:1; /* Size of directory was computed with dirsizes_cmd */ + } f; +} file_entry_t; + +/*** global variables defined in .c file *********************************************************/ + +/*** declarations of public functions ************************************************************/ + +/* --------------------------------------------------------------------------------------------- */ +/*** inline functions ****************************************************************************/ +/* --------------------------------------------------------------------------------------------- */ + +#endif /* MC__FILE_ENTRY_H */ diff --git a/lib/filehighlight.h b/lib/filehighlight.h index 2a5c72a73..fd2c976a7 100644 --- a/lib/filehighlight.h +++ b/lib/filehighlight.h @@ -2,7 +2,7 @@ #define MC__FILEHIGHLIGHT_H #include "lib/mcconfig.h" /* mc_config_t */ -#include "lib/util.h" /* file_entry_t */ +#include "lib/file-entry.h" /*** typedefs(not structures) and defined constants **********************************************/ diff --git a/lib/filehighlight/common.c b/lib/filehighlight/common.c index 01ee3b74a..4782e0acb 100644 --- a/lib/filehighlight/common.c +++ b/lib/filehighlight/common.c @@ -27,7 +27,10 @@ #include #include "lib/global.h" +#include "lib/util.h" /* MC_PTR_FREE */ + #include "lib/filehighlight.h" + #include "internal.h" /*** global variables ****************************************************************************/ diff --git a/lib/util.h b/lib/util.h index 6696d02d1..ec8b25ec5 100644 --- a/lib/util.h +++ b/lib/util.h @@ -122,27 +122,6 @@ typedef struct /*** structures declarations (and typedefs of structures)*****************************************/ -/* keys are set only during sorting */ -typedef struct -{ - /* File attributes */ - GString *fname; - struct stat st; - /* key used for comparing names */ - char *sort_key; - /* key used for comparing extensions */ - char *second_sort_key; - - /* Flags */ - struct - { - unsigned int marked:1; /* File marked in pane window */ - unsigned int link_to_dir:1; /* If this is a link, does it point to directory? */ - unsigned int stale_link:1; /* If this is a symlink and points to Charon's land */ - unsigned int dir_size_computed:1; /* Size of directory was computed with dirsizes_cmd */ - } f; -} file_entry_t; - /*** global variables defined in .c file *********************************************************/ extern struct sigaction startup_handler; diff --git a/src/editor/format.c b/src/editor/format.c index 0084b1ee2..76f2c4c5f 100644 --- a/src/editor/format.c +++ b/src/editor/format.c @@ -48,6 +48,7 @@ #include #include "lib/global.h" +#include "lib/util.h" /* whitespace() */ #include "src/setup.h" /* option_tab_spacing */ diff --git a/src/filemanager/chattr.c b/src/filemanager/chattr.c index fdd8a0efe..5dfeb1096 100644 --- a/src/filemanager/chattr.c +++ b/src/filemanager/chattr.c @@ -45,6 +45,7 @@ #include "lib/skin.h" /* COLOR_NORMAL, DISABLED_COLOR */ #include "lib/vfs/vfs.h" #include "lib/widget.h" +#include "lib/util.h" /* x_basename() */ #include "src/keymap.h" /* chattr_map */ diff --git a/src/filemanager/cmd.c b/src/filemanager/cmd.c index 74748288c..6874a8261 100644 --- a/src/filemanager/cmd.c +++ b/src/filemanager/cmd.c @@ -58,6 +58,7 @@ #include "lib/vfs/vfs.h" #include "lib/fileloc.h" #include "lib/strutil.h" +#include "lib/file-entry.h" #include "lib/util.h" #include "lib/widget.h" #include "lib/keybind.h" /* CK_Down, CK_History */ diff --git a/src/filemanager/dir.h b/src/filemanager/dir.h index f6a65ee42..7421cd875 100644 --- a/src/filemanager/dir.h +++ b/src/filemanager/dir.h @@ -9,7 +9,7 @@ #include "lib/global.h" #include "lib/search.h" -#include "lib/util.h" +#include "lib/file-entry.h" #include "lib/vfs/vfs.h" /*** typedefs(not structures) and defined constants **********************************************/ diff --git a/src/filemanager/panel.h b/src/filemanager/panel.h index 96392cb67..dfd94e1b3 100644 --- a/src/filemanager/panel.h +++ b/src/filemanager/panel.h @@ -13,6 +13,7 @@ #include "lib/strutil.h" #include "lib/widget.h" /* Widget */ #include "lib/filehighlight.h" +#include "lib/file-entry.h" #include "dir.h" /* dir_list */ diff --git a/src/filemanager/panelize.c b/src/filemanager/panelize.c index 3c254229e..21324888d 100644 --- a/src/filemanager/panelize.c +++ b/src/filemanager/panelize.c @@ -39,6 +39,7 @@ #include "lib/mcconfig.h" /* Load/save directories panelize */ #include "lib/strutil.h" #include "lib/widget.h" +#include "lib/util.h" /* mc_pipe_t */ #include "src/history.h" diff --git a/src/vfs/ftpfs/ftpfs.c b/src/vfs/ftpfs/ftpfs.c index 389e35ceb..c9dcb6968 100644 --- a/src/vfs/ftpfs/ftpfs.c +++ b/src/vfs/ftpfs/ftpfs.c @@ -95,6 +95,7 @@ What to do with this? #include /* uintmax_t */ #include "lib/global.h" +#include "lib/file-entry.h" #include "lib/util.h" #include "lib/strutil.h" /* str_move() */ #include "lib/mcconfig.h" diff --git a/src/viewer/actions_cmd.c b/src/viewer/actions_cmd.c index 31dc348af..836184f00 100644 --- a/src/viewer/actions_cmd.c +++ b/src/viewer/actions_cmd.c @@ -52,7 +52,7 @@ #include "lib/tty/tty.h" #include "lib/tty/key.h" /* is_idle() */ #include "lib/lock.h" /* lock_file() */ -#include "lib/util.h" +#include "lib/file-entry.h" #include "lib/widget.h" #ifdef HAVE_CHARSET #include "lib/charsets.h" diff --git a/src/viewer/internal.h b/src/viewer/internal.h index d6075d83f..566b07cfb 100644 --- a/src/viewer/internal.h +++ b/src/viewer/internal.h @@ -11,6 +11,7 @@ #include "lib/search.h" #include "lib/widget.h" #include "lib/vfs/vfs.h" /* vfs_path_t */ +#include "lib/util.h" /* mc_pipe_t */ #include "src/keymap.h" /* global_keymap_t */ #include "src/filemanager/dir.h" /* dir_list */ diff --git a/tests/src/filemanager/exec_get_export_variables_ext.c b/tests/src/filemanager/exec_get_export_variables_ext.c index 54d60f2ac..38ac858e1 100644 --- a/tests/src/filemanager/exec_get_export_variables_ext.c +++ b/tests/src/filemanager/exec_get_export_variables_ext.c @@ -27,6 +27,8 @@ #include "tests/mctest.h" +#include "lib/file-entry.h" + #include "src/vfs/local/local.c" #include "src/filemanager/filemanager.c"