comparison src/term.c @ 21514:fa9ff387d260

Fix -Wimplicit warnings.
author Andreas Schwab <schwab@suse.de>
date Tue, 14 Apr 1998 12:25:56 +0000
parents 9ab8e061c0bf
children d7c8600f8775
comparison
equal deleted inserted replaced
21513:984881b316fc 21514:fa9ff387d260
31 #include "coding.h" 31 #include "coding.h"
32 #include "frame.h" 32 #include "frame.h"
33 #include "disptab.h" 33 #include "disptab.h"
34 #include "termhooks.h" 34 #include "termhooks.h"
35 #include "keyboard.h" 35 #include "keyboard.h"
36 36 #include "dispextern.h"
37 extern Lisp_Object Fmake_sparse_keymap (); 37 #ifdef HAVE_X_WINDOWS
38 #include "xterm.h"
39 #endif
38 40
39 #define max(a, b) ((a) > (b) ? (a) : (b)) 41 #define max(a, b) ((a) > (b) ? (a) : (b))
40 #define min(a, b) ((a) < (b) ? (a) : (b)) 42 #define min(a, b) ((a) < (b) ? (a) : (b))
41 43
42 #define OUTPUT(a) tputs (a, (int) (FRAME_HEIGHT (selected_frame) - curY), cmputc) 44 #define OUTPUT(a) tputs (a, (int) (FRAME_HEIGHT (selected_frame) - curY), cmputc)
72 int no_redraw_on_reenter; 74 int no_redraw_on_reenter;
73 75
74 /* Hook functions that you can set to snap out the functions in this file. 76 /* Hook functions that you can set to snap out the functions in this file.
75 These are all extern'd in termhooks.h */ 77 These are all extern'd in termhooks.h */
76 78
77 int (*cursor_to_hook) (); 79 void (*cursor_to_hook) P_ ((int, int));
78 int (*raw_cursor_to_hook) (); 80 void (*raw_cursor_to_hook) P_ ((int, int));
79 81
80 int (*clear_to_end_hook) (); 82 void (*clear_to_end_hook) P_ ((void));
81 int (*clear_frame_hook) (); 83 void (*clear_frame_hook) P_ ((void));
82 int (*clear_end_of_line_hook) (); 84 void (*clear_end_of_line_hook) P_ ((int));
83 85
84 int (*ins_del_lines_hook) (); 86 void (*ins_del_lines_hook) P_ ((int, int));
85 87
86 int (*change_line_highlight_hook) (); 88 void (*change_line_highlight_hook) P_ ((int, int, int));
87 int (*reassert_line_highlight_hook) (); 89 void (*reassert_line_highlight_hook) P_ ((int, int));
88 90
89 int (*insert_glyphs_hook) (); 91 void (*insert_glyphs_hook) P_ ((GLYPH *, int));
90 int (*write_glyphs_hook) (); 92 void (*write_glyphs_hook) P_ ((GLYPH *, int));
91 int (*delete_glyphs_hook) (); 93 void (*delete_glyphs_hook) P_ ((int));
92 94
93 int (*ring_bell_hook) (); 95 void (*ring_bell_hook) P_ ((void));
94 96
95 int (*reset_terminal_modes_hook) (); 97 void (*reset_terminal_modes_hook) P_ ((void));
96 int (*set_terminal_modes_hook) (); 98 void (*set_terminal_modes_hook) P_ ((void));
97 int (*update_begin_hook) (); 99 void (*update_begin_hook) P_ ((struct frame *));
98 int (*update_end_hook) (); 100 void (*update_end_hook) P_ ((struct frame *));
99 int (*set_terminal_window_hook) (); 101 void (*set_terminal_window_hook) P_ ((int));
100 102
101 int (*read_socket_hook) (); 103 int (*read_socket_hook) P_ ((int, struct input_event *, int, int));
102 104
103 int (*frame_up_to_date_hook) (); 105 void (*frame_up_to_date_hook) P_ ((struct frame *));
104 106
105 /* Return the current position of the mouse. 107 /* Return the current position of the mouse.
106 108
107 Set *f to the frame the mouse is in, or zero if the mouse is in no 109 Set *f to the frame the mouse is in, or zero if the mouse is in no
108 Emacs frame. If it is set to zero, all the other arguments are 110 Emacs frame. If it is set to zero, all the other arguments are
118 120
119 Set *time to the time the mouse was at the returned position. 121 Set *time to the time the mouse was at the returned position.
120 122
121 This should clear mouse_moved until the next motion 123 This should clear mouse_moved until the next motion
122 event arrives. */ 124 event arrives. */
123 void (*mouse_position_hook) ( /* FRAME_PTR *f, int insist, 125 void (*mouse_position_hook) P_ ((FRAME_PTR *f, int insist,
124 Lisp_Object *bar_window, 126 Lisp_Object *bar_window,
125 enum scroll_bar_part *part, 127 enum scroll_bar_part *part,
126 Lisp_Object *x, 128 Lisp_Object *x,
127 Lisp_Object *y, 129 Lisp_Object *y,
128 unsigned long *time */ ); 130 unsigned long *time));
129 131
130 /* When reading from a minibuffer in a different frame, Emacs wants 132 /* When reading from a minibuffer in a different frame, Emacs wants
131 to shift the highlight from the selected frame to the minibuffer's 133 to shift the highlight from the selected frame to the minibuffer's
132 frame; under X, this means it lies about where the focus is. 134 frame; under X, this means it lies about where the focus is.
133 This hook tells the window system code to re-decide where to put 135 This hook tells the window system code to re-decide where to put
134 the highlight. */ 136 the highlight. */
135 void (*frame_rehighlight_hook) ( /* FRAME_PTR f */ ); 137 void (*frame_rehighlight_hook) P_ ((FRAME_PTR f));
136 138
137 /* If we're displaying frames using a window system that can stack 139 /* If we're displaying frames using a window system that can stack
138 frames on top of each other, this hook allows you to bring a frame 140 frames on top of each other, this hook allows you to bring a frame
139 to the front, or bury it behind all the other windows. If this 141 to the front, or bury it behind all the other windows. If this
140 hook is zero, that means the device we're displaying on doesn't 142 hook is zero, that means the device we're displaying on doesn't
142 anything. 144 anything.
143 145
144 If RAISE is non-zero, F is brought to the front, before all other 146 If RAISE is non-zero, F is brought to the front, before all other
145 windows. If RAISE is zero, F is sent to the back, behind all other 147 windows. If RAISE is zero, F is sent to the back, behind all other
146 windows. */ 148 windows. */
147 void (*frame_raise_lower_hook) ( /* FRAME_PTR f, int raise */ ); 149 void (*frame_raise_lower_hook) P_ ((FRAME_PTR f, int raise));
148 150
149 /* Set the vertical scroll bar for WINDOW to have its upper left corner 151 /* Set the vertical scroll bar for WINDOW to have its upper left corner
150 at (TOP, LEFT), and be LENGTH rows high. Set its handle to 152 at (TOP, LEFT), and be LENGTH rows high. Set its handle to
151 indicate that we are displaying PORTION characters out of a total 153 indicate that we are displaying PORTION characters out of a total
152 of WHOLE characters, starting at POSITION. If WINDOW doesn't yet 154 of WHOLE characters, starting at POSITION. If WINDOW doesn't yet
153 have a scroll bar, create one for it. */ 155 have a scroll bar, create one for it. */
154 void (*set_vertical_scroll_bar_hook) 156 void (*set_vertical_scroll_bar_hook)
155 ( /* struct window *window, 157 P_ ((struct window *window,
156 int portion, int whole, int position */ ); 158 int portion, int whole, int position));
157 159
158 160
159 /* The following three hooks are used when we're doing a thorough 161 /* The following three hooks are used when we're doing a thorough
160 redisplay of the frame. We don't explicitly know which scroll bars 162 redisplay of the frame. We don't explicitly know which scroll bars
161 are going to be deleted, because keeping track of when windows go 163 are going to be deleted, because keeping track of when windows go
174 this and the judge_scroll_bars_hook will get rid of them. 176 this and the judge_scroll_bars_hook will get rid of them.
175 177
176 If non-zero, this hook should be safe to apply to any frame, 178 If non-zero, this hook should be safe to apply to any frame,
177 whether or not it can support scroll bars, and whether or not it is 179 whether or not it can support scroll bars, and whether or not it is
178 currently displaying them. */ 180 currently displaying them. */
179 void (*condemn_scroll_bars_hook)( /* FRAME_PTR *frame */ ); 181 void (*condemn_scroll_bars_hook) P_ ((FRAME_PTR frame));
180 182
181 /* Unmark WINDOW's scroll bar for deletion in this judgement cycle. 183 /* Unmark WINDOW's scroll bar for deletion in this judgement cycle.
182 Note that it's okay to redeem a scroll bar that is not condemned. */ 184 Note that it's okay to redeem a scroll bar that is not condemned. */
183 void (*redeem_scroll_bar_hook)( /* struct window *window */ ); 185 void (*redeem_scroll_bar_hook) P_ ((struct window *window));
184 186
185 /* Remove all scroll bars on FRAME that haven't been saved since the 187 /* Remove all scroll bars on FRAME that haven't been saved since the
186 last call to `*condemn_scroll_bars_hook'. 188 last call to `*condemn_scroll_bars_hook'.
187 189
188 This should be applied to each frame after each time its window 190 This should be applied to each frame after each time its window
191 calling this and condemn_scroll_bars_hook will get rid of them. 193 calling this and condemn_scroll_bars_hook will get rid of them.
192 194
193 If non-zero, this hook should be safe to apply to any frame, 195 If non-zero, this hook should be safe to apply to any frame,
194 whether or not it can support scroll bars, and whether or not it is 196 whether or not it can support scroll bars, and whether or not it is
195 currently displaying them. */ 197 currently displaying them. */
196 void (*judge_scroll_bars_hook)( /* FRAME_PTR *FRAME */ ); 198 void (*judge_scroll_bars_hook) P_ ((FRAME_PTR FRAME));
197 199
198 200
199 /* Strings, numbers and flags taken from the termcap entry. */ 201 /* Strings, numbers and flags taken from the termcap entry. */
200 202
201 char *TS_end_italic_mode; /* termcap "ae" */ 203 char *TS_end_italic_mode; /* termcap "ae" */
317 319
318 #undef FRAME_TERMCAP_P 320 #undef FRAME_TERMCAP_P
319 #define FRAME_TERMCAP_P(_f_) 0 321 #define FRAME_TERMCAP_P(_f_) 0
320 #endif /* WINDOWSNT */ 322 #endif /* WINDOWSNT */
321 323
324 void
322 ring_bell () 325 ring_bell ()
323 { 326 {
324 if (! NILP (Vring_bell_function)) 327 if (! NILP (Vring_bell_function))
325 { 328 {
326 Lisp_Object function; 329 Lisp_Object function;
347 return; 350 return;
348 } 351 }
349 OUTPUT (TS_visible_bell && visible_bell ? TS_visible_bell : TS_bell); 352 OUTPUT (TS_visible_bell && visible_bell ? TS_visible_bell : TS_bell);
350 } 353 }
351 354
355 void
352 set_terminal_modes () 356 set_terminal_modes ()
353 { 357 {
354 if (! FRAME_TERMCAP_P (selected_frame)) 358 if (! FRAME_TERMCAP_P (selected_frame))
355 { 359 {
356 (*set_terminal_modes_hook) (); 360 (*set_terminal_modes_hook) ();
360 OUTPUT_IF (TS_visual_mode); 364 OUTPUT_IF (TS_visual_mode);
361 OUTPUT_IF (TS_keypad_mode); 365 OUTPUT_IF (TS_keypad_mode);
362 losecursor (); 366 losecursor ();
363 } 367 }
364 368
369 void
365 reset_terminal_modes () 370 reset_terminal_modes ()
366 { 371 {
367 if (! FRAME_TERMCAP_P (selected_frame)) 372 if (! FRAME_TERMCAP_P (selected_frame))
368 { 373 {
369 (*reset_terminal_modes_hook) (); 374 (*reset_terminal_modes_hook) ();
381 if (TN_standout_width >= 0) 386 if (TN_standout_width >= 0)
382 cmputc ('\n'); 387 cmputc ('\n');
383 cmputc ('\r'); 388 cmputc ('\r');
384 } 389 }
385 390
391 void
386 update_begin (f) 392 update_begin (f)
387 FRAME_PTR f; 393 FRAME_PTR f;
388 { 394 {
389 updating_frame = f; 395 updating_frame = f;
390 if (! FRAME_TERMCAP_P (updating_frame)) 396 if (! FRAME_TERMCAP_P (updating_frame))
391 (*update_begin_hook) (f); 397 (*update_begin_hook) (f);
392 } 398 }
393 399
400 void
394 update_end (f) 401 update_end (f)
395 FRAME_PTR f; 402 FRAME_PTR f;
396 { 403 {
397 if (! FRAME_TERMCAP_P (updating_frame)) 404 if (! FRAME_TERMCAP_P (updating_frame))
398 { 405 {
404 background_highlight (); 411 background_highlight ();
405 standout_requested = 0; 412 standout_requested = 0;
406 updating_frame = 0; 413 updating_frame = 0;
407 } 414 }
408 415
416 void
409 set_terminal_window (size) 417 set_terminal_window (size)
410 int size; 418 int size;
411 { 419 {
412 if (! FRAME_TERMCAP_P (updating_frame)) 420 if (! FRAME_TERMCAP_P (updating_frame))
413 { 421 {
418 if (!scroll_region_ok) 426 if (!scroll_region_ok)
419 return; 427 return;
420 set_scroll_region (0, specified_window); 428 set_scroll_region (0, specified_window);
421 } 429 }
422 430
431 void
423 set_scroll_region (start, stop) 432 set_scroll_region (start, stop)
424 int start, stop; 433 int start, stop;
425 { 434 {
426 char *buf; 435 char *buf;
427 if (TS_set_scroll_region) 436 if (TS_set_scroll_region)
442 OUTPUT (buf); 451 OUTPUT (buf);
443 xfree (buf); 452 xfree (buf);
444 losecursor (); 453 losecursor ();
445 } 454 }
446 455
456 void
447 turn_on_insert () 457 turn_on_insert ()
448 { 458 {
449 if (!insert_mode) 459 if (!insert_mode)
450 OUTPUT (TS_insert_mode); 460 OUTPUT (TS_insert_mode);
451 insert_mode = 1; 461 insert_mode = 1;
452 } 462 }
453 463
464 void
454 turn_off_insert () 465 turn_off_insert ()
455 { 466 {
456 if (insert_mode) 467 if (insert_mode)
457 OUTPUT (TS_end_insert_mode); 468 OUTPUT (TS_end_insert_mode);
458 insert_mode = 0; 469 insert_mode = 0;
463 mode when the output is written. 474 mode when the output is written.
464 475
465 These functions are called on all terminals, but do nothing 476 These functions are called on all terminals, but do nothing
466 on terminals whose standout mode does not work that way. */ 477 on terminals whose standout mode does not work that way. */
467 478
479 void
468 turn_off_highlight () 480 turn_off_highlight ()
469 { 481 {
470 if (TN_standout_width < 0) 482 if (TN_standout_width < 0)
471 { 483 {
472 if (standout_mode) 484 if (standout_mode)
473 OUTPUT_IF (TS_end_standout_mode); 485 OUTPUT_IF (TS_end_standout_mode);
474 standout_mode = 0; 486 standout_mode = 0;
475 } 487 }
476 } 488 }
477 489
490 void
478 turn_on_highlight () 491 turn_on_highlight ()
479 { 492 {
480 if (TN_standout_width < 0) 493 if (TN_standout_width < 0)
481 { 494 {
482 if (!standout_mode) 495 if (!standout_mode)
487 500
488 /* Set standout mode to the state it should be in for 501 /* Set standout mode to the state it should be in for
489 empty space inside windows. What this is, 502 empty space inside windows. What this is,
490 depends on the user option inverse-video. */ 503 depends on the user option inverse-video. */
491 504
505 void
492 background_highlight () 506 background_highlight ()
493 { 507 {
494 if (TN_standout_width >= 0) 508 if (TN_standout_width >= 0)
495 return; 509 return;
496 if (inverse_video) 510 if (inverse_video)
499 turn_off_highlight (); 513 turn_off_highlight ();
500 } 514 }
501 515
502 /* Set standout mode to the mode specified for the text to be output. */ 516 /* Set standout mode to the mode specified for the text to be output. */
503 517
504 static 518 static void
505 highlight_if_desired () 519 highlight_if_desired ()
506 { 520 {
507 if (TN_standout_width >= 0) 521 if (TN_standout_width >= 0)
508 return; 522 return;
509 if (!inverse_video == !standout_requested) 523 if (!inverse_video == !standout_requested)
521 on other terminals. */ 535 on other terminals. */
522 536
523 /* Write a standout marker or end-standout marker at the front of the line 537 /* Write a standout marker or end-standout marker at the front of the line
524 at vertical position vpos. */ 538 at vertical position vpos. */
525 539
540 void
526 write_standout_marker (flag, vpos) 541 write_standout_marker (flag, vpos)
527 int flag, vpos; 542 int flag, vpos;
528 { 543 {
529 if (flag || (TS_end_standout_mode && !TF_teleray && !se_is_so 544 if (flag || (TS_end_standout_mode && !TF_teleray && !se_is_so
530 && !(TF_xs && TN_standout_width == 0))) 545 && !(TF_xs && TN_standout_width == 0)))
538 553
539 /* External interface to control of standout mode. 554 /* External interface to control of standout mode.
540 Call this when about to modify line at position VPOS 555 Call this when about to modify line at position VPOS
541 and not change whether it is highlighted. */ 556 and not change whether it is highlighted. */
542 557
558 void
543 reassert_line_highlight (highlight, vpos) 559 reassert_line_highlight (highlight, vpos)
544 int highlight; 560 int highlight;
545 int vpos; 561 int vpos;
546 { 562 {
547 if (! FRAME_TERMCAP_P ((updating_frame ? updating_frame : selected_frame))) 563 if (! FRAME_TERMCAP_P ((updating_frame ? updating_frame : selected_frame)))
559 } 575 }
560 576
561 /* Call this when about to modify line at position VPOS 577 /* Call this when about to modify line at position VPOS
562 and change whether it is highlighted. */ 578 and change whether it is highlighted. */
563 579
580 void
564 change_line_highlight (new_highlight, vpos, first_unused_hpos) 581 change_line_highlight (new_highlight, vpos, first_unused_hpos)
565 int new_highlight, vpos, first_unused_hpos; 582 int new_highlight, vpos, first_unused_hpos;
566 { 583 {
567 standout_requested = new_highlight; 584 standout_requested = new_highlight;
568 if (! FRAME_TERMCAP_P (updating_frame)) 585 if (! FRAME_TERMCAP_P (updating_frame))
595 } 612 }
596 613
597 614
598 /* Move to absolute position, specified origin 0 */ 615 /* Move to absolute position, specified origin 0 */
599 616
617 void
600 cursor_to (row, col) 618 cursor_to (row, col)
601 int row, col; 619 int row, col;
602 { 620 {
603 if (! FRAME_TERMCAP_P ((updating_frame 621 if (! FRAME_TERMCAP_P ((updating_frame
604 ? updating_frame 622 ? updating_frame
624 cmgoto (row, col); 642 cmgoto (row, col);
625 } 643 }
626 644
627 /* Similar but don't take any account of the wasted characters. */ 645 /* Similar but don't take any account of the wasted characters. */
628 646
647 void
629 raw_cursor_to (row, col) 648 raw_cursor_to (row, col)
630 int row, col; 649 int row, col;
631 { 650 {
632 if (! FRAME_TERMCAP_P ((updating_frame ? updating_frame : selected_frame))) 651 if (! FRAME_TERMCAP_P ((updating_frame ? updating_frame : selected_frame)))
633 { 652 {
644 } 663 }
645 664
646 /* Erase operations */ 665 /* Erase operations */
647 666
648 /* clear from cursor to end of frame */ 667 /* clear from cursor to end of frame */
668 void
649 clear_to_end () 669 clear_to_end ()
650 { 670 {
651 register int i; 671 register int i;
652 672
653 if (clear_to_end_hook && ! FRAME_TERMCAP_P (updating_frame)) 673 if (clear_to_end_hook && ! FRAME_TERMCAP_P (updating_frame))
671 } 691 }
672 } 692 }
673 693
674 /* Clear entire frame */ 694 /* Clear entire frame */
675 695
696 void
676 clear_frame () 697 clear_frame ()
677 { 698 {
678 if (clear_frame_hook 699 if (clear_frame_hook
679 && ! FRAME_TERMCAP_P ((updating_frame ? updating_frame : selected_frame))) 700 && ! FRAME_TERMCAP_P ((updating_frame ? updating_frame : selected_frame)))
680 { 701 {
700 which implies it cannot be before a standout marker 721 which implies it cannot be before a standout marker
701 unless the marker has zero width. 722 unless the marker has zero width.
702 723
703 Note that the cursor may be moved. */ 724 Note that the cursor may be moved. */
704 725
726 void
705 clear_end_of_line (first_unused_hpos) 727 clear_end_of_line (first_unused_hpos)
706 int first_unused_hpos; 728 int first_unused_hpos;
707 { 729 {
708 static GLYPH buf = SPACEGLYPH; 730 static GLYPH buf = SPACEGLYPH;
709 if (FRAME_TERMCAP_P (selected_frame) 731 if (FRAME_TERMCAP_P (selected_frame)
717 Assume that the line is already clear starting at column first_unused_hpos. 739 Assume that the line is already clear starting at column first_unused_hpos.
718 If the cursor is at a standout marker, erase the marker. 740 If the cursor is at a standout marker, erase the marker.
719 741
720 Note that the cursor may be moved, on terminals lacking a `ce' string. */ 742 Note that the cursor may be moved, on terminals lacking a `ce' string. */
721 743
744 void
722 clear_end_of_line_raw (first_unused_hpos) 745 clear_end_of_line_raw (first_unused_hpos)
723 int first_unused_hpos; 746 int first_unused_hpos;
724 { 747 {
725 register int i; 748 register int i;
726 749
847 *consumed = src - src_start; 870 *consumed = src - src_start;
848 return (dst - dst_start); 871 return (dst - dst_start);
849 } 872 }
850 873
851 874
875 void
852 write_glyphs (string, len) 876 write_glyphs (string, len)
853 register GLYPH *string; 877 register GLYPH *string;
854 register int len; 878 register int len;
855 { 879 {
856 register GLYPH g; 880 register GLYPH g;
920 cmcheckmagic (); 944 cmcheckmagic ();
921 } 945 }
922 946
923 /* If start is zero, insert blanks instead of a string at start */ 947 /* If start is zero, insert blanks instead of a string at start */
924 948
949 void
925 insert_glyphs (start, len) 950 insert_glyphs (start, len)
926 register GLYPH *start; 951 register GLYPH *start;
927 register int len; 952 register int len;
928 { 953 {
929 char *buf; 954 char *buf;
994 OUTPUT1_IF (TS_pad_inserted_char); 1019 OUTPUT1_IF (TS_pad_inserted_char);
995 } 1020 }
996 cmcheckmagic (); 1021 cmcheckmagic ();
997 } 1022 }
998 1023
1024 void
999 delete_glyphs (n) 1025 delete_glyphs (n)
1000 register int n; 1026 register int n;
1001 { 1027 {
1002 char *buf; 1028 char *buf;
1003 register int i; 1029 register int i;
1031 OUTPUT_IF (TS_end_delete_mode); 1057 OUTPUT_IF (TS_end_delete_mode);
1032 } 1058 }
1033 1059
1034 /* Insert N lines at vpos VPOS. If N is negative, delete -N lines. */ 1060 /* Insert N lines at vpos VPOS. If N is negative, delete -N lines. */
1035 1061
1062 void
1036 ins_del_lines (vpos, n) 1063 ins_del_lines (vpos, n)
1037 int vpos, n; 1064 int vpos, n;
1038 { 1065 {
1039 char *multi = n > 0 ? TS_ins_multi_lines : TS_del_multi_lines; 1066 char *multi = n > 0 ? TS_ins_multi_lines : TS_del_multi_lines;
1040 char *single = n > 0 ? TS_ins_line : TS_del_line; 1067 char *single = n > 0 ? TS_ins_line : TS_del_line;
1091 set_scroll_region (0, specified_window); 1118 set_scroll_region (0, specified_window);
1092 } 1119 }
1093 1120
1094 if (TN_standout_width >= 0) 1121 if (TN_standout_width >= 0)
1095 { 1122 {
1096 register lower_limit 1123 register int lower_limit
1097 = (scroll_region_ok 1124 = (scroll_region_ok
1098 ? specified_window 1125 ? specified_window
1099 : FRAME_HEIGHT (selected_frame)); 1126 : FRAME_HEIGHT (selected_frame));
1100 1127
1101 if (n < 0) 1128 if (n < 0)
1231 /* Insert costs are at positive offsets */ 1258 /* Insert costs are at positive offsets */
1232 for (i = FRAME_WIDTH (frame); --i >= 0;) 1259 for (i = FRAME_WIDTH (frame); --i >= 0;)
1233 *p++ = (ins_startup_cost += ins_cost_per_char); 1260 *p++ = (ins_startup_cost += ins_cost_per_char);
1234 } 1261 }
1235 1262
1236 extern do_line_insertion_deletion_costs (); 1263 void
1237
1238 calculate_costs (frame) 1264 calculate_costs (frame)
1239 FRAME_PTR frame; 1265 FRAME_PTR frame;
1240 { 1266 {
1241 register char *f = (TS_set_scroll_region 1267 register char *f = (TS_set_scroll_region
1242 ? TS_set_scroll_region 1268 ? TS_set_scroll_region
1532 #undef CONDITIONAL_REASSIGN 1558 #undef CONDITIONAL_REASSIGN
1533 } 1559 }
1534 } 1560 }
1535 1561
1536 1562
1563 void
1537 term_init (terminal_type) 1564 term_init (terminal_type)
1538 char *terminal_type; 1565 char *terminal_type;
1539 { 1566 {
1540 char *area; 1567 char *area;
1541 char **address = &area; 1568 char **address = &area;
1902 FRAME_CAN_HAVE_SCROLL_BARS (selected_frame) = 0; 1929 FRAME_CAN_HAVE_SCROLL_BARS (selected_frame) = 0;
1903 FRAME_VERTICAL_SCROLL_BAR_TYPE (selected_frame) = vertical_scroll_bar_none; 1930 FRAME_VERTICAL_SCROLL_BAR_TYPE (selected_frame) = vertical_scroll_bar_none;
1904 } 1931 }
1905 1932
1906 /* VARARGS 1 */ 1933 /* VARARGS 1 */
1934 void
1907 fatal (str, arg1, arg2) 1935 fatal (str, arg1, arg2)
1908 char *str, *arg1, *arg2; 1936 char *str, *arg1, *arg2;
1909 { 1937 {
1910 fprintf (stderr, "emacs: "); 1938 fprintf (stderr, "emacs: ");
1911 fprintf (stderr, str, arg1, arg2); 1939 fprintf (stderr, str, arg1, arg2);
1912 fprintf (stderr, "\n"); 1940 fprintf (stderr, "\n");
1913 fflush (stderr); 1941 fflush (stderr);
1914 exit (1); 1942 exit (1);
1915 } 1943 }
1916 1944
1945 void
1917 syms_of_term () 1946 syms_of_term ()
1918 { 1947 {
1919 DEFVAR_BOOL ("system-uses-terminfo", &system_uses_terminfo, 1948 DEFVAR_BOOL ("system-uses-terminfo", &system_uses_terminfo,
1920 "Non-nil means the system uses terminfo rather than termcap.\n\ 1949 "Non-nil means the system uses terminfo rather than termcap.\n\
1921 This variable can be used by terminal emulator packages."); 1950 This variable can be used by terminal emulator packages.");