mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 20:36:50 +03:00
* edit.h: Make it easier to tweak buffer size and maximal number
of buffers.
This commit is contained in:
parent
d6d16e47ef
commit
d4336795e6
@ -1,3 +1,8 @@
|
||||
2003-03-12 Pavel Roskin <proski@gnu.org>
|
||||
|
||||
* edit.h: Make it easier to tweak buffer size and maximal number
|
||||
of buffers.
|
||||
|
||||
2003-03-07 Pavel Roskin <proski@gnu.org>
|
||||
|
||||
* editkeys.c (common_key_map): Delete previous word by
|
||||
|
@ -3,7 +3,6 @@
|
||||
|
||||
#include "src/dlg.h" /* Widget */
|
||||
|
||||
#define MAXBUFF 1024
|
||||
#define MAX_MACRO_LENGTH 1024
|
||||
#define N_LINE_CACHES 32
|
||||
|
||||
|
35
edit/edit.h
35
edit/edit.h
@ -69,26 +69,37 @@
|
||||
#define EDIT_TOP_EXTREME option_edit_top_extreme
|
||||
#define EDIT_BOTTOM_EXTREME option_edit_bottom_extreme
|
||||
|
||||
/*there are a maximum of ... */
|
||||
/*... edit buffers, each of which is ... */
|
||||
#define EDIT_BUF_SIZE 0x10000
|
||||
/* ...bytes in size. */
|
||||
/*
|
||||
* The editor keeps data in two arrays of buffers.
|
||||
* All buffers have the same size, which must be a power of 2.
|
||||
*/
|
||||
|
||||
/*x / EDIT_BUF_SIZE equals x >> ... */
|
||||
/* Configurable: log2 of the buffer size in bytes */
|
||||
#ifndef S_EDIT_BUF_SIZE
|
||||
#define S_EDIT_BUF_SIZE 16
|
||||
#endif
|
||||
|
||||
/* x % EDIT_BUF_SIZE is equal to x && ... */
|
||||
#define M_EDIT_BUF_SIZE 0xFFFF
|
||||
/* Size of the buffer */
|
||||
#define EDIT_BUF_SIZE (((off_t) 1) << S_EDIT_BUF_SIZE)
|
||||
|
||||
/* Buffer mask (used to find cursor position relative to the buffer) */
|
||||
#define M_EDIT_BUF_SIZE (EDIT_BUF_SIZE - 1)
|
||||
|
||||
/*
|
||||
* Configurable: Maximal allowed number of buffers in each buffer array.
|
||||
* This number can be increased for systems with enough physical memory.
|
||||
*/
|
||||
#ifndef MAXBUFF
|
||||
#define MAXBUFF 1024
|
||||
#endif
|
||||
|
||||
/* Maximal length of file that can be opened */
|
||||
#define SIZE_LIMIT (EDIT_BUF_SIZE * (MAXBUFF - 2))
|
||||
/* Note a 16k stack is 64k of data and enough to hold (usually) around 10
|
||||
pages of undo info. */
|
||||
|
||||
/* undo stack */
|
||||
/* Initial size of the undo stack, in bytes */
|
||||
#define START_STACK_SIZE 32
|
||||
|
||||
|
||||
/*some codes that may be pushed onto or returned from the undo stack: */
|
||||
/* Some codes that may be pushed onto or returned from the undo stack */
|
||||
#define CURS_LEFT 601
|
||||
#define CURS_RIGHT 602
|
||||
#define DELCHAR 603
|
||||
|
Loading…
Reference in New Issue
Block a user