nano.h 17 KB
Newer Older
Chris Allegretta's avatar
Chris Allegretta committed
1
2
3
/**************************************************************************
 *   nano.h                                                               *
 *                                                                        *
4
 *   Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,  *
5
 *   2008, 2009, 2010, 2011, 2013, 2014 Free Software Foundation, Inc.    *
6
7
 *   Copyright (C) 2014, 2015, 2016 Benno Schulenberg                     *
 *
Chris Allegretta's avatar
Chris Allegretta committed
8
9
 *   This program is free software; you can redistribute it and/or modify *
 *   it under the terms of the GNU General Public License as published by *
10
 *   the Free Software Foundation; either version 3, or (at your option)  *
Chris Allegretta's avatar
Chris Allegretta committed
11
12
 *   any later version.                                                   *
 *                                                                        *
13
14
15
16
 *   This program is distributed in the hope that it will be useful, but  *
 *   WITHOUT ANY WARRANTY; without even the implied warranty of           *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU    *
 *   General Public License for more details.                             *
Chris Allegretta's avatar
Chris Allegretta committed
17
18
19
 *                                                                        *
 *   You should have received a copy of the GNU General Public License    *
 *   along with this program; if not, write to the Free Software          *
20
21
 *   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA            *
 *   02110-1301, USA.                                                     *
Chris Allegretta's avatar
Chris Allegretta committed
22
23
24
 *                                                                        *
 **************************************************************************/

David Lawrence Ramsey's avatar
David Lawrence Ramsey committed
25
26
27
#ifndef NANO_H
#define NANO_H 1

28
29
30
31
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

32
33
34
#ifdef NEED_XOPEN_SOURCE_EXTENDED
#ifndef _XOPEN_SOURCE_EXTENDED
#define _XOPEN_SOURCE_EXTENDED 1
35
36
#endif
#endif
37

38
#ifdef __TANDEM
David Lawrence Ramsey's avatar
David Lawrence Ramsey committed
39
/* Tandem NonStop Kernel support. */
40
41
42
43
44
45
#include <floss.h>
#define NANO_ROOT_UID 65535
#else
#define NANO_ROOT_UID 0
#endif

Chris Allegretta's avatar
Chris Allegretta committed
46
47
48
49
#ifdef HAVE_LIMITS_H
#include <limits.h>
#endif

50
51
52
53
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif

54
55
56
57
#ifdef HAVE_STDARG_H
#include <stdarg.h>
#endif

Benno Schulenberg's avatar
Benno Schulenberg committed
58
/* Suppress warnings for __attribute__((warn_unused_result)). */
59
#define IGNORE_CALL_RESULT(call) do { if (call) {} } while(0)
60

61
62
/* Macros for flags, indexing each bit in a small array. */
#define FLAGS(flag) flags[((flag) / (sizeof(unsigned) * 8))]
63
#define FLAGMASK(flag) ((unsigned)1 << ((flag) % (sizeof(unsigned) * 8)))
64
65
66
67
#define SET(flag) FLAGS(flag) |= FLAGMASK(flag)
#define UNSET(flag) FLAGS(flag) &= ~FLAGMASK(flag)
#define ISSET(flag) ((FLAGS(flag) & FLAGMASK(flag)) != 0)
#define TOGGLE(flag) FLAGS(flag) ^= FLAGMASK(flag)
Chris Allegretta's avatar
Chris Allegretta committed
68

69
/* Macros for character allocation and more. */
Chris Allegretta's avatar
Chris Allegretta committed
70
#define charalloc(howmuch) (char *)nmalloc((howmuch) * sizeof(char))
71
#define charealloc(ptr, howmuch) (char *)nrealloc(ptr, (howmuch) * sizeof(char))
72
#define charmove(dest, src, n) memmove(dest, src, (n) * sizeof(char))
73
#define charset(dest, src, n) memset(dest, src, (n) * sizeof(char))
74

David Lawrence Ramsey's avatar
David Lawrence Ramsey committed
75
/* Set a default value for PATH_MAX if there isn't one. */
76
#ifndef PATH_MAX
77
#define PATH_MAX 4096
78
#endif
Chris Allegretta's avatar
Chris Allegretta committed
79

80
81
82
83
84
85
86
#ifdef USE_SLANG
/* Slang support. */
#include <slcurses.h>
/* Slang curses emulation brain damage, part 3: Slang doesn't define the
 * curses equivalents of the Insert or Delete keys. */
#define KEY_DC SL_KEY_DELETE
#define KEY_IC SL_KEY_IC
87
/* Ncurses support. */
88
89
#elif defined(HAVE_NCURSESW_NCURSES_H)
#include <ncursesw/ncurses.h>
90
#elif defined(HAVE_NCURSES_H)
Chris Allegretta's avatar
Chris Allegretta committed
91
#include <ncurses.h>
92
93
#else
/* Curses support. */
94
#include <curses.h>
Chris Allegretta's avatar
Chris Allegretta committed
95
96
#endif /* CURSES_H */

97
98
99
100
#if defined(NCURSES_VERSION_MAJOR) && (NCURSES_VERSION_MAJOR < 6)
#define USING_OLD_NCURSES yes
#endif

101
#ifdef ENABLE_NLS
102
/* Native language support. */
103
104
105
106
107
#ifdef HAVE_LIBINTL_H
#include <libintl.h>
#endif
#define _(string) gettext(string)
#define P_(singular, plural, number) ngettext(singular, plural, number)
108
#else
109
110
#define _(string) (string)
#define P_(singular, plural, number) (number == 1 ? singular : plural)
Chris Allegretta's avatar
Chris Allegretta committed
111
#endif
112
113
#define gettext_noop(string) (string)
#define N_(string) gettext_noop(string)
David Lawrence Ramsey's avatar
David Lawrence Ramsey committed
114
	/* Mark a string that will be sent to gettext() later. */
Chris Allegretta's avatar
Chris Allegretta committed
115

116
#include <stddef.h>
117
#include <stdlib.h>
118
119
#include <sys/types.h>
#include <sys/stat.h>
120
121
122
123
#include <dirent.h>
#ifdef HAVE_REGEX_H
#include <regex.h>
#endif
124
#include <signal.h>
125
#include <assert.h>
Chris Allegretta's avatar
Chris Allegretta committed
126

127
/* If no vsnprintf(), use the version from glib 2.x. */
128
#ifndef HAVE_VSNPRINTF
129
#include <glib.h>
130
#define vsnprintf g_vsnprintf
Chris Allegretta's avatar
Chris Allegretta committed
131
#endif
132

133
134
135
136
137
138
139
140
141
/* If no isblank(), iswblank(), strcasecmp(), strncasecmp(),
 * strcasestr(), strnlen(), getdelim(), or getline(), use the versions
 * we have. */
#ifndef HAVE_ISBLANK
#define isblank nisblank
#endif
#ifndef HAVE_ISWBLANK
#define iswblank niswblank
#endif
142
143
144
145
146
147
148
149
150
151
152
153
#ifndef HAVE_STRCASECMP
#define strcasecmp nstrcasecmp
#endif
#ifndef HAVE_STRNCASECMP
#define strncasecmp nstrncasecmp
#endif
#ifndef HAVE_STRCASESTR
#define strcasestr nstrcasestr
#endif
#ifndef HAVE_STRNLEN
#define strnlen nstrnlen
#endif
154
155
156
157
158
159
160
#ifndef HAVE_GETDELIM
#define getdelim ngetdelim
#endif
#ifndef HAVE_GETLINE
#define getline ngetline
#endif

David Lawrence Ramsey's avatar
David Lawrence Ramsey committed
161
162
/* If we aren't using ncurses with mouse support, turn the mouse support
 * off, as it's useless then. */
163
164
165
#ifndef NCURSES_MOUSE_VERSION
#define DISABLE_MOUSE 1
#endif
166

167
168
#if defined(DISABLE_WRAPPING) && defined(DISABLE_JUSTIFY)
#define DISABLE_WRAPJUSTIFY 1
169
#endif
170

171
172
173
174
175
/* Enumeration types. */
typedef enum {
    NIX_FILE, DOS_FILE, MAC_FILE
} file_format;

176
177
178
179
typedef enum {
    HUSH, MILD, ALERT
} message_type;

180
181
typedef enum {
    OVERWRITE, APPEND, PREPEND
182
} kind_of_writing_type;
183

184
185
186
187
typedef enum {
    SOFTMARK, HARDMARK
} mark_type;

188
typedef enum {
189
    UPWARD, DOWNWARD
190
} scroll_dir;
191
192

typedef enum {
193
    CENTERING, FLOWING, STATIONARY
194
} update_type;
195

196
typedef enum {
197
198
199
    ADD, DEL, BACK, CUT, CUT_EOF, REPLACE,
#ifndef DISABLE_WRAPPING
    SPLIT_BEGIN, SPLIT_END,
200
201
202
#endif
#ifndef DISABLE_COMMENT
    COMMENT, UNCOMMENT, PREFLIGHT,
203
#endif
204
    JOIN, PASTE, INSERT, ENTER, OTHER
205
206
} undo_type;

207
/* Structure types. */
208
#ifndef DISABLE_COLOR
209
typedef struct colortype {
210
    short fg;
211
	/* This syntax's foreground color. */
212
    short bg;
213
214
215
216
217
218
	/* This syntax's background color. */
    bool bright;
	/* Is this color A_BOLD? */
    int pairnum;
	/* The color pair number used for this foreground color and
	 * background color. */
219
220
    int attributes;
	/* Pair number and brightness composed into ready-to-use attributes. */
221
222
    int rex_flags;
	/* The regex compilation flags (with or without REG_ICASE). */
223
224
225
226
227
228
229
230
    char *start_regex;
	/* The start (or all) of the regex string. */
    regex_t *start;
	/* The compiled start (or all) of the regex string. */
    char *end_regex;
	/* The end (if any) of the regex string. */
    regex_t *end;
	/* The compiled end (if any) of the regex string. */
231
    struct colortype *next;
232
	/* Next set of colors. */
233
    int id;
Benno Schulenberg's avatar
Benno Schulenberg committed
234
	/* Basic id for assigning to lines later. */
235
236
} colortype;

237
typedef struct regexlisttype {
238
239
    char *full_regex;
	/* A regex string to match things that imply a certain syntax. */
240
    struct regexlisttype *next;
241
	/* The next regex. */
242
} regexlisttype;
243
244

typedef struct syntaxtype {
245
    char *name;
246
	/* The name of this syntax. */
247
    regexlisttype *extensions;
248
	/* The list of extensions that this syntax applies to. */
249
    regexlisttype *headers;
250
	/* The list of headerlines that this syntax applies to. */
251
    regexlisttype *magics;
252
	/* The list of libmagic results that this syntax applies to. */
253
    char *linter;
254
	/* The command with which to lint this type of file. */
255
    char *formatter;
256
        /* The formatting command (for programming languages mainly). */
257
258
    char *comment;
	/* The line comment prefix (and postfix) for this type of file. */
259
260
    colortype *color;
	/* The colors and their regexes used in this syntax. */
261
    int nmultis;
262
	/* How many multiline regex strings this syntax has. */
263
    struct syntaxtype *next;
264
	/* Next syntax. */
265
} syntaxtype;
266

267
268
269
270
271
272
typedef struct lintstruct {
    ssize_t lineno;
	/* Line number of the error. */
    ssize_t colno;
	/* Column # of the error. */
    char *msg;
Benno Schulenberg's avatar
Benno Schulenberg committed
273
	/* Error message text. */
274
    char *filename;
Benno Schulenberg's avatar
Benno Schulenberg committed
275
	/* Filename. */
276
277
278
    struct lintstruct *next;
	/* Next error. */
    struct lintstruct *prev;
Benno Schulenberg's avatar
Benno Schulenberg committed
279
	/* Previous error. */
280
281
} lintstruct;

282
/* Flags that indicate how a multiline regex applies to a line. */
283
#define CNONE		(1<<1)
284
	/* Yay, regex doesn't apply to this line at all! */
285
#define CBEGINBEFORE	(1<<2)
Benno Schulenberg's avatar
Benno Schulenberg committed
286
	/* Regex starts on an earlier line, ends on this one. */
287
#define CENDAFTER	(1<<3)
Benno Schulenberg's avatar
Benno Schulenberg committed
288
	/* Regex starts on this line and ends on a later one. */
289
#define CWHOLELINE	(1<<4)
Benno Schulenberg's avatar
Benno Schulenberg committed
290
	/* Whole line engulfed by the regex, start < me, end > me. */
291
#define CSTARTENDHERE	(1<<5)
Benno Schulenberg's avatar
Benno Schulenberg committed
292
	/* Regex starts and ends within this line. */
293
#endif /* !DISABLE_COLOR */
294

295
/* More structure types. */
296
297
298
299
300
301
302
303
304
typedef struct filestruct {
    char *data;
	/* The text of this line. */
    ssize_t lineno;
	/* The number of this line. */
    struct filestruct *next;
	/* Next node. */
    struct filestruct *prev;
	/* Previous node. */
305
#ifndef DISABLE_COLOR
Benno Schulenberg's avatar
Benno Schulenberg committed
306
307
    short *multidata;
	/* Array of which multi-line regexes apply to this line. */
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
#endif
} filestruct;

typedef struct partition {
    filestruct *fileage;
	/* The top line of this portion of the file. */
    filestruct *top_prev;
	/* The line before the top line of this portion of the file. */
    char *top_data;
	/* The text before the beginning of the top line of this portion
	 * of the file. */
    filestruct *filebot;
	/* The bottom line of this portion of the file. */
    filestruct *bot_next;
	/* The line after the bottom line of this portion of the
	 * file. */
    char *bot_data;
	/* The text after the end of the bottom line of this portion of
	 * the file. */
} partition;

329
#ifndef NANO_TINY
330
331
332
333
334
335
336
337
typedef struct undo_group {
    ssize_t top_line;
	/* First line of group. */
    ssize_t bottom_line;
	/* Last line of group. */
    struct undo_group *next;
} undo_group;

338
typedef struct undo {
339
    ssize_t lineno;
340
    undo_type type;
Benno Schulenberg's avatar
Benno Schulenberg committed
341
	/* What type of undo this was. */
342
    size_t begin;
Benno Schulenberg's avatar
Benno Schulenberg committed
343
	/* Where did this action begin or end. */
344
    char *strdata;
Benno Schulenberg's avatar
Benno Schulenberg committed
345
	/* String type data we will use for copying the affected line back. */
346
347
348
349
    size_t wassize;
	/* The file size before the action. */
    size_t newsize;
	/* The file size after the action. */
350
    int xflags;
Benno Schulenberg's avatar
Benno Schulenberg committed
351
	/* Some flag data we need. */
352
353
    undo_group *grouping;
	/* Undo info specific to groups of lines. */
354

Benno Schulenberg's avatar
Benno Schulenberg committed
355
    /* Cut-specific stuff we need. */
356
    filestruct *cutbuffer;
Benno Schulenberg's avatar
Benno Schulenberg committed
357
	/* Copy of the cutbuffer. */
358
    filestruct *cutbottom;
Benno Schulenberg's avatar
Benno Schulenberg committed
359
	/* Copy of cutbottom. */
360
    ssize_t mark_begin_lineno;
361
	/* Mostly the line number of the current line; sometimes something else. */
362
    size_t mark_begin_x;
363
	/* The x position corresponding to the above line number. */
364
    struct undo *next;
365
	/* A pointer to the undo item of the preceding action. */
366
} undo;
367
#endif /* !NANO_TINY */
368

369
#ifndef DISABLE_HISTORIES
370
371
typedef struct poshiststruct {
    char *filename;
372
	/* The file. */
373
    ssize_t lineno;
Benno Schulenberg's avatar
Benno Schulenberg committed
374
	/* Line number we left off on. */
375
    ssize_t xno;
Benno Schulenberg's avatar
Benno Schulenberg committed
376
	/* x position in the file we left off on. */
377
378
    struct poshiststruct *next;
} poshiststruct;
379
#endif
380

381
typedef struct openfilestruct {
382
    char *filename;
383
	/* The file's name. */
384
    filestruct *fileage;
385
	/* The file's first line. */
386
    filestruct *filebot;
387
	/* The file's last line. */
388
    filestruct *edittop;
389
	/* The current top of the edit window for this file. */
390
    filestruct *current;
391
	/* The current line for this file. */
392
    size_t totsize;
393
	/* The file's total number of characters. */
394
    size_t current_x;
395
	/* The file's x-coordinate position. */
396
    size_t placewewant;
397
	/* The file's x position we would like. */
398
    ssize_t current_y;
399
	/* The file's y-coordinate position. */
400
    bool modified;
401
	/* Whether the file has been modified. */
402
403
    struct stat *current_stat;
	/* The file's current stat information. */
404
#ifndef NANO_TINY
405
    bool mark_set;
406
	/* Whether the mark is on in this file. */
407
    filestruct *mark_begin;
408
	/* The file's line where the mark is, if any. */
409
    size_t mark_begin_x;
410
	/* The file's mark's x-coordinate position, if any. */
411
412
    mark_type kind_of_mark;
	/* Whether this is a soft or a hard mark. */
413
    file_format fmt;
414
	/* The file's format. */
415
    undo *undotop;
416
	/* The top of the undo list. */
417
    undo *current_undo;
Benno Schulenberg's avatar
Benno Schulenberg committed
418
	/* The current (i.e. next) level of undo. */
419
    undo_type last_action;
420
	/* The type of the last action the user performed. */
421
    char *lock_filename;
422
	/* The path of the lockfile, if we created one. */
423
#endif
424
#ifndef DISABLE_COLOR
425
    syntaxtype *syntax;
Benno Schulenberg's avatar
Benno Schulenberg committed
426
	/* The  syntax struct for this file, if any. */
427
    colortype *colorstrings;
428
	/* The file's associated colors. */
429
#endif
430
    struct openfilestruct *next;
431
	/* The next open file, if any. */
432
    struct openfilestruct *prev;
433
	/* The preceding open file, if any. */
434
} openfilestruct;
435

436
#ifndef DISABLE_NANORC
437
typedef struct rcoption {
438
    const char *name;
439
	/* The name of the rcfile option. */
440
    long flag;
441
	/* The flag associated with it, if any. */
442
} rcoption;
David Lawrence Ramsey's avatar
David Lawrence Ramsey committed
443
#endif
444

445
typedef struct sc {
446
    const char *keystr;
447
	/* The string that describes a keystroke, like "^C" or "M-R". */
448
449
    bool meta;
	/* Whether this is a Meta keystroke. */
450
451
    int keycode;
	/* The integer that, together with meta, identifies the keystroke. */
452
453
    int menus;
	/* Which menus this applies to. */
454
    void (*scfunc)(void);
455
	/* The function we're going to run. */
456
    int toggle;
457
	/* If a toggle, what we're toggling. */
458
459
460
    int ordinal;
	/* The how-manieth toggle this is, in order to be able to
	 * keep them in sequence. */
461
    struct sc *next;
462
	/* Next in the list. */
463
464
465
} sc;

typedef struct subnfunc {
466
    void (*scfunc)(void);
467
	/* The actual function to call. */
468
    int menus;
Benno Schulenberg's avatar
Benno Schulenberg committed
469
	/* In what menus this function applies. */
470
    const char *desc;
471
	/* The function's short description, for example "Where Is". */
472
473
#ifndef DISABLE_HELP
    const char *help;
474
	/* The help-screen text for this function. */
475
    bool blank_after;
476
477
	/* Whether there should be a blank line after the help text
	 * for this function. */
478
479
#endif
    bool viewok;
480
	/* Is this function allowed when in view mode? */
481
    long toggle;
482
	/* If this is a toggle, which toggle to affect. */
483
    struct subnfunc *next;
Benno Schulenberg's avatar
Benno Schulenberg committed
484
	/* Next item in the list. */
485
486
} subnfunc;

487
488
489
490
491
492
493
494
495
/* The elements of the interface that can be colored differently. */
enum
{
    TITLE_BAR = 0,
    STATUS_BAR,
    KEY_COMBO,
    FUNCTION_TAG,
    NUMBER_OF_ELEMENTS
};
496

497
/* Enumeration used in the flags array.  See the definition of FLAGMASK. */
498
499
enum
{
500
    DONTUSE,
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
    CASE_SENSITIVE,
    CONST_UPDATE,
    NO_HELP,
    SUSPEND,
    NO_WRAP,
    AUTOINDENT,
    VIEW_MODE,
    USE_MOUSE,
    USE_REGEXP,
    TEMP_FILE,
    CUT_TO_END,
    BACKWARDS_SEARCH,
    MULTIBUFFER,
    SMOOTH_SCROLL,
    REBIND_DELETE,
    REBIND_KEYPAD,
    NO_CONVERT,
    BACKUP_FILE,
519
    INSECURE_BACKUP,
520
521
522
523
524
525
526
527
528
529
530
531
532
    NO_COLOR_SYNTAX,
    PRESERVE,
    HISTORYLOG,
    RESTRICTED,
    SMART_HOME,
    WHITESPACE_DISPLAY,
    MORE_SPACE,
    TABS_TO_SPACES,
    QUICK_BLANK,
    WORD_BOUNDS,
    NO_NEWLINES,
    BOLD_TEXT,
    QUIET,
533
    SOFTWRAP,
534
    POS_HISTORY,
535
    LOCKING,
536
    NOREAD_MODE,
537
    MAKE_IT_UNIX,
538
    JUSTIFY_TRIM
539
};
Chris Allegretta's avatar
Chris Allegretta committed
540

Benno Schulenberg's avatar
Benno Schulenberg committed
541
/* Flags for the menus in which a given function should be present. */
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
#define MMAIN			(1<<0)
#define MWHEREIS		(1<<1)
#define MREPLACE		(1<<2)
#define MREPLACEWITH		(1<<3)
#define MGOTOLINE		(1<<4)
#define MWRITEFILE		(1<<5)
#define MINSERTFILE		(1<<6)
#define MEXTCMD			(1<<7)
#define MHELP			(1<<8)
#define MSPELL			(1<<9)
#define MBROWSER		(1<<10)
#define MWHEREISFILE		(1<<11)
#define MGOTODIR		(1<<12)
#define MYESNO			(1<<13)
#define MLINTER			(1<<14)
557
/* This is an abbreviation for all menus except Help and YesNo. */
558
559
#define MMOST  (MMAIN|MWHEREIS|MREPLACE|MREPLACEWITH|MGOTOLINE|MWRITEFILE|MINSERTFILE|\
		MEXTCMD|MBROWSER|MWHEREISFILE|MGOTODIR|MSPELL|MLINTER)
560

561
562
563
564
/* Basic control codes. */
#define TAB_CODE  0x09
#define ESC_CODE  0x1B
#define DEL_CODE  0x7F
Chris Allegretta's avatar
Chris Allegretta committed
565

566
567
568
/* Codes for "modified" Arrow keys, beyond KEY_MAX of ncurses. */
#define CONTROL_LEFT 0x401
#define CONTROL_RIGHT 0x402
569
570
#define CONTROL_UP 0x403
#define CONTROL_DOWN 0x404
571
572
573
574
575
576
577
578
579
580
#define SHIFT_CONTROL_LEFT 0x405
#define SHIFT_CONTROL_RIGHT 0x406
#define SHIFT_CONTROL_UP 0x407
#define SHIFT_CONTROL_DOWN 0x408
#define SHIFT_ALT_LEFT 0x409
#define SHIFT_ALT_RIGHT 0x40a
#define SHIFT_ALT_UP 0x40b
#define SHIFT_ALT_DOWN 0x40c
#define SHIFT_PAGEUP 0x40d
#define SHIFT_PAGEDOWN 0x40e
581

582
#ifndef NANO_TINY
583
584
585
/* An imaginary key for when we get a SIGWINCH (window resize). */
#define KEY_WINCH -2

586
587
/* Some extra flags for the undo function. */
#define WAS_FINAL_BACKSPACE	(1<<1)
588
589
590
591
#define WAS_WHOLE_LINE		(1<<2)
/* The flags for the mark need to be the highest. */
#define MARK_WAS_SET		(1<<3)
#define WAS_MARKED_FORWARD	(1<<4)
592
593
#endif /* !NANO_TINY */

594
/* The maximum number of entries displayed in the main shortcut list. */
595
#define MAIN_VISIBLE (((COLS + 40) / 20) * 2)
596

597
598
/* The default number of characters from the end of the line where
 * wrapping occurs. */
599
600
#define CHARS_FROM_EOL 8

601
/* The default width of a tab in spaces. */
602
603
#define WIDTH_OF_TAB 8

604
605
/* The maximum number of search/replace history strings saved, not
 * counting the blank lines at their ends. */
606
#define MAX_SEARCH_HISTORY 100
Chris Allegretta's avatar
Chris Allegretta committed
607

608
/* The maximum number of bytes buffered at one time. */
609
610
#define MAX_BUF_SIZE 128

611
612
613
/* The largest size_t number that doesn't have the high bit set. */
#define HIGHEST_POSITIVE ((~(size_t)0) >> 1)

Chris Allegretta's avatar
Chris Allegretta committed
614
#endif /* !NANO_H */