95
98
int panlines; /* number of lines in the panel area */
96
99
int textline_area; /* number of chars available for
97
100
the textline (including the prompt) */
98
int date_len; /* lenght of date/time field */
101
int date_len; /* length of date/time field */
102
105
const char *login_at_host; /* my name: user@host */
103
const char *shell; /* my login shell */
106
char *shell; /* my login shell */
104
107
const char *homedir; /* my home directory */
105
108
pid_t pid; /* process ID */
106
109
mode_t umask; /* umask value */
107
110
FLAG isroot; /* effective uid is 0(root) */
108
111
FLAG admin; /* admin mode: clex -a */
112
CODE shelltype; /* Bourne shell (0), C-shell (1), other (2) */
111
115
/* description of an editing operation */
152
166
* the draw_panel_line() in inout.c
154
168
#define PANEL_TYPE_BM 0
155
#define PANEL_TYPE_BM_MANAGER 1
156
#define PANEL_TYPE_CFG 2
157
#define PANEL_TYPE_CFG_ADMIN 3
158
#define PANEL_TYPE_COMPARE 4
159
#define PANEL_TYPE_COMPL 5
160
#define PANEL_TYPE_DIR 6
161
#define PANEL_TYPE_DIR_SPLIT 7
162
#define PANEL_TYPE_FILE 8
163
#define PANEL_TYPE_HELP 9
164
#define PANEL_TYPE_HIST 10
165
#define PANEL_TYPE_LOCATE 11
166
#define PANEL_TYPE_MAINMENU 12
167
#define PANEL_TYPE_SORT 13
169
#define PANEL_TYPE_CFG 1
170
#define PANEL_TYPE_COMPARE 2
171
#define PANEL_TYPE_COMPL 3
172
#define PANEL_TYPE_DIR 4
173
#define PANEL_TYPE_DIR_SPLIT 5
174
#define PANEL_TYPE_FILE 6
175
#define PANEL_TYPE_GROUP 7
176
#define PANEL_TYPE_HELP 8
177
#define PANEL_TYPE_HIST 9
178
#define PANEL_TYPE_MAINMENU 10
179
#define PANEL_TYPE_PASTE 11
180
#define PANEL_TYPE_SORT 12
181
#define PANEL_TYPE_USER 13
168
182
#define PANEL_TYPE_NONE 99 /* not set (only during startup) */
185
* extra lines appear in a panel before the real first line,
186
* extra lines: -MIN .. -1
187
* real lines: 0 .. MAX
190
const char *text; /* text to be displayed in the panel */
191
/* default (if null): "Leave this panel" */
192
const char *info; /* text to be displayed in the info line */
193
/* when this extra line is selected: */
194
CODE mode_next; /* set next_mode to this mode and then ... */
195
void (*fn)(void); /* ... invoke this function */
170
198
/* description of a panel */
172
int cnt, top; /* panel lines: total count, top of the screen */
173
int curs, min; /* panel lines: cursor bar, top of the panel */
200
int cnt, top; /* panel lines: total count, top of the screen */
201
int curs, min; /* panel lines: cursor bar, top of the panel */
175
* panel line 'min' is used to insert extra lines
176
* before the actual first line which is always line number 0;
177
* to insert N extra lines set 'min' to -N;
178
* the number of extra lines is not included in 'cnt'
203
* 'min' is used to insert extra lines before the real first line
204
* which is always line number 0; to insert N extra lines set
205
* 'min' to -N; the number of extra lines is not included in 'cnt'
180
CODE type; /* panel type: one of PANEL_TYPE_XXX */
181
FLAG norev; /* do not show the current line in reverse video */
207
CODE type; /* panel type: one of PANEL_TYPE_XXX */
208
FLAG norev; /* do not show the current line in reversed video */
209
EXTRA_LINE *extra; /* extra panel lines */
210
INPUTLINE *filter; /* filter (if applicable to this panel type) */
211
CODE filtering; /* filter: 0 = off */
212
/* 1 = on - focus on the filter string */
213
/* 2 = on - focus on the command line */
216
#define VALID_CURSOR(P) ((P)->cnt > 0 && (P)->curs >= 0 && (P)->curs < (P)->cnt)
184
218
/********************************************************************/
215
249
/* text buffer sizes */ /* examples: */
216
250
#define FE_LINKS_STR 4 /* 1 999 max */
217
251
#define FE_TIME_STR 12 /* 12:34am 1.01.04 01-jan-2004 */
218
#define FE_SIZE_DEV_STR 12 /* 122.351k 3.222.891K */
252
#define FE_SIZE_DEV_STR 12 /* 3.222.891Ki */
219
253
#define FE_MODE_STR 5 /* 0644 */
220
#define FE_OWNER_STR 18 /* root:mail */
254
#define FE_NAME_STR 10 /* root */
255
#define FE_OWNER_STR (2 * FE_NAME_STR) /* root:mail */
223
258
* file description - exhausting, isn't it ?
231
266
off_t size; /* file size */
232
267
dev_t devnum; /* major/minor numbers (devices only) */
233
268
CODE file_type; /* one of FT_XXX */
234
uid_t uid, gid; /* owner & group */
269
uid_t uid, gid; /* owner and group */
235
270
short int mode12; /* file mode - low 12 bits */
236
271
unsigned int select:1; /* flag: this entry is selected */
237
272
unsigned int symlink:1; /* flag: it is a symbolic link */
238
273
unsigned int dotdir:2; /* . (1) or .. (2) directory */
274
unsigned int fmatch:1; /* flag: matches the filter */
240
276
* note: the structure members below are used
241
277
* only when the file panel layout requires them
257
293
struct ppanel_file *other; /* primary <--> secondary panel ptr */
258
294
int selected; /* number of selected entries */
259
295
FLAG expired; /* expiration: panel needs re-read */
296
FLAG filtype; /* filter type: 0 = substring, 1 = pattern */
297
int filt_cnt; /* saved number of entries while filtering is on */
298
int filt_sel; /* selected entries NOT matched by the filter */
260
299
int fe_alloc; /* allocated FILE_ENTRies in 'files' below */
261
300
FILE_ENTRY **files; /* main part: list of files in panel's
262
301
working directory 'dir' */
304
* filter off: 0 .. cnt-1 = all file entries
305
* filter on: 0 .. cnt-1 = entries matching the filter expression
306
* cnt .. filtcnt-1 = saved entries not matching the filter
265
309
/********************************************************************/
299
335
/********************************************************************/
302
const char *name; /* directory name (see also shlen) */
303
int shlen; /* PANEL_DIR: length of the repeating name part
304
used for fancy formatting
305
PANEL_DIR_SPLIT: length of the string 'name'
306
which is NOT null terminated */
338
const char *name; /* directory name (see also shlen) */
339
int shlen; /* PANEL_DIR: length of the repeating name part
340
(used for fancy formatting)
341
PANEL_DIR_SPLIT: length of the string 'name'
342
which is NOT null terminated */
426
462
/********************************************************************/
473
int usr_alloc; /* allocated entries in 'users' */
484
int grp_alloc; /* allocated entries in 'groups' */
487
/********************************************************************/
428
489
/* global variables */
430
491
extern const void *pcfg[CFG_VARIABLES];
432
493
extern DISPLAY display;
433
494
extern CLEX_DATA clex_data;
434
extern TEXTLINE *textline; /* --> active line */
495
extern TEXTLINE *textline; /* -> active line */
435
496
extern TEXTLINE line_cmd, line_dir, line_tmp;
436
extern PANEL_DESC *panel; /* --> description of the active panel */
497
extern PANEL_DESC *panel; /* -> description of the active panel */
437
498
extern PANEL_FILE *ppanel_file;
438
499
extern PANEL_CFG panel_cfg;
439
extern PANEL_BM panel_bm;
500
extern PANEL_BM panel_bm_lst, panel_bm_mng;
440
501
extern PANEL_COMPL panel_compl;
441
502
extern PANEL_DIR panel_dir;
442
503
extern PANEL_DIR_SPLIT panel_dir_split;
504
extern PANEL_GROUP panel_group;
443
505
extern PANEL_HELP panel_help;
444
506
extern PANEL_HIST panel_hist;
445
extern PANEL_LOCATE panel_locate;
446
extern PANEL_MENU panel_mainmenu, panel_compare;
507
extern PANEL_MENU panel_mainmenu, panel_compare, panel_paste;
447
508
extern PANEL_SORT panel_sort;
509
extern PANEL_USER panel_user;
448
510
extern CODE next_mode; /* see control.c comments */