aboutsummaryrefslogtreecommitdiffstats
path: root/src/term.c
diff options
context:
space:
mode:
authorAndreas Schwab1998-04-14 12:25:56 +0000
committerAndreas Schwab1998-04-14 12:25:56 +0000
commitdfcf069d565c347abf3cb7cec80e6ed8432037ba (patch)
treecd9620f10084ffa69d7d6ae26284ffd69d4c07a5 /src/term.c
parent0f94f94657ad7a6a68e64c612285a5e06152def2 (diff)
downloademacs-dfcf069d565c347abf3cb7cec80e6ed8432037ba.tar.gz
emacs-dfcf069d565c347abf3cb7cec80e6ed8432037ba.zip
Fix -Wimplicit warnings.
Diffstat (limited to 'src/term.c')
-rw-r--r--src/term.c97
1 files changed, 63 insertions, 34 deletions
diff --git a/src/term.c b/src/term.c
index 64f78cc7b02..39aba03da9f 100644
--- a/src/term.c
+++ b/src/term.c
@@ -33,8 +33,10 @@ Boston, MA 02111-1307, USA. */
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"
37extern 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))
@@ -74,33 +76,33 @@ int no_redraw_on_reenter;
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
77int (*cursor_to_hook) (); 79void (*cursor_to_hook) P_ ((int, int));
78int (*raw_cursor_to_hook) (); 80void (*raw_cursor_to_hook) P_ ((int, int));
79 81
80int (*clear_to_end_hook) (); 82void (*clear_to_end_hook) P_ ((void));
81int (*clear_frame_hook) (); 83void (*clear_frame_hook) P_ ((void));
82int (*clear_end_of_line_hook) (); 84void (*clear_end_of_line_hook) P_ ((int));
83 85
84int (*ins_del_lines_hook) (); 86void (*ins_del_lines_hook) P_ ((int, int));
85 87
86int (*change_line_highlight_hook) (); 88void (*change_line_highlight_hook) P_ ((int, int, int));
87int (*reassert_line_highlight_hook) (); 89void (*reassert_line_highlight_hook) P_ ((int, int));
88 90
89int (*insert_glyphs_hook) (); 91void (*insert_glyphs_hook) P_ ((GLYPH *, int));
90int (*write_glyphs_hook) (); 92void (*write_glyphs_hook) P_ ((GLYPH *, int));
91int (*delete_glyphs_hook) (); 93void (*delete_glyphs_hook) P_ ((int));
92 94
93int (*ring_bell_hook) (); 95void (*ring_bell_hook) P_ ((void));
94 96
95int (*reset_terminal_modes_hook) (); 97void (*reset_terminal_modes_hook) P_ ((void));
96int (*set_terminal_modes_hook) (); 98void (*set_terminal_modes_hook) P_ ((void));
97int (*update_begin_hook) (); 99void (*update_begin_hook) P_ ((struct frame *));
98int (*update_end_hook) (); 100void (*update_end_hook) P_ ((struct frame *));
99int (*set_terminal_window_hook) (); 101void (*set_terminal_window_hook) P_ ((int));
100 102
101int (*read_socket_hook) (); 103int (*read_socket_hook) P_ ((int, struct input_event *, int, int));
102 104
103int (*frame_up_to_date_hook) (); 105void (*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
@@ -120,19 +122,19 @@ int (*frame_up_to_date_hook) ();
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. */
123void (*mouse_position_hook) ( /* FRAME_PTR *f, int insist, 125void (*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. */
135void (*frame_rehighlight_hook) ( /* FRAME_PTR f */ ); 137void (*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
@@ -144,7 +146,7 @@ void (*frame_rehighlight_hook) ( /* FRAME_PTR f */ );
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. */
147void (*frame_raise_lower_hook) ( /* FRAME_PTR f, int raise */ ); 149void (*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
@@ -152,8 +154,8 @@ void (*frame_raise_lower_hook) ( /* FRAME_PTR f, int raise */ );
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. */
154void (*set_vertical_scroll_bar_hook) 156void (*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
@@ -176,11 +178,11 @@ void (*set_vertical_scroll_bar_hook)
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. */
179void (*condemn_scroll_bars_hook)( /* FRAME_PTR *frame */ ); 181void (*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. */
183void (*redeem_scroll_bar_hook)( /* struct window *window */ ); 185void (*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'.
@@ -193,7 +195,7 @@ void (*redeem_scroll_bar_hook)( /* struct window *window */ );
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. */
196void (*judge_scroll_bars_hook)( /* FRAME_PTR *FRAME */ ); 198void (*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. */
@@ -319,6 +321,7 @@ extern char *tgetstr ();
319#define FRAME_TERMCAP_P(_f_) 0 321#define FRAME_TERMCAP_P(_f_) 0
320#endif /* WINDOWSNT */ 322#endif /* WINDOWSNT */
321 323
324void
322ring_bell () 325ring_bell ()
323{ 326{
324 if (! NILP (Vring_bell_function)) 327 if (! NILP (Vring_bell_function))
@@ -349,6 +352,7 @@ ring_bell ()
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
355void
352set_terminal_modes () 356set_terminal_modes ()
353{ 357{
354 if (! FRAME_TERMCAP_P (selected_frame)) 358 if (! FRAME_TERMCAP_P (selected_frame))
@@ -362,6 +366,7 @@ set_terminal_modes ()
362 losecursor (); 366 losecursor ();
363} 367}
364 368
369void
365reset_terminal_modes () 370reset_terminal_modes ()
366{ 371{
367 if (! FRAME_TERMCAP_P (selected_frame)) 372 if (! FRAME_TERMCAP_P (selected_frame))
@@ -383,6 +388,7 @@ reset_terminal_modes ()
383 cmputc ('\r'); 388 cmputc ('\r');
384} 389}
385 390
391void
386update_begin (f) 392update_begin (f)
387 FRAME_PTR f; 393 FRAME_PTR f;
388{ 394{
@@ -391,6 +397,7 @@ update_begin (f)
391 (*update_begin_hook) (f); 397 (*update_begin_hook) (f);
392} 398}
393 399
400void
394update_end (f) 401update_end (f)
395 FRAME_PTR f; 402 FRAME_PTR f;
396{ 403{
@@ -406,6 +413,7 @@ update_end (f)
406 updating_frame = 0; 413 updating_frame = 0;
407} 414}
408 415
416void
409set_terminal_window (size) 417set_terminal_window (size)
410 int size; 418 int size;
411{ 419{
@@ -420,6 +428,7 @@ set_terminal_window (size)
420 set_scroll_region (0, specified_window); 428 set_scroll_region (0, specified_window);
421} 429}
422 430
431void
423set_scroll_region (start, stop) 432set_scroll_region (start, stop)
424 int start, stop; 433 int start, stop;
425{ 434{
@@ -444,6 +453,7 @@ set_scroll_region (start, stop)
444 losecursor (); 453 losecursor ();
445} 454}
446 455
456void
447turn_on_insert () 457turn_on_insert ()
448{ 458{
449 if (!insert_mode) 459 if (!insert_mode)
@@ -451,6 +461,7 @@ turn_on_insert ()
451 insert_mode = 1; 461 insert_mode = 1;
452} 462}
453 463
464void
454turn_off_insert () 465turn_off_insert ()
455{ 466{
456 if (insert_mode) 467 if (insert_mode)
@@ -465,6 +476,7 @@ turn_off_insert ()
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
479void
468turn_off_highlight () 480turn_off_highlight ()
469{ 481{
470 if (TN_standout_width < 0) 482 if (TN_standout_width < 0)
@@ -475,6 +487,7 @@ turn_off_highlight ()
475 } 487 }
476} 488}
477 489
490void
478turn_on_highlight () 491turn_on_highlight ()
479{ 492{
480 if (TN_standout_width < 0) 493 if (TN_standout_width < 0)
@@ -489,6 +502,7 @@ turn_on_highlight ()
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
505void
492background_highlight () 506background_highlight ()
493{ 507{
494 if (TN_standout_width >= 0) 508 if (TN_standout_width >= 0)
@@ -501,7 +515,7 @@ background_highlight ()
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
504static 518static void
505highlight_if_desired () 519highlight_if_desired ()
506{ 520{
507 if (TN_standout_width >= 0) 521 if (TN_standout_width >= 0)
@@ -523,6 +537,7 @@ highlight_if_desired ()
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
540void
526write_standout_marker (flag, vpos) 541write_standout_marker (flag, vpos)
527 int flag, vpos; 542 int flag, vpos;
528{ 543{
@@ -540,6 +555,7 @@ write_standout_marker (flag, vpos)
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
558void
543reassert_line_highlight (highlight, vpos) 559reassert_line_highlight (highlight, vpos)
544 int highlight; 560 int highlight;
545 int vpos; 561 int vpos;
@@ -561,6 +577,7 @@ reassert_line_highlight (highlight, vpos)
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
580void
564change_line_highlight (new_highlight, vpos, first_unused_hpos) 581change_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{
@@ -597,6 +614,7 @@ change_line_highlight (new_highlight, vpos, first_unused_hpos)
597 614
598/* Move to absolute position, specified origin 0 */ 615/* Move to absolute position, specified origin 0 */
599 616
617void
600cursor_to (row, col) 618cursor_to (row, col)
601 int row, col; 619 int row, col;
602{ 620{
@@ -626,6 +644,7 @@ cursor_to (row, col)
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
647void
629raw_cursor_to (row, col) 648raw_cursor_to (row, col)
630 int row, col; 649 int row, col;
631{ 650{
@@ -646,6 +665,7 @@ raw_cursor_to (row, col)
646/* Erase operations */ 665/* Erase operations */
647 666
648/* clear from cursor to end of frame */ 667/* clear from cursor to end of frame */
668void
649clear_to_end () 669clear_to_end ()
650{ 670{
651 register int i; 671 register int i;
@@ -673,6 +693,7 @@ clear_to_end ()
673 693
674/* Clear entire frame */ 694/* Clear entire frame */
675 695
696void
676clear_frame () 697clear_frame ()
677{ 698{
678 if (clear_frame_hook 699 if (clear_frame_hook
@@ -702,6 +723,7 @@ clear_frame ()
702 723
703 Note that the cursor may be moved. */ 724 Note that the cursor may be moved. */
704 725
726void
705clear_end_of_line (first_unused_hpos) 727clear_end_of_line (first_unused_hpos)
706 int first_unused_hpos; 728 int first_unused_hpos;
707{ 729{
@@ -719,6 +741,7 @@ clear_end_of_line (first_unused_hpos)
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
744void
722clear_end_of_line_raw (first_unused_hpos) 745clear_end_of_line_raw (first_unused_hpos)
723 int first_unused_hpos; 746 int first_unused_hpos;
724{ 747{
@@ -849,6 +872,7 @@ encode_terminal_code (src, dst, src_len, dst_len, consumed)
849} 872}
850 873
851 874
875void
852write_glyphs (string, len) 876write_glyphs (string, len)
853 register GLYPH *string; 877 register GLYPH *string;
854 register int len; 878 register int len;
@@ -922,6 +946,7 @@ write_glyphs (string, len)
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
949void
925insert_glyphs (start, len) 950insert_glyphs (start, len)
926 register GLYPH *start; 951 register GLYPH *start;
927 register int len; 952 register int len;
@@ -996,6 +1021,7 @@ insert_glyphs (start, len)
996 cmcheckmagic (); 1021 cmcheckmagic ();
997} 1022}
998 1023
1024void
999delete_glyphs (n) 1025delete_glyphs (n)
1000 register int n; 1026 register int n;
1001{ 1027{
@@ -1033,6 +1059,7 @@ delete_glyphs (n)
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
1062void
1036ins_del_lines (vpos, n) 1063ins_del_lines (vpos, n)
1037 int vpos, n; 1064 int vpos, n;
1038{ 1065{
@@ -1093,7 +1120,7 @@ ins_del_lines (vpos, n)
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));
@@ -1233,8 +1260,7 @@ calculate_ins_del_char_costs (frame)
1233 *p++ = (ins_startup_cost += ins_cost_per_char); 1260 *p++ = (ins_startup_cost += ins_cost_per_char);
1234} 1261}
1235 1262
1236extern do_line_insertion_deletion_costs (); 1263void
1237
1238calculate_costs (frame) 1264calculate_costs (frame)
1239 FRAME_PTR frame; 1265 FRAME_PTR frame;
1240{ 1266{
@@ -1534,6 +1560,7 @@ term_get_fkeys_1 ()
1534} 1560}
1535 1561
1536 1562
1563void
1537term_init (terminal_type) 1564term_init (terminal_type)
1538 char *terminal_type; 1565 char *terminal_type;
1539{ 1566{
@@ -1904,6 +1931,7 @@ to do `unset TERMCAP' (C-shell: `unsetenv TERMCAP') as well.",
1904} 1931}
1905 1932
1906/* VARARGS 1 */ 1933/* VARARGS 1 */
1934void
1907fatal (str, arg1, arg2) 1935fatal (str, arg1, arg2)
1908 char *str, *arg1, *arg2; 1936 char *str, *arg1, *arg2;
1909{ 1937{
@@ -1914,6 +1942,7 @@ fatal (str, arg1, arg2)
1914 exit (1); 1942 exit (1);
1915} 1943}
1916 1944
1945void
1917syms_of_term () 1946syms_of_term ()
1918{ 1947{
1919 DEFVAR_BOOL ("system-uses-terminfo", &system_uses_terminfo, 1948 DEFVAR_BOOL ("system-uses-terminfo", &system_uses_terminfo,