summaryrefslogtreecommitdiffstats
path: root/src/filemanager/cmd.h
blob: 26bfdb7d311af3f6a773b2b37273cf30f5b06da7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
/** \file cmd.h
 *  \brief Header: routines invoked by a function key
 *
 *  They normally operate on the current panel.
 */

#ifndef MC__CMD_H
#define MC__CMD_H

#include "lib/global.h"

#include "file.h"               /* panel_operate() */
#include "panel.h"

/*** typedefs(not structures) and defined constants **********************************************/

/*** enums ***************************************************************************************/

typedef enum
{
    LINK_HARDLINK = 0,
    LINK_SYMLINK_ABSOLUTE,
    LINK_SYMLINK_RELATIVE
} link_type_t;

/*** structures declarations (and typedefs of structures)*****************************************/

/*** global variables defined in .c file *********************************************************/

/*** declarations of public functions ************************************************************/

#ifdef ENABLE_VFS_FTP
void ftplink_cmd (void);
#endif
#ifdef ENABLE_VFS_SFTP
void sftplink_cmd (void);
#endif
#ifdef ENABLE_VFS_FISH
void fishlink_cmd (void);
#endif
void undelete_cmd (void);
void help_cmd (void);
void smart_dirsize_cmd (WPanel * panel);
void single_dirsize_cmd (WPanel * panel);
void dirsizes_cmd (WPanel * panel);
gboolean view_file_at_line (const vfs_path_t * filename_vpath, gboolean plain_view,
                            gboolean internal, long start_line, off_t search_start,
                            off_t search_end);
gboolean view_file (const vfs_path_t * filename_vpath, gboolean plain_view, gboolean internal);
void view_cmd (WPanel * panel);
void view_file_cmd (const WPanel * panel);
void view_raw_cmd (WPanel * panel);
void view_filtered_cmd (const WPanel * panel);
void edit_file_at_line (const vfs_path_t * what_vpath, gboolean internal, long start_line);
void edit_cmd (const WPanel * panel);
void edit_cmd_new (void);
#ifdef USE_INTERNAL_EDIT
void edit_cmd_force_internal (const WPanel * panel);
#endif
void mkdir_cmd (WPanel * panel);
void reread_cmd (void);
void vfs_list (WPanel * panel);
void ext_cmd (void);
void edit_mc_menu_cmd (void);
void edit_fhl_cmd (void);
void hotlist_cmd (WPanel * panel);
void compare_dirs_cmd (void);
#ifdef USE_DIFF_VIEW
void diff_view_cmd (void);
#endif
void panel_tree_cmd (void);
void link_cmd (link_type_t link_type);
void edit_symlink_cmd (void);
void swap_cmd (void);
void quick_cd_cmd (WPanel * panel);
void save_setup_cmd (void);
void user_file_menu_cmd (void);
void info_cmd (void);
void listing_cmd (void);
void setup_listing_format_cmd (void);
void quick_cmd_no_menu (void);
void info_cmd_no_menu (void);
void quick_view_cmd (void);
#ifdef HAVE_CHARSET
void encoding_cmd (void);
#endif
/* achown.c */
void advanced_chown_cmd (WPanel * panel);
/* chmod.c */
void chmod_cmd (WPanel * panel);
/* chown.c */
void chown_cmd (WPanel * panel);
#ifdef ENABLE_EXT2FS_ATTR
/* chattr.c */
void chattr_cmd (WPanel * panel);
const char *chattr_get_as_str (unsigned long attr);
#endif
/* find.c */
void find_cmd (WPanel * panel);

/* --------------------------------------------------------------------------------------------- */
/*** inline functions ****************************************************************************/
/* --------------------------------------------------------------------------------------------- */

/**
 * Copy, default to the other panel.
 */

static inline void
copy_cmd (WPanel * panel)
{
    panel_operate (panel, OP_COPY, FALSE);
}

/* --------------------------------------------------------------------------------------------- */
/**
 * Copy, default to the same panel, ignore marks.
 */

static inline void
copy_cmd_local (WPanel * panel)
{
    panel_operate (panel, OP_COPY, TRUE);
}

/* --------------------------------------------------------------------------------------------- */
/**
 * Move/rename, default to the other panel.
 */

static inline void
rename_cmd (WPanel * panel)
{
    panel_operate (panel, OP_MOVE, FALSE);
}

/* --------------------------------------------------------------------------------------------- */
/**
 * Move/rename, default to the same panel, ignore marks.
 */

static inline void
rename_cmd_local (WPanel * panel)
{
    panel_operate (panel, OP_MOVE, TRUE);
}

/* --------------------------------------------------------------------------------------------- */
/**
 *  Remove.
 */

static inline void
delete_cmd (WPanel * panel)
{
    panel_operate (panel, OP_DELETE, FALSE);
}

/* --------------------------------------------------------------------------------------------- */
/**
 *  Remove, ignore marks.
 */

static inline void
delete_cmd_local (WPanel * panel)
{
    panel_operate (panel, OP_DELETE, TRUE);
}

/* --------------------------------------------------------------------------------------------- */

#endif /* MC__CMD_H */