Lib: removed includes to "src" directory
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
Этот коммит содержится в:
родитель
6621250292
Коммит
f40887c3c6
@ -13,7 +13,7 @@ SUBLIB_includes = \
|
||||
widget.h
|
||||
|
||||
SRC_mc_utils = \
|
||||
utilunix.c \
|
||||
utilunix.c utilunix.h \
|
||||
unixcompat.h \
|
||||
util.c util.h
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include "lib/mcconfig.h"
|
||||
#include "lib/search.h"
|
||||
|
||||
#include "src/filemanager/dir.h"
|
||||
#include "lib/util.h"
|
||||
|
||||
/*** typedefs(not structures) and defined constants **********************************************/
|
||||
|
||||
|
@ -71,6 +71,8 @@ mc_global_t mc_global = {
|
||||
.sysconfig_dir = NULL,
|
||||
.share_data_dir = NULL,
|
||||
|
||||
.is_right = FALSE,
|
||||
|
||||
.args =
|
||||
{
|
||||
.disable_colors = FALSE,
|
||||
|
@ -199,6 +199,10 @@ typedef struct
|
||||
/* share_data_dir: Area for default settings from developers */
|
||||
char *share_data_dir;
|
||||
|
||||
/* Ugly hack in order to distinguish between left and right panel in menubar */
|
||||
/* Set if the command is being run from the "Right" menu */
|
||||
gboolean is_right; /* If the selected menu was the right */
|
||||
|
||||
struct
|
||||
{
|
||||
/* Use the specified skin */
|
||||
|
22
lib/util.h
22
lib/util.h
@ -47,6 +47,28 @@ enum compression_type
|
||||
|
||||
/*** structures declarations (and typedefs of structures)*****************************************/
|
||||
|
||||
/* keys are set only during sorting */
|
||||
typedef struct
|
||||
{
|
||||
/* File attributes */
|
||||
size_t fnamelen;
|
||||
char *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;
|
||||
|
||||
/*** global variables defined in .c file *********************************************************/
|
||||
|
||||
extern struct sigaction startup_handler;
|
||||
|
@ -57,11 +57,12 @@
|
||||
#include "lib/util.h"
|
||||
#include "lib/widget.h" /* message() */
|
||||
|
||||
#include "src/execute.h"
|
||||
#ifdef HAVE_CHARSET
|
||||
#include "charsets.h"
|
||||
#include "lib/charsets.h"
|
||||
#endif
|
||||
|
||||
#include "utilunix.h"
|
||||
|
||||
/*** global variables ****************************************************************************/
|
||||
|
||||
struct sigaction startup_handler;
|
||||
|
25
lib/utilunix.h
Обычный файл
25
lib/utilunix.h
Обычный файл
@ -0,0 +1,25 @@
|
||||
/** \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 */
|
@ -39,10 +39,6 @@
|
||||
#include "lib/widget.h"
|
||||
#include "lib/event.h" /* mc_event_raise() */
|
||||
|
||||
/* TODO: these includes should be removed! */
|
||||
#include "src/help.h" /* interactive_display() */
|
||||
#include "src/filemanager/layout.h"
|
||||
|
||||
/*** global variables ****************************************************************************/
|
||||
|
||||
/* Color styles for normal and error dialogs */
|
||||
|
@ -52,9 +52,6 @@
|
||||
|
||||
#include "input_complete.h"
|
||||
|
||||
#include "src/main.h" /* home_dir */
|
||||
#include "src/filemanager/midnight.h" /* current_panel */
|
||||
|
||||
/*** global variables ****************************************************************************/
|
||||
|
||||
int quote = 0;
|
||||
|
@ -36,11 +36,6 @@
|
||||
#include "lib/widget.h"
|
||||
#include "lib/event.h" /* mc_event_raise() */
|
||||
|
||||
/* TODO: these includes should be removed! */
|
||||
#include "src/keybind-defaults.h" /* CK_IgnoreKey */
|
||||
#include "src/help.h"
|
||||
#include "src/filemanager/midnight.h" /* is_right */
|
||||
|
||||
/*** global variables ****************************************************************************/
|
||||
|
||||
/*** file scope macro definitions ****************************************************************/
|
||||
@ -297,7 +292,7 @@ menubar_execute (WMenuBar * menubar)
|
||||
|
||||
if ((entry != NULL) && (entry->command != CK_IgnoreKey))
|
||||
{
|
||||
is_right = (menubar->selected != 0);
|
||||
mc_global.is_right = (menubar->selected != 0);
|
||||
menubar_finish (menubar);
|
||||
menubar->widget.owner->callback (menubar->widget.owner, &menubar->widget,
|
||||
DLG_ACTION, entry->command, NULL);
|
||||
|
@ -5,12 +5,9 @@
|
||||
#ifndef MC__EXECUTE_H
|
||||
#define MC__EXECUTE_H
|
||||
|
||||
/*** typedefs(not structures) and defined constants **********************************************/
|
||||
#include "lib/utilunix.h"
|
||||
|
||||
/* flags for shell_execute */
|
||||
#define EXECUTE_INTERNAL (1 << 0)
|
||||
#define EXECUTE_AS_SHELL (1 << 2)
|
||||
#define EXECUTE_HIDE (1 << 3)
|
||||
/*** typedefs(not structures) and defined constants **********************************************/
|
||||
|
||||
/*** enums ***************************************************************************************/
|
||||
|
||||
@ -50,4 +47,5 @@ void post_exec (void);
|
||||
void pre_exec (void);
|
||||
|
||||
/*** inline functions ****************************************************************************/
|
||||
|
||||
#endif /* MC__EXECUTE_H */
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include "lib/global.h"
|
||||
#include "lib/util.h"
|
||||
|
||||
/*** typedefs(not structures) and defined constants **********************************************/
|
||||
|
||||
@ -20,28 +21,6 @@ typedef int sortfn (const void *, const void *);
|
||||
|
||||
/*** structures declarations (and typedefs of structures)*****************************************/
|
||||
|
||||
/* keys are set only during sorting */
|
||||
typedef struct
|
||||
{
|
||||
/* File attributes */
|
||||
size_t fnamelen;
|
||||
char *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;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
file_entry *list;
|
||||
|
@ -100,9 +100,6 @@ WPanel *right_panel = NULL;
|
||||
/* Pointer to the selected and unselected panel */
|
||||
WPanel *current_panel = NULL;
|
||||
|
||||
/* Set if the command is being run from the "Right" menu */
|
||||
int is_right = 0;
|
||||
|
||||
/* The Menubar */
|
||||
WMenuBar *the_menubar = NULL;
|
||||
/* The widget where we draw the prompt */
|
||||
|
@ -14,9 +14,9 @@
|
||||
|
||||
/*** typedefs(not structures) and defined constants **********************************************/
|
||||
|
||||
#define MENU_PANEL (is_right ? right_panel : left_panel)
|
||||
#define MENU_PANEL_IDX (is_right ? 1 : 0)
|
||||
#define SELECTED_IS_PANEL (get_display_type (is_right ? 1 : 0) == view_listing)
|
||||
#define MENU_PANEL (mc_global.is_right ? right_panel : left_panel)
|
||||
#define MENU_PANEL_IDX (mc_global.is_right ? 1 : 0)
|
||||
#define SELECTED_IS_PANEL (get_display_type (mc_global.is_right ? 1 : 0) == view_listing)
|
||||
|
||||
#define other_panel get_other_panel()
|
||||
|
||||
@ -34,9 +34,6 @@ extern WLabel *the_prompt;
|
||||
extern WLabel *the_hint;
|
||||
extern WButtonBar *the_bar;
|
||||
|
||||
/* Ugly hack in order to distinguish between left and right panel in menubar */
|
||||
extern gboolean is_right; /* If the selected menu was the right */
|
||||
|
||||
extern WPanel *left_panel;
|
||||
extern WPanel *right_panel;
|
||||
extern WPanel *current_panel;
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user