Imported Upstream version 20061222
Andreas Beckmann
9 years ago
14 | 14 | |
15 | 15 | |
16 | 16 | CC= gcc |
17 | CFLAGS= -O2 -pipe | |
17 | CFLAGS?= -O2 -pipe | |
18 | 18 | CFLAGS+= -g -Wall -Werror |
19 | 19 | LDFLAGS= -lncurses |
20 | 20 |
0 | /* $OpenBSD: autoexec.c,v 1.10 2005/10/14 19:46:46 kjell Exp $ */ | |
0 | /* $OpenBSD: autoexec.c,v 1.13 2006/12/20 21:31:45 deraadt Exp $ */ | |
1 | 1 | /* this file is in the public domain */ |
2 | 2 | /* Author: Vincent Labrecque <vincent@openbsd.org> April 2002 */ |
3 | 3 | |
15 | 15 | static SLIST_HEAD(, autoexec) autos; |
16 | 16 | static int ready; |
17 | 17 | |
18 | ||
19 | #define AUTO_GROW 8 | |
18 | 20 | /* |
19 | 21 | * Return a NULL terminated array of function pointers to be called |
20 | 22 | * when we open a file that matches <fname>. The list must be free(ed) |
36 | 38 | SLIST_FOREACH(ae, &autos, next) { |
37 | 39 | if (fnmatch(ae->pattern, fname, 0) == 0) { |
38 | 40 | if (used >= have) { |
39 | npfl = realloc(pfl, (have + 8 + 1) * sizeof(PF)); | |
41 | npfl = realloc(pfl, (have + AUTO_GROW + 1) * | |
42 | sizeof(PF)); | |
40 | 43 | if (npfl == NULL) |
41 | 44 | panic("out of memory"); |
42 | 45 | pfl = npfl; |
43 | have += 8; | |
46 | have += AUTO_GROW; | |
44 | 47 | } |
45 | 48 | pfl[used++] = ae->fp; |
46 | 49 | } |
47 | 50 | } |
48 | if (used) { | |
51 | if (used) | |
49 | 52 | pfl[used] = NULL; |
50 | pfl = realloc(pfl, (used + 1) * sizeof(PF)); | |
51 | } | |
53 | ||
52 | 54 | return (pfl); |
53 | 55 | } |
54 | 56 | |
92 | 94 | else if (patp[0] == '\0') |
93 | 95 | return (FALSE); |
94 | 96 | if ((funcp = eread("Execute: ", funcbuf, sizeof(funcbuf), |
95 | EFNEW | EFCR)) == NULL) | |
97 | EFNEW | EFCR | EFFUNC)) == NULL) | |
96 | 98 | return (ABORT); |
97 | 99 | else if (funcp[0] == '\0') |
98 | 100 | return (FALSE); |
0 | /* $OpenBSD: basic.c,v 1.27 2006/11/18 20:36:50 kjell Exp $ */ | |
0 | /* $OpenBSD: basic.c,v 1.28 2006/12/20 21:21:09 kjell Exp $ */ | |
1 | 1 | |
2 | 2 | /* This file is in the public domain */ |
3 | 3 | |
265 | 265 | n = 1; /* if tiny window. */ |
266 | 266 | } else if (n < 0) |
267 | 267 | return (backpage(f | FFRAND, -n)); |
268 | #ifdef CVMVAS | |
269 | else /* Convert from pages */ | |
270 | n *= curwp->w_ntrows; /* to lines. */ | |
271 | #endif | |
272 | 268 | lp = curwp->w_linep; |
273 | 269 | while (n-- && lforw(lp) != curbp->b_headp) { |
274 | 270 | lp = lforw(lp); |
308 | 304 | n = 1; /* window is tiny. */ |
309 | 305 | } else if (n < 0) |
310 | 306 | return (forwpage(f | FFRAND, -n)); |
311 | #ifdef CVMVAS | |
312 | else /* Convert from pages */ | |
313 | n *= curwp->w_ntrows; /* to lines. */ | |
314 | #endif | |
315 | 307 | lp = curwp->w_linep; |
316 | 308 | while (n-- && lback(lp) != curbp->b_headp) { |
317 | 309 | lp = lback(lp); |
0 | /* $OpenBSD: buffer.c,v 1.65 2006/11/18 23:05:24 kjell Exp $ */ | |
0 | /* $OpenBSD: buffer.c,v 1.66 2006/11/19 16:51:19 deraadt Exp $ */ | |
1 | 1 | |
2 | 2 | /* This file is in the public domain. */ |
3 | 3 | |
496 | 496 | static struct buffer * |
497 | 497 | bnew(const char *bname) |
498 | 498 | { |
499 | struct buffer *bp; | |
499 | struct buffer *bp; | |
500 | 500 | struct line *lp; |
501 | 501 | int i; |
502 | 502 | |
638 | 638 | int |
639 | 639 | augbname(char *bn, char *fn, size_t bs) |
640 | 640 | { |
641 | int count; | |
641 | int count; | |
642 | 642 | size_t remain, len; |
643 | 643 | |
644 | 644 | len = strlcpy(bn, basename(fn), bs); |
29 | 29 | # FKEYS -- add support for function key sequences. |
30 | 30 | # XKEYS -- use termcap function key definitions. |
31 | 31 | # Warning: XKEYS and bsmap mode do _not_ get along. |
32 | # PREFIXREGION -- enable function "prefix-region" | |
33 | 32 | # REGEX -- create regular expression functions |
34 | 33 | |
35 | 34 | cat << EOF > config.h |
36 | 35 | #define FKEYS |
37 | #define PREFIXREGION | |
38 | 36 | #define REGEX |
39 | 37 | #define XKEYS |
40 | 38 | EOF |
75 | 73 | int main(void) |
76 | 74 | {strtonum(NULL, 1, 1, NULL);return 0;} |
77 | 75 | EOF |
78 | if gcc testfile.c -o testfile 2>&3; then | |
76 | if gcc -Wall testfile.c -o testfile 2>&3; then | |
79 | 77 | echo 'Found.' |
80 | 78 | else |
81 | 79 | echo 'Not Found, adding.' |
90 | 88 | int main(void) |
91 | 89 | {strlcpy(NULL, NULL, 1);return 0;} |
92 | 90 | EOF |
93 | if gcc testfile.c -o testfile 2>&3; then | |
91 | if gcc -Wall testfile.c -o testfile 2>&3; then | |
94 | 92 | echo 'Found.' |
95 | 93 | else |
96 | 94 | echo 'Not Found, adding.' |
151 | 149 | extraflags="$extraflags -I/usr/$i/include" |
152 | 150 | break |
153 | 151 | fi |
154 | echo 'Not found!' | |
155 | echo 'If you know where term.h is, please email the author!' | |
152 | echo 'Not found!' >&2 | |
153 | echo 'Do you have the ncurses devel package installed?' >&2 | |
154 | echo 'If you know where term.h is, please email the author!' >&2 | |
156 | 155 | exit 1 |
157 | 156 | done |
158 | 157 | fi |
0 | /* $OpenBSD: def.h,v 1.97 2006/11/17 08:45:31 kjell Exp $ */ | |
0 | /* $OpenBSD: def.h,v 1.98 2006/11/19 16:51:19 deraadt Exp $ */ | |
1 | 1 | |
2 | 2 | /* This file is in the public domain. */ |
3 | 3 | |
46 | 46 | #define TRUE 1 /* True, yes, good, etc. */ |
47 | 47 | #define ABORT 2 /* Death, ^G, abort, etc. */ |
48 | 48 | |
49 | #define KCLEAR 2 /* clear echo area */ | |
49 | #define KCLEAR 2 /* clear echo area */ | |
50 | 50 | |
51 | 51 | /* |
52 | 52 | * These flag bits keep track of |
0 | /* $OpenBSD: dired.c,v 1.41 2006/07/25 08:27:09 kjell Exp $ */ | |
0 | /* $OpenBSD: dired.c,v 1.42 2006/11/01 06:02:29 ray Exp $ */ | |
1 | 1 | |
2 | 2 | /* This file is in the public domain. */ |
3 | 3 | |
635 | 635 | } |
636 | 636 | line[0] = line[1] = ' '; |
637 | 637 | while (fgets(&line[2], sizeof(line) - 2, dirpipe) != NULL) { |
638 | line[strlen(line) - 1] = '\0'; /* remove ^J */ | |
638 | char *p; | |
639 | ||
640 | if ((p = strchr(line, '\n')) != NULL) | |
641 | *p = '\0'; /* remove ^J */ | |
639 | 642 | (void) addline(bp, line); |
640 | 643 | } |
641 | 644 | if (pclose(dirpipe) == -1) { |
0 | /* $OpenBSD: display.c,v 1.30 2006/07/25 08:22:32 kjell Exp $ */ | |
0 | /* $OpenBSD: display.c,v 1.32 2006/12/20 21:31:45 deraadt Exp $ */ | |
1 | 1 | |
2 | 2 | /* This file is in the public domain. */ |
3 | 3 | |
102 | 102 | |
103 | 103 | #ifndef LINENOMODE |
104 | 104 | #define LINENOMODE TRUE |
105 | #endif /* !LINENOMODE */ | |
106 | static int linenos = LINENOMODE; | |
105 | #endif /* !LINENOMODE */ | |
106 | static int linenos = LINENOMODE; | |
107 | 107 | |
108 | 108 | /* |
109 | 109 | * Since we don't have variables (we probably should) this is a command |
118 | 118 | else |
119 | 119 | linenos = !linenos; |
120 | 120 | |
121 | sgarbf = TRUE; | |
121 | sgarbf = TRUE; | |
122 | 122 | |
123 | 123 | return (TRUE); |
124 | 124 | } |
0 | /* $OpenBSD: extend.c,v 1.48 2006/07/25 08:27:09 kjell Exp $ */ | |
0 | /* $OpenBSD: extend.c,v 1.49 2006/12/21 18:18:13 kjell Exp $ */ | |
1 | 1 | |
2 | 2 | /* This file is in the public domain. */ |
3 | 3 | |
90 | 90 | * Structure assignments would come in real handy, but K&R based compilers |
91 | 91 | * don't have them. Care is taken so running out of memory will leave |
92 | 92 | * the keymap in a usable state. |
93 | * Parameters are: | |
94 | * curmap: pointer to the map being changed | |
95 | * c: character being changed | |
96 | * funct: function being changed to | |
97 | * pref_map: if funct==NULL, map to bind to or NULL for new | |
93 | 98 | */ |
94 | 99 | static int |
95 | remap(KEYMAP *curmap, /* pointer to the map being changed */ | |
96 | int c, /* character being changed */ | |
97 | PF funct, /* function being changed to */ | |
98 | KEYMAP *pref_map) /* if funct==NULL, map to bind to or NULL for new */ | |
100 | remap(KEYMAP *curmap, int c, PF funct, KEYMAP *pref_map) | |
99 | 101 | { |
100 | 102 | int i, n1, n2, nold; |
101 | 103 | KEYMAP *mp, *newmap; |
221 | 223 | n2 = 1; |
222 | 224 | for (i = 0; n2 && i < n1; i++) |
223 | 225 | n2 &= ele->k_funcp[i] != NULL; |
224 | if (curmap->map_num >= curmap->map_max && | |
225 | (curmap = reallocmap(curmap)) == NULL) | |
226 | return (FALSE); | |
226 | if (curmap->map_num >= curmap->map_max) { | |
227 | if ((newmap = reallocmap(curmap)) == NULL) | |
228 | return (FALSE); | |
229 | curmap = newmap; | |
230 | } | |
227 | 231 | if ((pfp = calloc(ele->k_num - c + !n2, |
228 | 232 | sizeof(PF))) == NULL) { |
229 | 233 | ewprintf("Out of memory"); |
265 | 269 | } |
266 | 270 | |
267 | 271 | /* |
268 | * Reallocate a keymap, used above. | |
272 | * Reallocate a keymap. Returns NULL (without trashing the current map) | |
273 | * on failure. | |
269 | 274 | */ |
270 | 275 | static KEYMAP * |
271 | 276 | reallocmap(KEYMAP *curmap) |
0 | /* $OpenBSD: fileio.c,v 1.78 2006/09/19 05:52:23 otto Exp $ */ | |
0 | /* $OpenBSD: fileio.c,v 1.79 2006/11/19 16:51:19 deraadt Exp $ */ | |
1 | 1 | |
2 | 2 | /* This file is in the public domain. */ |
3 | 3 | |
112 | 112 | { |
113 | 113 | struct line *lp, *lp2, *lpend; |
114 | 114 | int emptylines = 0; |
115 | int ret; | |
116 | 115 | |
117 | 116 | lpend = bp->b_headp; |
118 | 117 | |
119 | /* This stuff is to make sure there is exactly one trailing \n at the | |
120 | * end of the buffer. */ | |
121 | ||
122 | /* XXX make this stuff work with flags once we have them. */ | |
118 | /* | |
119 | * This stuff is to make sure there is exactly one trailing \n at the | |
120 | * end of the buffer. | |
121 | ||
122 | * Since I assume 99.99% of all files are best of with exactly one | |
123 | * trailing \n I'll make that the default behaviour, no questions asked. | |
124 | */ | |
123 | 125 | |
124 | 126 | /* Scroll backwards to the last nonempty line. Stop if the buffer |
125 | 127 | * contains only empty lines. */ |
132 | 134 | return(FIOERR); |
133 | 135 | else { |
134 | 136 | if (emptylines == 0) { |
135 | ret = eyorn("No newline at end of file, add one"); | |
136 | switch(ret) { | |
137 | case(ABORT): /* c-g is pressed */ | |
138 | return(FIOERR); | |
139 | case(TRUE): | |
140 | lnewline_at(lback(lpend), llength(lback(lpend))); | |
141 | break; | |
142 | default: | |
143 | break; | |
144 | } | |
137 | lnewline_at(lback(lpend), llength(lback(lpend))); | |
145 | 138 | } else if (emptylines > 1) { |
146 | ret = eyorn("Trailing newlines at end of file," | |
147 | " remove them"); | |
148 | switch(ret) { | |
149 | case(ABORT): /* c-g is pressed */ | |
150 | return(FIOERR); | |
151 | case(TRUE): | |
152 | /* Step to the desired end of the buffer. */ | |
153 | lp = lforw(lp); | |
154 | lp = lforw(lp); | |
155 | /* And remove the remaining newlines, use extra | |
156 | * pointer to make sure we don't step on a freed | |
157 | * line. */ | |
158 | while(lp != lpend) { | |
159 | lp2 = lforw(lp); | |
160 | lfree(lp); | |
161 | lp = lp2; | |
162 | } | |
163 | break; | |
164 | default: | |
165 | break; | |
139 | /* Step to the desired end of the buffer. */ | |
140 | lp = lforw(lp); | |
141 | lp = lforw(lp); | |
142 | /* And remove the remaining newlines, use extra pointer | |
143 | * to make sure we don't step on a freed line. */ | |
144 | while(lp != lpend) { | |
145 | lp2 = lforw(lp); | |
146 | lfree(lp); | |
147 | lp = lp2; | |
166 | 148 | } |
167 | 149 | } |
168 | 150 | } |
475 | 457 | char prefixx[NFILEN + 1]; |
476 | 458 | |
477 | 459 | /* |
478 | * We need three different strings: dir - the name of the directory | |
479 | * containing what the user typed. Must be a real unix file name, | |
480 | * e.g. no ~user, etc.. Must not end in /. prefix - the portion of | |
481 | * what the user typed that is before the names we are going to find | |
482 | * in the directory. Must have a trailing / if the user typed it. | |
483 | * names from the directory. We open dir, and return prefix | |
460 | * We need three different strings: | |
461 | ||
462 | * dir - the name of the directory containing what the user typed. | |
463 | * Must be a real unix file name, e.g. no ~user, etc.. | |
464 | * Must not end in /. | |
465 | * prefix - the portion of what the user typed that is before the | |
466 | * names we are going to find in the directory. Must have a | |
467 | * trailing / if the user typed it. | |
468 | * names from the directory - We open dir, and return prefix | |
484 | 469 | * concatenated with names. |
485 | 470 | */ |
486 | 471 | |
487 | 472 | /* first we get a directory name we can look up */ |
488 | 473 | /* |
489 | 474 | * Names ending in . are potentially odd, because adjustname will |
490 | * treat foo/.. as a reference to another directory, whereas we are | |
475 | * treat foo/bar/.. as a foo/, whereas we are | |
491 | 476 | * interested in names starting with .. |
492 | 477 | */ |
493 | 478 | len = strlen(buf); |
494 | if (buf[len - 1] == '.') { | |
479 | if (len && buf[len - 1] == '.') { | |
495 | 480 | buf[len - 1] = 'x'; |
496 | 481 | dir = adjustname(buf, TRUE); |
497 | 482 | buf[len - 1] = '.'; |
503 | 488 | * If the user typed a trailing / or the empty string |
504 | 489 | * he wants us to use his file spec as a directory name. |
505 | 490 | */ |
506 | if (buf[0] && buf[strlen(buf) - 1] != '/') { | |
491 | if (len && buf[len - 1] != '/') { | |
507 | 492 | file = strrchr(dir, '/'); |
508 | 493 | if (file) { |
509 | 494 | *file = '\0'; |
531 | 516 | * SV files are fairly short. For BSD, something more general would |
532 | 517 | * be required. |
533 | 518 | */ |
534 | if ((preflen + MAXNAMLEN) > NFILEN) | |
519 | if (preflen > NFILEN - MAXNAMLEN) | |
535 | 520 | return (NULL); |
536 | 521 | |
537 | 522 | /* loop over the specified directory, making up the list of files */ |
0 | /* $OpenBSD: funmap.c,v 1.24 2006/06/01 09:00:50 kjell Exp $ */ | |
0 | /* $OpenBSD: funmap.c,v 1.26 2006/12/21 18:06:02 kjell Exp $ */ | |
1 | 1 | /* |
2 | 2 | * Copyright (c) 2001 Artur Grabowski <art@openbsd.org>. All rights reserved. |
3 | 3 | * |
53 | 53 | {gotobol, "beginning-of-line",}, |
54 | 54 | {blinkparen, "blink-matching-paren",}, |
55 | 55 | {showmatch, "blink-matching-paren-hack",}, |
56 | #ifdef BSMAP | |
57 | 56 | {bsmap, "bsmap-mode",}, |
58 | #endif /* BSMAP */ | |
59 | 57 | {NULL, "c-x 4 prefix",}, |
60 | 58 | {NULL, "c-x prefix",}, |
61 | 59 | #ifndef NO_MACRO |
147 | 145 | {openline, "open-line",}, |
148 | 146 | {nextwind, "other-window",}, |
149 | 147 | {overwrite_mode, "overwrite-mode",}, |
150 | #ifdef PREFIXREGION | |
151 | 148 | {prefixregion, "prefix-region",}, |
152 | #endif /* PREFIXREGION */ | |
153 | 149 | {backline, "previous-line",}, |
154 | 150 | {prevwind, "previous-window",}, |
155 | 151 | {spawncli, "push-shell",}, |
185 | 181 | {set_default_mode, "set-default-mode",}, |
186 | 182 | {setfillcol, "set-fill-column",}, |
187 | 183 | {setmark, "set-mark-command",}, |
188 | #ifdef PREFIXREGION | |
189 | 184 | {setprefix, "set-prefix-string",}, |
190 | #endif /* PREFIXREGION */ | |
191 | 185 | {shrinkwind, "shrink-window",}, |
192 | 186 | #ifdef NOTAB |
193 | 187 | {space_to_tabstop, "space-to-tabstop",}, |
0 | /* $OpenBSD: grep.c,v 1.32 2006/07/25 08:27:09 kjell Exp $ */ | |
0 | /* $OpenBSD: grep.c,v 1.33 2006/11/19 16:51:19 deraadt Exp $ */ | |
1 | 1 | /* |
2 | 2 | * Copyright (c) 2001 Artur Grabowski <art@openbsd.org>. |
3 | 3 | * Copyright (c) 2005 Kjell Wooding <kjell@openbsd.org>. |
310 | 310 | /* last line is compilation result */ |
311 | 311 | if (curwp->w_dotp == last) |
312 | 312 | return (FALSE); |
313 | ||
313 | ||
314 | 314 | if ((line = linetostr(curwp->w_dotp)) == NULL) |
315 | 315 | return (FALSE); |
316 | 316 | lp = line; |
0 | /* $OpenBSD: kbd.c,v 1.22 2006/04/03 02:43:22 kjell Exp $ */ | |
0 | /* $OpenBSD: kbd.c,v 1.23 2006/12/21 18:06:02 kjell Exp $ */ | |
1 | 1 | |
2 | 2 | /* This file is in the public domain. */ |
3 | 3 | |
44 | 44 | return (TRUE); |
45 | 45 | } |
46 | 46 | |
47 | #ifdef BSMAP | |
48 | static int bs_map = BSMAP; | |
47 | static int bs_map = 0; | |
48 | ||
49 | 49 | /* |
50 | 50 | * Toggle backspace mapping |
51 | 51 | */ |
59 | 59 | ewprintf("Backspace mapping %sabled", bs_map ? "en" : "dis"); |
60 | 60 | return (TRUE); |
61 | 61 | } |
62 | #endif /* BSMAP */ | |
63 | 62 | |
64 | 63 | void |
65 | 64 | ungetkey(int c) |
94 | 93 | pushed = FALSE; |
95 | 94 | } else |
96 | 95 | c = ttgetc(); |
97 | #ifdef BSMAP | |
98 | if (bs_map) | |
96 | ||
97 | if (bs_map) { | |
99 | 98 | if (c == CCHR('H')) |
100 | 99 | c = CCHR('?'); |
101 | 100 | else if (c == CCHR('?')) |
102 | 101 | c = CCHR('H'); |
103 | #endif /* BSMAP */ | |
102 | } | |
104 | 103 | if (use_metakey && (c & METABIT)) { |
105 | 104 | pushedc = c & ~METABIT; |
106 | 105 | pushed = TRUE; |
0 | /* $OpenBSD: kbd.h,v 1.17 2005/11/18 20:56:53 deraadt Exp $ */ | |
0 | /* $OpenBSD: kbd.h,v 1.18 2006/07/27 19:59:29 deraadt Exp $ */ | |
1 | 1 | |
2 | 2 | /* This file is in the public domain. */ |
3 | 3 |
0 | /* $OpenBSD: main.c,v 1.54 2006/07/25 08:22:32 kjell Exp $ */ | |
0 | /* $OpenBSD: main.c,v 1.55 2006/11/19 16:51:19 deraadt Exp $ */ | |
1 | 1 | |
2 | 2 | /* This file is in the public domain. */ |
3 | 3 | |
19 | 19 | int lastflag; /* flags, last command */ |
20 | 20 | int curgoal; /* goal column */ |
21 | 21 | int startrow; /* row to start */ |
22 | struct buffer *curbp; /* current buffer */ | |
23 | struct buffer *bheadp; /* BUFFER list head */ | |
24 | struct mgwin *curwp; /* current window */ | |
25 | struct mgwin *wheadp; /* MGWIN listhead */ | |
22 | struct buffer *curbp; /* current buffer */ | |
23 | struct buffer *bheadp; /* BUFFER list head */ | |
24 | struct mgwin *curwp; /* current window */ | |
25 | struct mgwin *wheadp; /* MGWIN listhead */ | |
26 | 26 | char pat[NPAT]; /* pattern */ |
27 | 27 | |
28 | 28 | static void edinit(PF); |
0 | /* $OpenBSD: region.c,v 1.24 2006/07/25 08:22:32 kjell Exp $ */ | |
0 | /* $OpenBSD: region.c,v 1.25 2006/12/16 17:00:03 kjell Exp $ */ | |
1 | 1 | |
2 | 2 | /* This file is in the public domain. */ |
3 | 3 | |
239 | 239 | return (TRUE); |
240 | 240 | } |
241 | 241 | |
242 | #ifdef PREFIXREGION | |
243 | /* | |
244 | * Implements one of my favorite keyboard macros; put a string at the | |
245 | * beginning of a number of lines in a buffer. The quote string is | |
246 | * settable by using set-prefix-string. Great for quoting mail, which | |
247 | * is the real reason I wrote it, but also has uses for creating bar | |
248 | * comments (like the one you're reading) in C code. | |
249 | */ | |
250 | ||
251 | 242 | #define PREFIXLENGTH 40 |
252 | 243 | static char prefix_string[PREFIXLENGTH] = {'>', '\0'}; |
253 | 244 | |
297 | 288 | } |
298 | 289 | |
299 | 290 | /* |
300 | * Set line prefix string. | |
291 | * Set line prefix string. Used by prefixregion. | |
301 | 292 | */ |
302 | 293 | /* ARGSUSED */ |
303 | 294 | int |
324 | 315 | retval = FALSE; |
325 | 316 | return (retval); |
326 | 317 | } |
327 | #endif /* PREFIXREGION */ | |
328 | 318 | |
329 | 319 | int |
330 | 320 | region_get_data(struct region *reg, char *buf, int len) |
0 | /* $OpenBSD: undo.c,v 1.42 2006/11/17 08:45:31 kjell Exp $ */ | |
0 | /* $OpenBSD: undo.c,v 1.43 2006/11/19 16:51:19 deraadt Exp $ */ | |
1 | 1 | /* |
2 | 2 | * Copyright (c) 2002 Vincent Labrecque <vincent@openbsd.org> |
3 | 3 | * Copyright (c) 2005, 2006 Kjell Wooding <kjell@openbsd.org> |
35 | 35 | static LIST_HEAD(, undo_rec) undo_free; |
36 | 36 | static int undo_free_num; |
37 | 37 | static int boundary_flag = TRUE; |
38 | static int undo_enable_flag = TRUE; | |
38 | static int undo_enable_flag = TRUE; | |
39 | 39 | |
40 | 40 | /* |
41 | 41 | * Local functions |
0 | /* $OpenBSD: yank.c,v 1.5 2006/11/17 08:45:31 kjell Exp $ */ | |
0 | /* $OpenBSD: yank.c,v 1.6 2006/11/19 16:51:19 deraadt Exp $ */ | |
1 | 1 | |
2 | 2 | /* This file is in the public domain. */ |
3 | 3 | |
41 | 41 | * that if you put something in the kill buffer you are going to put more |
42 | 42 | * stuff there too later. Return TRUE if all is well, and FALSE on errors. |
43 | 43 | * Print a message on errors. Dir says whether to put it at back or front. |
44 | * This call is ignored if KNONE is set. | |
44 | * This call is ignored if KNONE is set. | |
45 | 45 | */ |
46 | 46 | int |
47 | 47 | kinsert(int c, int dir) |