📄 global.h
字号:
/* global.h 20.03.05 */
/*
/ --------------------------------------------------------------
/ Copyright (C) 2004: Michael Braun
/ Kaetinger Muehlenweg 103 A
/ D-28816 Stuhr
/ --------------------------------------------------------------
/
/ global header file for mbedit.c (publics / externals)
/
*/
/************************/
/* often used macros */
/************************/
/************************/
/* some defines */
/************************/
#define VERSION_DATE "20.03.05" /* <= modify here !! */
#define VERSION_TEXT_3 "8.62" /* <= modify here !! */
#define VERSION_TEXT_1 "mbedit "
#if (DEMO_VERSION == 0)
#define VERSION_TEXT_2 "V" /* Version */
#endif
#if (DEMO_VERSION == 1)
#define VERSION_TEXT_2 "S" /* Shareware */
#endif
#if (DEMO_VERSION == 2)
#define VERSION_TEXT_2 "D" /* Demo */
#endif
#define LINE_OFFSET 1 /* mbedit counts rows, lines internally from 0, */
/* display starts from 1 */
#define CURSOR_STABIL 1 /* page up/down doesn't move the cursor position */
/* on the screen (except at begin and end of file) */
/* relation between cursor position in the memory */
/* and on the screen */
#define REL_COLUMN (fc->column - fc->left_col)
/************************/
/* structures */
/************************/
struct FILE_CONTROL {
/* bei init nicht anfassen ... */
char filename [BUF_256]; /* name of datafile in work */
char FA_HU * buff_0; /* pointer to start of edit-buffer */
long buffer_size; /* actual length of buffer */
int malloc_flag; /* 1 = buffer is available */
int left_col; /* left visible column on screen (default: 0) */
#if WINDOW_COMMAND
int wind_arow [3]; /* row index in both windows */
long wind_index[3]; /* index of file in both windows */
#endif
int syntax_flag; /* 0=OFF, 1=comments, 2=keywords, 3=both */
int eoln; /* end of line (0x0a, 0x0d or 0x0d0a) */
/* bei init definiert setzen */
char FA_HU * buffer; /* pointer to actual byte in edit-buffer */
long tag_index [4]; /* -1 = undefined */
int buff_no; /* 0/1 (= act_buff_no [act_window]) */
long find [2]; /* first and (last+1) char of find string */
int file_type; /* index to buffer for syntax highlighting */
int highbit; /* 0=No, 1=Yes */
char *e_delimit; /* pointer to hi_light->e_delimit */
/* bei init loeschen ... */
long byte_anz; /* total no of bytes */
long byte_index; /* index of actual byte */
long top_left; /* index of upper left corner on screen */
long lin_left; /* index of left byte on actual line */
long line_anz; /* total no of lines in buffer */
long line_index; /* no of actual line */
int view_only; /* 1 = file must not be modified */
int change_flag; /* 1 = file has been modified */
int arow; /* actual row (0 ... 22) of cursor */
/* relative to begin of window */
int column; /* actual column (0 ... 79) of cursor */
};
#if (WITH_LAST_AGAIN)
struct MINI_CONTROL {
char filename [BUF_256]; /* name of datafile in work */
long byte_index; /* index of actual byte */
int view_only; /* 1 = file must not be modified */
};
#endif
#define lrow arow+MIN_ROW /* relative to begin of screen */
/************************/
/* public variables */
/************************/
#undef pubext
#ifdef _GLOBAL_
#define pubext
#else
#define pubext extern
#endif
pubext char copyright_text []
#ifdef _GLOBAL_
= {"Copyright (C) 1992 - 2005 / Michael Braun"}
#endif
;
pubext char url_string []
#ifdef _GLOBAL_
= {"http://www.braun-home.net/michael"}
#endif
;
/* structure for file control */
#if (ACT_OP_SYSTEM == MS_DOS)
#define MAX_FC_NUM 10 /* max. anzahl von edit-files */
#else
#define MAX_FC_NUM 26
#endif
pubext int act_window; /* 0 : normal mode */
/* 1 : window mode oben */
/* 2 : window mode unten */
pubext int act_buff_no [3]; /* index: act_window */
pubext int same_buffer; /* 1 = window 1 + 2 contain same buffer */
pubext int w_top [3] /* window top */
#ifdef _GLOBAL_
= { 0, 0, 0 }
#endif
;
pubext int w_bot [3] /* window bottom */
#ifdef _GLOBAL_
= { INIT_ROWS-1, INIT_ROWS-1, INIT_ROWS-1 }
#endif
;
pubext struct FILE_CONTROL file_control [MAX_FC_NUM];
pubext struct FILE_CONTROL *fc; /* actual file control */
#if (WITH_LAST_AGAIN)
pubext int mini_file_num;
pubext struct MINI_CONTROL mini_control [MAX_FC_NUM];
#endif
/* operation mode */
pubext int mode_flag; /* 0 : command */
/* 1 : insert */
/* 2 : exchange */
/* 3 : Hex View */
/* 4 : Hex Edit */
#define MODE_TEXT_0 "mode: \"command\" - <F1>: Help Info"
#define MODE_TEXT_1 "mode: \"insert\" - leave with <esc>"
#define MODE_TEXT_2 "mode: \"exchange\" - leave with <esc>"
#define MODE_TEXT_3 "Hex View: cursor keys, <esc>, Other, Edit"
#define MODE_TEXT_4 "Hex Edit: cursor keys, <esc>, <tab>, value"
pubext char *mode_text []
#ifdef _GLOBAL_
/* mode_flag */
= { MODE_TEXT_0 /* 0 */
,MODE_TEXT_1 /* 1 */
,MODE_TEXT_2 /* 2 */
#if (WITH_HEX_VIEW)
,MODE_TEXT_3 /* 3 */
,MODE_TEXT_4 /* 4 */
#endif
}
#endif
;
#if (ACT_SERVER == SERVER_VT_100)
pubext int text_area; /* == 0: text area */
/* >= 1: status line or history window */
#endif
/* buffer for ^A, ^X, ^Z, ^U */
struct SAVE_U {int anz;
int index;
int command;
char buffer [BUF_256];
};
pubext struct SAVE_U save_u;
/* buffer for exchange/backspace */
struct SAVE_X {int index;
char buffer [BUF_256];
};
pubext struct SAVE_X save_x;
/* buffer for buffer/delete */
struct SAVE_D {int toggle;
long index0;
long index1;
};
pubext struct SAVE_D save_d;
/* settings */
struct SETTINGS {int autonl;
int bak_file;
int c_case;
int display;
int go;
int highbit_global; /* 0=No, 1=Yes, 2=Auto */
int indent;
int file_num;
int k_token;
int margin [3];
int notab;
int radix;
int showfind;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -