1
1

* edit.h: Make it easier to tweak buffer size and maximal number

of buffers.
Этот коммит содержится в:
Pavel Roskin 2003-03-12 07:07:27 +00:00
родитель d6d16e47ef
Коммит d4336795e6
3 изменённых файлов: 28 добавлений и 13 удалений

Просмотреть файл

@ -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> 2003-03-07 Pavel Roskin <proski@gnu.org>
* editkeys.c (common_key_map): Delete previous word by * editkeys.c (common_key_map): Delete previous word by

Просмотреть файл

@ -3,7 +3,6 @@
#include "src/dlg.h" /* Widget */ #include "src/dlg.h" /* Widget */
#define MAXBUFF 1024
#define MAX_MACRO_LENGTH 1024 #define MAX_MACRO_LENGTH 1024
#define N_LINE_CACHES 32 #define N_LINE_CACHES 32

Просмотреть файл

@ -69,26 +69,37 @@
#define EDIT_TOP_EXTREME option_edit_top_extreme #define EDIT_TOP_EXTREME option_edit_top_extreme
#define EDIT_BOTTOM_EXTREME option_edit_bottom_extreme #define EDIT_BOTTOM_EXTREME option_edit_bottom_extreme
/*there are a maximum of ... */ /*
/*... edit buffers, each of which is ... */ * The editor keeps data in two arrays of buffers.
#define EDIT_BUF_SIZE 0x10000 * All buffers have the same size, which must be a power of 2.
/* ...bytes in size. */ */
/*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 #define S_EDIT_BUF_SIZE 16
#endif
/* x % EDIT_BUF_SIZE is equal to x && ... */ /* Size of the buffer */
#define M_EDIT_BUF_SIZE 0xFFFF #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)) #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 #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_LEFT 601
#define CURS_RIGHT 602 #define CURS_RIGHT 602
#define DELCHAR 603 #define DELCHAR 603