aboutsummaryrefslogtreecommitdiffstats
path: root/src/keyboard.c
diff options
context:
space:
mode:
authorJuanma Barranquero2010-07-05 12:36:06 +0200
committerJuanma Barranquero2010-07-05 12:36:06 +0200
commitd3da34e0dab1404e80dba5413b3c449a6ea8fa0c (patch)
treec24d736f75b63d4abb1b8ddd49b088632ccd8aee /src/keyboard.c
parent00be444c737e95c7455aa1808d9da75d4affd51f (diff)
downloademacs-d3da34e0dab1404e80dba5413b3c449a6ea8fa0c.tar.gz
emacs-d3da34e0dab1404e80dba5413b3c449a6ea8fa0c.zip
Convert most remaining function definitions to standard C.
* buffer.c, cm.c, eval.c, keyboard.c, process.c, term.c, vm-limit.c, * xdisp.c: Convert function definitions to standard C. * cm.c (cmputc): Arg C is now int, not char. * process.c (Fmake_network_process): Cast sockaddr_in* to sockaddr*.
Diffstat (limited to 'src/keyboard.c')
-rw-r--r--src/keyboard.c427
1 files changed, 154 insertions, 273 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index d7e01af0bc4..069ff4993d9 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -521,17 +521,17 @@ extern Lisp_Object Qleft_margin, Qright_margin;
521extern Lisp_Object Qleft_fringe, Qright_fringe; 521extern Lisp_Object Qleft_fringe, Qright_fringe;
522extern Lisp_Object QCmap; 522extern Lisp_Object QCmap;
523 523
524Lisp_Object recursive_edit_unwind (), command_loop (); 524Lisp_Object recursive_edit_unwind (Lisp_Object buffer), command_loop (void);
525Lisp_Object Fthis_command_keys (); 525Lisp_Object Fthis_command_keys (void);
526Lisp_Object Qextended_command_history; 526Lisp_Object Qextended_command_history;
527EMACS_TIME timer_check (); 527EMACS_TIME timer_check (int do_it_now);
528 528
529extern Lisp_Object Vhistory_length, Vtranslation_table_for_input; 529extern Lisp_Object Vhistory_length, Vtranslation_table_for_input;
530 530
531extern char *x_get_keysym_name (); 531extern char *x_get_keysym_name ();
532 532
533static void record_menu_key (); 533static void record_menu_key (Lisp_Object c);
534static int echo_length (); 534static int echo_length (void);
535 535
536Lisp_Object Qpolling_period; 536Lisp_Object Qpolling_period;
537 537
@@ -618,7 +618,6 @@ static void get_input_pending (int *, int);
618static int readable_events (int); 618static int readable_events (int);
619static Lisp_Object read_char_x_menu_prompt (int, Lisp_Object *, 619static Lisp_Object read_char_x_menu_prompt (int, Lisp_Object *,
620 Lisp_Object, int *); 620 Lisp_Object, int *);
621static Lisp_Object read_char_x_menu_prompt ();
622static Lisp_Object read_char_minibuf_menu_prompt (int, int, 621static Lisp_Object read_char_minibuf_menu_prompt (int, int,
623 Lisp_Object *); 622 Lisp_Object *);
624static Lisp_Object make_lispy_event (struct input_event *); 623static Lisp_Object make_lispy_event (struct input_event *);
@@ -633,7 +632,6 @@ static Lisp_Object modify_event_symbol (int, unsigned, Lisp_Object,
633 Lisp_Object *, unsigned); 632 Lisp_Object *, unsigned);
634static Lisp_Object make_lispy_switch_frame (Lisp_Object); 633static Lisp_Object make_lispy_switch_frame (Lisp_Object);
635static void save_getcjmp (jmp_buf); 634static void save_getcjmp (jmp_buf);
636static void save_getcjmp ();
637static void restore_getcjmp (jmp_buf); 635static void restore_getcjmp (jmp_buf);
638static Lisp_Object apply_modifiers (int, Lisp_Object); 636static Lisp_Object apply_modifiers (int, Lisp_Object);
639static void clear_event (struct input_event *); 637static void clear_event (struct input_event *);
@@ -658,8 +656,7 @@ extern Lisp_Object Qidentity, Qonly;
658 Also start echoing. */ 656 Also start echoing. */
659 657
660void 658void
661echo_prompt (str) 659echo_prompt (Lisp_Object str)
662 Lisp_Object str;
663{ 660{
664 current_kboard->echo_string = str; 661 current_kboard->echo_string = str;
665 current_kboard->echo_after_prompt = SCHARS (str); 662 current_kboard->echo_after_prompt = SCHARS (str);
@@ -671,8 +668,7 @@ echo_prompt (str)
671 jazz), or a symbol, whose name is printed. */ 668 jazz), or a symbol, whose name is printed. */
672 669
673void 670void
674echo_char (c) 671echo_char (Lisp_Object c)
675 Lisp_Object c;
676{ 672{
677 if (current_kboard->immediate_echo) 673 if (current_kboard->immediate_echo)
678 { 674 {
@@ -759,7 +755,7 @@ echo_char (c)
759 empty, so that it serves as a mini-prompt for the very next character. */ 755 empty, so that it serves as a mini-prompt for the very next character. */
760 756
761void 757void
762echo_dash () 758echo_dash (void)
763{ 759{
764 /* Do nothing if not echoing at all. */ 760 /* Do nothing if not echoing at all. */
765 if (NILP (current_kboard->echo_string)) 761 if (NILP (current_kboard->echo_string))
@@ -800,7 +796,7 @@ echo_dash ()
800 doing so. */ 796 doing so. */
801 797
802void 798void
803echo_now () 799echo_now (void)
804{ 800{
805 if (!current_kboard->immediate_echo) 801 if (!current_kboard->immediate_echo)
806 { 802 {
@@ -850,7 +846,7 @@ echo_now ()
850/* Turn off echoing, for the start of a new command. */ 846/* Turn off echoing, for the start of a new command. */
851 847
852void 848void
853cancel_echoing () 849cancel_echoing (void)
854{ 850{
855 current_kboard->immediate_echo = 0; 851 current_kboard->immediate_echo = 0;
856 current_kboard->echo_after_prompt = -1; 852 current_kboard->echo_after_prompt = -1;
@@ -863,7 +859,7 @@ cancel_echoing ()
863/* Return the length of the current echo string. */ 859/* Return the length of the current echo string. */
864 860
865static int 861static int
866echo_length () 862echo_length (void)
867{ 863{
868 return (STRINGP (current_kboard->echo_string) 864 return (STRINGP (current_kboard->echo_string)
869 ? SCHARS (current_kboard->echo_string) 865 ? SCHARS (current_kboard->echo_string)
@@ -875,8 +871,7 @@ echo_length ()
875 switches frames while entering a key sequence. */ 871 switches frames while entering a key sequence. */
876 872
877static void 873static void
878echo_truncate (nchars) 874echo_truncate (int nchars)
879 int nchars;
880{ 875{
881 if (STRINGP (current_kboard->echo_string)) 876 if (STRINGP (current_kboard->echo_string))
882 current_kboard->echo_string 877 current_kboard->echo_string
@@ -888,8 +883,7 @@ echo_truncate (nchars)
888 883
889/* Functions for manipulating this_command_keys. */ 884/* Functions for manipulating this_command_keys. */
890static void 885static void
891add_command_key (key) 886add_command_key (Lisp_Object key)
892 Lisp_Object key;
893{ 887{
894#if 0 /* Not needed after we made Freset_this_command_lengths 888#if 0 /* Not needed after we made Freset_this_command_lengths
895 do the job immediately. */ 889 do the job immediately. */
@@ -916,7 +910,7 @@ add_command_key (key)
916 910
917 911
918Lisp_Object 912Lisp_Object
919recursive_edit_1 () 913recursive_edit_1 (void)
920{ 914{
921 int count = SPECPDL_INDEX (); 915 int count = SPECPDL_INDEX ();
922 Lisp_Object val; 916 Lisp_Object val;
@@ -961,7 +955,7 @@ recursive_edit_1 ()
961/* When an auto-save happens, record the "time", and don't do again soon. */ 955/* When an auto-save happens, record the "time", and don't do again soon. */
962 956
963void 957void
964record_auto_save () 958record_auto_save (void)
965{ 959{
966 last_auto_save = num_nonmacro_input_events; 960 last_auto_save = num_nonmacro_input_events;
967} 961}
@@ -969,7 +963,7 @@ record_auto_save ()
969/* Make an auto save happen as soon as possible at command level. */ 963/* Make an auto save happen as soon as possible at command level. */
970 964
971void 965void
972force_auto_save_soon () 966force_auto_save_soon (void)
973{ 967{
974 last_auto_save = - auto_save_interval - 1; 968 last_auto_save = - auto_save_interval - 1;
975 969
@@ -1014,8 +1008,7 @@ This function is called by the editor initialization to begin editing. */)
1014} 1008}
1015 1009
1016Lisp_Object 1010Lisp_Object
1017recursive_edit_unwind (buffer) 1011recursive_edit_unwind (Lisp_Object buffer)
1018 Lisp_Object buffer;
1019{ 1012{
1020 if (BUFFERP (buffer)) 1013 if (BUFFERP (buffer))
1021 Fset_buffer (buffer); 1014 Fset_buffer (buffer);
@@ -1060,8 +1053,7 @@ single_kboard_state ()
1060 get out of it. */ 1053 get out of it. */
1061 1054
1062void 1055void
1063not_single_kboard_state (kboard) 1056not_single_kboard_state (KBOARD *kboard)
1064 KBOARD *kboard;
1065{ 1057{
1066 if (kboard == current_kboard) 1058 if (kboard == current_kboard)
1067 single_kboard = 0; 1059 single_kboard = 0;
@@ -1080,8 +1072,7 @@ struct kboard_stack
1080static struct kboard_stack *kboard_stack; 1072static struct kboard_stack *kboard_stack;
1081 1073
1082void 1074void
1083push_kboard (k) 1075push_kboard (struct kboard *k)
1084 struct kboard *k;
1085{ 1076{
1086 struct kboard_stack *p 1077 struct kboard_stack *p
1087 = (struct kboard_stack *) xmalloc (sizeof (struct kboard_stack)); 1078 = (struct kboard_stack *) xmalloc (sizeof (struct kboard_stack));
@@ -1094,7 +1085,7 @@ push_kboard (k)
1094} 1085}
1095 1086
1096void 1087void
1097pop_kboard () 1088pop_kboard (void)
1098{ 1089{
1099 struct terminal *t; 1090 struct terminal *t;
1100 struct kboard_stack *p = kboard_stack; 1091 struct kboard_stack *p = kboard_stack;
@@ -1129,8 +1120,7 @@ pop_kboard ()
1129 locked, then this function will throw an errow. */ 1120 locked, then this function will throw an errow. */
1130 1121
1131void 1122void
1132temporarily_switch_to_single_kboard (f) 1123temporarily_switch_to_single_kboard (struct frame *f)
1133 struct frame *f;
1134{ 1124{
1135 int was_locked = single_kboard; 1125 int was_locked = single_kboard;
1136 if (was_locked) 1126 if (was_locked)
@@ -1170,8 +1160,7 @@ record_single_kboard_state ()
1170#endif 1160#endif
1171 1161
1172static Lisp_Object 1162static Lisp_Object
1173restore_kboard_configuration (was_locked) 1163restore_kboard_configuration (Lisp_Object was_locked)
1174 Lisp_Object was_locked;
1175{ 1164{
1176 if (NILP (was_locked)) 1165 if (NILP (was_locked))
1177 single_kboard = 0; 1166 single_kboard = 0;
@@ -1192,8 +1181,7 @@ restore_kboard_configuration (was_locked)
1192 by printing an error message and returning to the editor command loop. */ 1181 by printing an error message and returning to the editor command loop. */
1193 1182
1194Lisp_Object 1183Lisp_Object
1195cmd_error (data) 1184cmd_error (Lisp_Object data)
1196 Lisp_Object data;
1197{ 1185{
1198 Lisp_Object old_level, old_length; 1186 Lisp_Object old_level, old_length;
1199 char macroerror[50]; 1187 char macroerror[50];
@@ -1251,9 +1239,7 @@ cmd_error (data)
1251 string. */ 1239 string. */
1252 1240
1253void 1241void
1254cmd_error_internal (data, context) 1242cmd_error_internal (Lisp_Object data, char *context)
1255 Lisp_Object data;
1256 char *context;
1257{ 1243{
1258 struct frame *sf = SELECTED_FRAME (); 1244 struct frame *sf = SELECTED_FRAME ();
1259 1245
@@ -1304,16 +1290,16 @@ cmd_error_internal (data, context)
1304 Vsignaling_function = Qnil; 1290 Vsignaling_function = Qnil;
1305} 1291}
1306 1292
1307Lisp_Object command_loop_1 (); 1293Lisp_Object command_loop_1 (void);
1308Lisp_Object command_loop_2 (); 1294Lisp_Object command_loop_2 (Lisp_Object);
1309Lisp_Object top_level_1 (); 1295Lisp_Object top_level_1 (Lisp_Object);
1310 1296
1311/* Entry to editor-command-loop. 1297/* Entry to editor-command-loop.
1312 This level has the catches for exiting/returning to editor command loop. 1298 This level has the catches for exiting/returning to editor command loop.
1313 It returns nil to exit recursive edit, t to abort it. */ 1299 It returns nil to exit recursive edit, t to abort it. */
1314 1300
1315Lisp_Object 1301Lisp_Object
1316command_loop () 1302command_loop (void)
1317{ 1303{
1318 if (command_loop_level > 0 || minibuf_level > 0) 1304 if (command_loop_level > 0 || minibuf_level > 0)
1319 { 1305 {
@@ -1348,7 +1334,7 @@ command_loop ()
1348 returned due to end of file (or end of kbd macro). */ 1334 returned due to end of file (or end of kbd macro). */
1349 1335
1350Lisp_Object 1336Lisp_Object
1351command_loop_2 () 1337command_loop_2 (Lisp_Object ignore)
1352{ 1338{
1353 register Lisp_Object val; 1339 register Lisp_Object val;
1354 1340
@@ -1360,13 +1346,13 @@ command_loop_2 ()
1360} 1346}
1361 1347
1362Lisp_Object 1348Lisp_Object
1363top_level_2 () 1349top_level_2 (void)
1364{ 1350{
1365 return Feval (Vtop_level); 1351 return Feval (Vtop_level);
1366} 1352}
1367 1353
1368Lisp_Object 1354Lisp_Object
1369top_level_1 () 1355top_level_1 (Lisp_Object ignore)
1370{ 1356{
1371 /* On entry to the outer level, run the startup file */ 1357 /* On entry to the outer level, run the startup file */
1372 if (!NILP (Vtop_level)) 1358 if (!NILP (Vtop_level))
@@ -1424,8 +1410,7 @@ DEFUN ("abort-recursive-edit", Fabort_recursive_edit, Sabort_recursive_edit, 0,
1424 of this function. */ 1410 of this function. */
1425 1411
1426static Lisp_Object 1412static Lisp_Object
1427tracking_off (old_value) 1413tracking_off (Lisp_Object old_value)
1428 Lisp_Object old_value;
1429{ 1414{
1430 do_mouse_tracking = old_value; 1415 do_mouse_tracking = old_value;
1431 if (NILP (old_value)) 1416 if (NILP (old_value))
@@ -1475,7 +1460,7 @@ usage: (track-mouse BODY...) */)
1475int ignore_mouse_drag_p; 1460int ignore_mouse_drag_p;
1476 1461
1477static FRAME_PTR 1462static FRAME_PTR
1478some_mouse_moved () 1463some_mouse_moved (void)
1479{ 1464{
1480 Lisp_Object tail, frame; 1465 Lisp_Object tail, frame;
1481 1466
@@ -1508,8 +1493,7 @@ static void adjust_point_for_property (int, int);
1508 ARG is not used. */ 1493 ARG is not used. */
1509#ifdef HAVE_WINDOW_SYSTEM 1494#ifdef HAVE_WINDOW_SYSTEM
1510static Lisp_Object 1495static Lisp_Object
1511cancel_hourglass_unwind (arg) 1496cancel_hourglass_unwind (Lisp_Object arg)
1512 Lisp_Object arg;
1513{ 1497{
1514 cancel_hourglass (); 1498 cancel_hourglass ();
1515 return Qnil; 1499 return Qnil;
@@ -1517,7 +1501,7 @@ cancel_hourglass_unwind (arg)
1517#endif 1501#endif
1518 1502
1519Lisp_Object 1503Lisp_Object
1520command_loop_1 () 1504command_loop_1 (void)
1521{ 1505{
1522 Lisp_Object cmd; 1506 Lisp_Object cmd;
1523 Lisp_Object keybuf[30]; 1507 Lisp_Object keybuf[30];
@@ -1865,9 +1849,7 @@ extern Lisp_Object Qafter_string, Qbefore_string;
1865extern Lisp_Object get_pos_property (Lisp_Object, Lisp_Object, Lisp_Object); 1849extern Lisp_Object get_pos_property (Lisp_Object, Lisp_Object, Lisp_Object);
1866 1850
1867static void 1851static void
1868adjust_point_for_property (last_pt, modified) 1852adjust_point_for_property (int last_pt, int modified)
1869 int last_pt;
1870 int modified;
1871{ 1853{
1872 EMACS_INT beg, end; 1854 EMACS_INT beg, end;
1873 Lisp_Object val, overlay, tmp; 1855 Lisp_Object val, overlay, tmp;
@@ -2017,8 +1999,7 @@ adjust_point_for_property (last_pt, modified)
2017/* Subroutine for safe_run_hooks: run the hook HOOK. */ 1999/* Subroutine for safe_run_hooks: run the hook HOOK. */
2018 2000
2019static Lisp_Object 2001static Lisp_Object
2020safe_run_hooks_1 (hook) 2002safe_run_hooks_1 (void)
2021 Lisp_Object hook;
2022{ 2003{
2023 if (NILP (Vrun_hooks)) 2004 if (NILP (Vrun_hooks))
2024 return Qnil; 2005 return Qnil;
@@ -2028,8 +2009,7 @@ safe_run_hooks_1 (hook)
2028/* Subroutine for safe_run_hooks: handle an error by clearing out the hook. */ 2009/* Subroutine for safe_run_hooks: handle an error by clearing out the hook. */
2029 2010
2030static Lisp_Object 2011static Lisp_Object
2031safe_run_hooks_error (data) 2012safe_run_hooks_error (Lisp_Object data)
2032 Lisp_Object data;
2033{ 2013{
2034 Lisp_Object args[3]; 2014 Lisp_Object args[3];
2035 args[0] = build_string ("Error in %s: %s"); 2015 args[0] = build_string ("Error in %s: %s");
@@ -2044,8 +2024,7 @@ safe_run_hooks_error (data)
2044 to mysteriously evaporate. */ 2024 to mysteriously evaporate. */
2045 2025
2046void 2026void
2047safe_run_hooks (hook) 2027safe_run_hooks (Lisp_Object hook)
2048 Lisp_Object hook;
2049{ 2028{
2050 int count = SPECPDL_INDEX (); 2029 int count = SPECPDL_INDEX ();
2051 specbind (Qinhibit_quit, hook); 2030 specbind (Qinhibit_quit, hook);
@@ -2077,7 +2056,7 @@ struct atimer *poll_timer;
2077 there. */ 2056 there. */
2078 2057
2079void 2058void
2080poll_for_input_1 () 2059poll_for_input_1 (void)
2081{ 2060{
2082/* Tell ns_read_socket() it is being called asynchronously so it can avoid 2061/* Tell ns_read_socket() it is being called asynchronously so it can avoid
2083 doing anything dangerous. */ 2062 doing anything dangerous. */
@@ -2096,8 +2075,7 @@ poll_for_input_1 ()
2096 poll_timer. */ 2075 poll_timer. */
2097 2076
2098void 2077void
2099poll_for_input (timer) 2078poll_for_input (struct atimer *timer)
2100 struct atimer *timer;
2101{ 2079{
2102 if (poll_suppress_count == 0) 2080 if (poll_suppress_count == 0)
2103 { 2081 {
@@ -2116,7 +2094,7 @@ poll_for_input (timer)
2116 This function is called unconditionally from various places. */ 2094 This function is called unconditionally from various places. */
2117 2095
2118void 2096void
2119start_polling () 2097start_polling (void)
2120{ 2098{
2121#ifdef POLL_FOR_INPUT 2099#ifdef POLL_FOR_INPUT
2122 /* XXX This condition was (read_socket_hook && !interrupt_input), 2100 /* XXX This condition was (read_socket_hook && !interrupt_input),
@@ -2153,7 +2131,7 @@ start_polling ()
2153/* Nonzero if we are using polling to handle input asynchronously. */ 2131/* Nonzero if we are using polling to handle input asynchronously. */
2154 2132
2155int 2133int
2156input_polling_used () 2134input_polling_used (void)
2157{ 2135{
2158#ifdef POLL_FOR_INPUT 2136#ifdef POLL_FOR_INPUT
2159 /* XXX This condition was (read_socket_hook && !interrupt_input), 2137 /* XXX This condition was (read_socket_hook && !interrupt_input),
@@ -2168,7 +2146,7 @@ input_polling_used ()
2168/* Turn off polling. */ 2146/* Turn off polling. */
2169 2147
2170void 2148void
2171stop_polling () 2149stop_polling (void)
2172{ 2150{
2173#ifdef POLL_FOR_INPUT 2151#ifdef POLL_FOR_INPUT
2174 /* XXX This condition was (read_socket_hook && !interrupt_input), 2152 /* XXX This condition was (read_socket_hook && !interrupt_input),
@@ -2183,8 +2161,7 @@ stop_polling ()
2183 and start or stop polling accordingly. */ 2161 and start or stop polling accordingly. */
2184 2162
2185void 2163void
2186set_poll_suppress_count (count) 2164set_poll_suppress_count (int count)
2187 int count;
2188{ 2165{
2189#ifdef POLL_FOR_INPUT 2166#ifdef POLL_FOR_INPUT
2190 if (count == 0 && poll_suppress_count != 0) 2167 if (count == 0 && poll_suppress_count != 0)
@@ -2204,8 +2181,7 @@ set_poll_suppress_count (count)
2204 But don't decrease it. */ 2181 But don't decrease it. */
2205 2182
2206void 2183void
2207bind_polling_period (n) 2184bind_polling_period (int n)
2208 int n;
2209{ 2185{
2210#ifdef POLL_FOR_INPUT 2186#ifdef POLL_FOR_INPUT
2211 int new = polling_period; 2187 int new = polling_period;
@@ -2224,8 +2200,7 @@ bind_polling_period (n)
2224/* Apply the control modifier to CHARACTER. */ 2200/* Apply the control modifier to CHARACTER. */
2225 2201
2226int 2202int
2227make_ctrl_char (c) 2203make_ctrl_char (int c)
2228 int c;
2229{ 2204{
2230 /* Save the upper bits here. */ 2205 /* Save the upper bits here. */
2231 int upper = c & ~0177; 2206 int upper = c & ~0177;
@@ -2294,9 +2269,8 @@ make_ctrl_char (c)
2294 from X code running asynchronously. */ 2269 from X code running asynchronously. */
2295 2270
2296void 2271void
2297show_help_echo (help, window, object, pos, ok_to_overwrite_keystroke_echo) 2272show_help_echo (Lisp_Object help, Lisp_Object window, Lisp_Object object,
2298 Lisp_Object help, window, object, pos; 2273 Lisp_Object pos, int ok_to_overwrite_keystroke_echo)
2299 int ok_to_overwrite_keystroke_echo;
2300{ 2274{
2301 if (!NILP (help) && !STRINGP (help)) 2275 if (!NILP (help) && !STRINGP (help))
2302 { 2276 {
@@ -2343,9 +2317,10 @@ show_help_echo (help, window, object, pos, ok_to_overwrite_keystroke_echo)
2343 2317
2344/* Input of single characters from keyboard */ 2318/* Input of single characters from keyboard */
2345 2319
2346Lisp_Object print_help (); 2320Lisp_Object print_help (Lisp_Object object);
2347static Lisp_Object kbd_buffer_get_event (); 2321static Lisp_Object kbd_buffer_get_event (KBOARD **kbp, int *used_mouse_menu,
2348static void record_char (); 2322 struct timeval *end_time);
2323static void record_char (Lisp_Object c);
2349 2324
2350static Lisp_Object help_form_saved_window_configs; 2325static Lisp_Object help_form_saved_window_configs;
2351static Lisp_Object 2326static Lisp_Object
@@ -2394,13 +2369,8 @@ do { if (polling_stopped_here) start_polling (); \
2394 Value is t if we showed a menu and the user rejected it. */ 2369 Value is t if we showed a menu and the user rejected it. */
2395 2370
2396Lisp_Object 2371Lisp_Object
2397read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time) 2372read_char (int commandflag, int nmaps, Lisp_Object *maps, Lisp_Object prev_event,
2398 int commandflag; 2373 int *used_mouse_menu, struct timeval *end_time)
2399 int nmaps;
2400 Lisp_Object *maps;
2401 Lisp_Object prev_event;
2402 int *used_mouse_menu;
2403 EMACS_TIME *end_time;
2404{ 2374{
2405 volatile Lisp_Object c; 2375 volatile Lisp_Object c;
2406 int count, jmpcount; 2376 int count, jmpcount;
@@ -3311,8 +3281,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time)
3311 Record it for echoing, for this-command-keys, and so on. */ 3281 Record it for echoing, for this-command-keys, and so on. */
3312 3282
3313static void 3283static void
3314record_menu_key (c) 3284record_menu_key (Lisp_Object c)
3315 Lisp_Object c;
3316{ 3285{
3317 /* Wipe the echo area. */ 3286 /* Wipe the echo area. */
3318 clear_message (1, 0); 3287 clear_message (1, 0);
@@ -3346,8 +3315,7 @@ record_menu_key (c)
3346/* Return 1 if should recognize C as "the help character". */ 3315/* Return 1 if should recognize C as "the help character". */
3347 3316
3348int 3317int
3349help_char_p (c) 3318help_char_p (Lisp_Object c)
3350 Lisp_Object c;
3351{ 3319{
3352 Lisp_Object tail; 3320 Lisp_Object tail;
3353 3321
@@ -3362,8 +3330,7 @@ help_char_p (c)
3362/* Record the input event C in various ways. */ 3330/* Record the input event C in various ways. */
3363 3331
3364static void 3332static void
3365record_char (c) 3333record_char (Lisp_Object c)
3366 Lisp_Object c;
3367{ 3334{
3368 int recorded = 0; 3335 int recorded = 0;
3369 3336
@@ -3497,8 +3464,7 @@ record_char (c)
3497} 3464}
3498 3465
3499Lisp_Object 3466Lisp_Object
3500print_help (object) 3467print_help (Lisp_Object object)
3501 Lisp_Object object;
3502{ 3468{
3503 struct buffer *old = current_buffer; 3469 struct buffer *old = current_buffer;
3504 Fprinc (object, Qnil); 3470 Fprinc (object, Qnil);
@@ -3514,15 +3480,13 @@ print_help (object)
3514 See read_process_output. */ 3480 See read_process_output. */
3515 3481
3516static void 3482static void
3517save_getcjmp (temp) 3483save_getcjmp (jmp_buf temp)
3518 jmp_buf temp;
3519{ 3484{
3520 bcopy (getcjmp, temp, sizeof getcjmp); 3485 bcopy (getcjmp, temp, sizeof getcjmp);
3521} 3486}
3522 3487
3523static void 3488static void
3524restore_getcjmp (temp) 3489restore_getcjmp (jmp_buf temp)
3525 jmp_buf temp;
3526{ 3490{
3527 bcopy (temp, getcjmp, sizeof getcjmp); 3491 bcopy (temp, getcjmp, sizeof getcjmp);
3528} 3492}
@@ -3534,8 +3498,7 @@ restore_getcjmp (temp)
3534/* Return true if there are any events in the queue that read-char 3498/* Return true if there are any events in the queue that read-char
3535 would return. If this returns false, a read-char would block. */ 3499 would return. If this returns false, a read-char would block. */
3536static int 3500static int
3537readable_events (flags) 3501readable_events (int flags)
3538 int flags;
3539{ 3502{
3540#ifdef HAVE_DBUS 3503#ifdef HAVE_DBUS
3541 /* Check whether a D-Bus message has arrived. */ 3504 /* Check whether a D-Bus message has arrived. */
@@ -3611,8 +3574,7 @@ readable_events (flags)
3611int stop_character; 3574int stop_character;
3612 3575
3613static KBOARD * 3576static KBOARD *
3614event_to_kboard (event) 3577event_to_kboard (struct input_event *event)
3615 struct input_event *event;
3616{ 3578{
3617 Lisp_Object frame; 3579 Lisp_Object frame;
3618 frame = event->frame_or_window; 3580 frame = event->frame_or_window;
@@ -3636,8 +3598,7 @@ Lisp_Object Vthrow_on_input;
3636/* Store an event obtained at interrupt level into kbd_buffer, fifo */ 3598/* Store an event obtained at interrupt level into kbd_buffer, fifo */
3637 3599
3638void 3600void
3639kbd_buffer_store_event (event) 3601kbd_buffer_store_event (register struct input_event *event)
3640 register struct input_event *event;
3641{ 3602{
3642 kbd_buffer_store_event_hold (event, 0); 3603 kbd_buffer_store_event_hold (event, 0);
3643} 3604}
@@ -3655,9 +3616,8 @@ kbd_buffer_store_event (event)
3655 */ 3616 */
3656 3617
3657void 3618void
3658kbd_buffer_store_event_hold (event, hold_quit) 3619kbd_buffer_store_event_hold (register struct input_event *event,
3659 register struct input_event *event; 3620 struct input_event *hold_quit)
3660 struct input_event *hold_quit;
3661{ 3621{
3662 if (event->kind == NO_EVENT) 3622 if (event->kind == NO_EVENT)
3663 abort (); 3623 abort ();
@@ -3778,8 +3738,7 @@ kbd_buffer_store_event_hold (event, hold_quit)
3778/* Put an input event back in the head of the event queue. */ 3738/* Put an input event back in the head of the event queue. */
3779 3739
3780void 3740void
3781kbd_buffer_unget_event (event) 3741kbd_buffer_unget_event (register struct input_event *event)
3782 register struct input_event *event;
3783{ 3742{
3784 if (kbd_fetch_ptr == kbd_buffer) 3743 if (kbd_fetch_ptr == kbd_buffer)
3785 kbd_fetch_ptr = kbd_buffer + KBD_BUFFER_SIZE; 3744 kbd_fetch_ptr = kbd_buffer + KBD_BUFFER_SIZE;
@@ -3807,9 +3766,8 @@ kbd_buffer_unget_event (event)
3807 Value is the number of input_events generated. */ 3766 Value is the number of input_events generated. */
3808 3767
3809void 3768void
3810gen_help_event (help, frame, window, object, pos) 3769gen_help_event (Lisp_Object help, Lisp_Object frame, Lisp_Object window,
3811 Lisp_Object help, frame, object, window; 3770 Lisp_Object object, int pos)
3812 int pos;
3813{ 3771{
3814 struct input_event event; 3772 struct input_event event;
3815 3773
@@ -3828,8 +3786,7 @@ gen_help_event (help, frame, window, object, pos)
3828/* Store HELP_EVENTs for HELP on FRAME in the input queue. */ 3786/* Store HELP_EVENTs for HELP on FRAME in the input queue. */
3829 3787
3830void 3788void
3831kbd_buffer_store_help_event (frame, help) 3789kbd_buffer_store_help_event (Lisp_Object frame, Lisp_Object help)
3832 Lisp_Object frame, help;
3833{ 3790{
3834 struct input_event event; 3791 struct input_event event;
3835 3792
@@ -3846,7 +3803,7 @@ kbd_buffer_store_help_event (frame, help)
3846/* Discard any mouse events in the event buffer by setting them to 3803/* Discard any mouse events in the event buffer by setting them to
3847 NO_EVENT. */ 3804 NO_EVENT. */
3848void 3805void
3849discard_mouse_events () 3806discard_mouse_events (void)
3850{ 3807{
3851 struct input_event *sp; 3808 struct input_event *sp;
3852 for (sp = kbd_fetch_ptr; sp != kbd_store_ptr; sp++) 3809 for (sp = kbd_fetch_ptr; sp != kbd_store_ptr; sp++)
@@ -3876,8 +3833,7 @@ discard_mouse_events ()
3876 are no real input events. */ 3833 are no real input events. */
3877 3834
3878int 3835int
3879kbd_buffer_events_waiting (discard) 3836kbd_buffer_events_waiting (int discard)
3880 int discard;
3881{ 3837{
3882 struct input_event *sp; 3838 struct input_event *sp;
3883 3839
@@ -3899,8 +3855,7 @@ kbd_buffer_events_waiting (discard)
3899/* Clear input event EVENT. */ 3855/* Clear input event EVENT. */
3900 3856
3901static INLINE void 3857static INLINE void
3902clear_event (event) 3858clear_event (struct input_event *event)
3903 struct input_event *event;
3904{ 3859{
3905 event->kind = NO_EVENT; 3860 event->kind = NO_EVENT;
3906} 3861}
@@ -3913,10 +3868,7 @@ clear_event (event)
3913 We always read and discard one event. */ 3868 We always read and discard one event. */
3914 3869
3915static Lisp_Object 3870static Lisp_Object
3916kbd_buffer_get_event (kbp, used_mouse_menu, end_time) 3871kbd_buffer_get_event (KBOARD **kbp, int *used_mouse_menu, struct timeval *end_time)
3917 KBOARD **kbp;
3918 int *used_mouse_menu;
3919 EMACS_TIME *end_time;
3920{ 3872{
3921 register int c; 3873 register int c;
3922 Lisp_Object obj; 3874 Lisp_Object obj;
@@ -4283,8 +4235,7 @@ kbd_buffer_get_event (kbp, used_mouse_menu, end_time)
4283 then return, without reading any user-visible events. */ 4235 then return, without reading any user-visible events. */
4284 4236
4285void 4237void
4286swallow_events (do_display) 4238swallow_events (int do_display)
4287 int do_display;
4288{ 4239{
4289 int old_timers_run; 4240 int old_timers_run;
4290 4241
@@ -4334,7 +4285,7 @@ swallow_events (do_display)
4334 for the sake of running idle-time timers. */ 4285 for the sake of running idle-time timers. */
4335 4286
4336static void 4287static void
4337timer_start_idle () 4288timer_start_idle (void)
4338{ 4289{
4339 Lisp_Object timers; 4290 Lisp_Object timers;
4340 4291
@@ -4362,7 +4313,7 @@ timer_start_idle ()
4362/* Record that Emacs is no longer idle, so stop running idle-time timers. */ 4313/* Record that Emacs is no longer idle, so stop running idle-time timers. */
4363 4314
4364static void 4315static void
4365timer_stop_idle () 4316timer_stop_idle (void)
4366{ 4317{
4367 EMACS_SET_SECS_USECS (timer_idleness_start_time, -1, -1); 4318 EMACS_SET_SECS_USECS (timer_idleness_start_time, -1, -1);
4368} 4319}
@@ -4370,7 +4321,7 @@ timer_stop_idle ()
4370/* Resume idle timer from last idle start time. */ 4321/* Resume idle timer from last idle start time. */
4371 4322
4372static void 4323static void
4373timer_resume_idle () 4324timer_resume_idle (void)
4374{ 4325{
4375 if (! EMACS_TIME_NEG_P (timer_idleness_start_time)) 4326 if (! EMACS_TIME_NEG_P (timer_idleness_start_time))
4376 return; 4327 return;
@@ -4401,7 +4352,7 @@ extern Lisp_Object Qapply;
4401 should be done. */ 4352 should be done. */
4402 4353
4403static EMACS_TIME 4354static EMACS_TIME
4404timer_check_2 () 4355timer_check_2 (void)
4405{ 4356{
4406 EMACS_TIME nexttime; 4357 EMACS_TIME nexttime;
4407 EMACS_TIME now, idleness_now; 4358 EMACS_TIME now, idleness_now;
@@ -4602,12 +4553,11 @@ timer_check_2 ()
4602 Now we always run timers directly. */ 4553 Now we always run timers directly. */
4603 4554
4604EMACS_TIME 4555EMACS_TIME
4605timer_check (do_it_now) 4556timer_check (int do_it_now)
4606 int do_it_now;
4607{ 4557{
4608 EMACS_TIME nexttime; 4558 EMACS_TIME nexttime;
4609 4559
4610 do 4560 do
4611 { 4561 {
4612 nexttime = timer_check_2 (); 4562 nexttime = timer_check_2 ();
4613 } 4563 }
@@ -5254,10 +5204,8 @@ int double_click_count;
5254/* Return position of a mouse click or wheel event */ 5204/* Return position of a mouse click or wheel event */
5255 5205
5256static Lisp_Object 5206static Lisp_Object
5257make_lispy_position (f, x, y, time) 5207make_lispy_position (struct frame *f, Lisp_Object *x, Lisp_Object *y,
5258 struct frame *f; 5208 unsigned long time)
5259 Lisp_Object *x, *y;
5260 unsigned long time;
5261{ 5209{
5262 Lisp_Object window; 5210 Lisp_Object window;
5263 enum window_part part; 5211 enum window_part part;
@@ -5444,8 +5392,7 @@ make_lispy_position (f, x, y, time)
5444 in order to build drag events when the button is released. */ 5392 in order to build drag events when the button is released. */
5445 5393
5446static Lisp_Object 5394static Lisp_Object
5447make_lispy_event (event) 5395make_lispy_event (struct input_event *event)
5448 struct input_event *event;
5449{ 5396{
5450 int i; 5397 int i;
5451 5398
@@ -6152,12 +6099,8 @@ make_lispy_event (event)
6152#if defined(HAVE_MOUSE) || defined(HAVE_GPM) 6099#if defined(HAVE_MOUSE) || defined(HAVE_GPM)
6153 6100
6154static Lisp_Object 6101static Lisp_Object
6155make_lispy_movement (frame, bar_window, part, x, y, time) 6102make_lispy_movement (FRAME_PTR frame, Lisp_Object bar_window, enum scroll_bar_part part,
6156 FRAME_PTR frame; 6103 Lisp_Object x, Lisp_Object y, unsigned long time)
6157 Lisp_Object bar_window;
6158 enum scroll_bar_part part;
6159 Lisp_Object x, y;
6160 unsigned long time;
6161{ 6104{
6162 /* Is it a scroll bar movement? */ 6105 /* Is it a scroll bar movement? */
6163 if (frame && ! NILP (bar_window)) 6106 if (frame && ! NILP (bar_window))
@@ -6192,8 +6135,7 @@ make_lispy_movement (frame, bar_window, part, x, y, time)
6192 6135
6193/* Construct a switch frame event. */ 6136/* Construct a switch frame event. */
6194static Lisp_Object 6137static Lisp_Object
6195make_lispy_switch_frame (frame) 6138make_lispy_switch_frame (Lisp_Object frame)
6196 Lisp_Object frame;
6197{ 6139{
6198 return Fcons (Qswitch_frame, Fcons (frame, Qnil)); 6140 return Fcons (Qswitch_frame, Fcons (frame, Qnil));
6199} 6141}
@@ -6209,9 +6151,7 @@ make_lispy_switch_frame (frame)
6209 This doesn't use any caches. */ 6151 This doesn't use any caches. */
6210 6152
6211static int 6153static int
6212parse_modifiers_uncached (symbol, modifier_end) 6154parse_modifiers_uncached (Lisp_Object symbol, int *modifier_end)
6213 Lisp_Object symbol;
6214 int *modifier_end;
6215{ 6155{
6216 Lisp_Object name; 6156 Lisp_Object name;
6217 int i; 6157 int i;
@@ -6321,10 +6261,7 @@ parse_modifiers_uncached (symbol, modifier_end)
6321 prepended to the string BASE[0..BASE_LEN-1]. 6261 prepended to the string BASE[0..BASE_LEN-1].
6322 This doesn't use any caches. */ 6262 This doesn't use any caches. */
6323static Lisp_Object 6263static Lisp_Object
6324apply_modifiers_uncached (modifiers, base, base_len, base_len_byte) 6264apply_modifiers_uncached (int modifiers, char *base, int base_len, int base_len_byte)
6325 int modifiers;
6326 char *base;
6327 int base_len, base_len_byte;
6328{ 6265{
6329 /* Since BASE could contain nulls, we can't use intern here; we have 6266 /* Since BASE could contain nulls, we can't use intern here; we have
6330 to use Fintern, which expects a genuine Lisp_String, and keeps a 6267 to use Fintern, which expects a genuine Lisp_String, and keeps a
@@ -6383,8 +6320,7 @@ static Lisp_Object modifier_symbols;
6383 6320
6384/* Return the list of modifier symbols corresponding to the mask MODIFIERS. */ 6321/* Return the list of modifier symbols corresponding to the mask MODIFIERS. */
6385static Lisp_Object 6322static Lisp_Object
6386lispy_modifier_list (modifiers) 6323lispy_modifier_list (int modifiers)
6387 int modifiers;
6388{ 6324{
6389 Lisp_Object modifier_list; 6325 Lisp_Object modifier_list;
6390 int i; 6326 int i;
@@ -6409,8 +6345,7 @@ lispy_modifier_list (modifiers)
6409#define KEY_TO_CHAR(k) (XINT (k) & ((1 << CHARACTERBITS) - 1)) 6345#define KEY_TO_CHAR(k) (XINT (k) & ((1 << CHARACTERBITS) - 1))
6410 6346
6411Lisp_Object 6347Lisp_Object
6412parse_modifiers (symbol) 6348parse_modifiers (Lisp_Object symbol)
6413 Lisp_Object symbol;
6414{ 6349{
6415 Lisp_Object elements; 6350 Lisp_Object elements;
6416 6351
@@ -6479,9 +6414,7 @@ DEFUN ("internal-event-symbol-parse-modifiers", Fevent_symbol_parse_modifiers,
6479 apply_modifiers copies the value of BASE's Qevent_kind property to 6414 apply_modifiers copies the value of BASE's Qevent_kind property to
6480 the modified symbol. */ 6415 the modified symbol. */
6481static Lisp_Object 6416static Lisp_Object
6482apply_modifiers (modifiers, base) 6417apply_modifiers (int modifiers, Lisp_Object base)
6483 int modifiers;
6484 Lisp_Object base;
6485{ 6418{
6486 Lisp_Object cache, index, entry, new_symbol; 6419 Lisp_Object cache, index, entry, new_symbol;
6487 6420
@@ -6550,8 +6483,7 @@ apply_modifiers (modifiers, base)
6550 and M-C-foo end up being equivalent in the keymap. */ 6483 and M-C-foo end up being equivalent in the keymap. */
6551 6484
6552Lisp_Object 6485Lisp_Object
6553reorder_modifiers (symbol) 6486reorder_modifiers (Lisp_Object symbol)
6554 Lisp_Object symbol;
6555{ 6487{
6556 /* It's hopefully okay to write the code this way, since everything 6488 /* It's hopefully okay to write the code this way, since everything
6557 will soon be in caches, and no consing will be done at all. */ 6489 will soon be in caches, and no consing will be done at all. */
@@ -6596,15 +6528,9 @@ reorder_modifiers (symbol)
6596 in the symbol's name. */ 6528 in the symbol's name. */
6597 6529
6598static Lisp_Object 6530static Lisp_Object
6599modify_event_symbol (symbol_num, modifiers, symbol_kind, name_alist_or_stem, 6531modify_event_symbol (int symbol_num, unsigned int modifiers, Lisp_Object symbol_kind,
6600 name_table, symbol_table, table_size) 6532 Lisp_Object name_alist_or_stem, char **name_table,
6601 int symbol_num; 6533 Lisp_Object *symbol_table, unsigned int table_size)
6602 unsigned modifiers;
6603 Lisp_Object symbol_kind;
6604 Lisp_Object name_alist_or_stem;
6605 char **name_table;
6606 Lisp_Object *symbol_table;
6607 unsigned int table_size;
6608{ 6534{
6609 Lisp_Object value; 6535 Lisp_Object value;
6610 Lisp_Object symbol_int; 6536 Lisp_Object symbol_int;
@@ -6841,8 +6767,7 @@ parse_solitary_modifier (Lisp_Object symbol)
6841 but it can be a Lucid-style event type list. */ 6767 but it can be a Lucid-style event type list. */
6842 6768
6843int 6769int
6844lucid_event_type_list_p (object) 6770lucid_event_type_list_p (Lisp_Object object)
6845 Lisp_Object object;
6846{ 6771{
6847 Lisp_Object tail; 6772 Lisp_Object tail;
6848 6773
@@ -6879,9 +6804,7 @@ lucid_event_type_list_p (object)
6879 movements and toolkit scroll bar thumb drags. */ 6804 movements and toolkit scroll bar thumb drags. */
6880 6805
6881static void 6806static void
6882get_input_pending (addr, flags) 6807get_input_pending (int *addr, int flags)
6883 int *addr;
6884 int flags;
6885{ 6808{
6886 /* First of all, have we already counted some input? */ 6809 /* First of all, have we already counted some input? */
6887 *addr = (!NILP (Vquit_flag) || readable_events (flags)); 6810 *addr = (!NILP (Vquit_flag) || readable_events (flags));
@@ -6898,8 +6821,7 @@ get_input_pending (addr, flags)
6898/* Interface to read_avail_input, blocking SIGIO or SIGALRM if necessary. */ 6821/* Interface to read_avail_input, blocking SIGIO or SIGALRM if necessary. */
6899 6822
6900void 6823void
6901gobble_input (expected) 6824gobble_input (int expected)
6902 int expected;
6903{ 6825{
6904#ifdef HAVE_DBUS 6826#ifdef HAVE_DBUS
6905 /* Read D-Bus messages. */ 6827 /* Read D-Bus messages. */
@@ -6936,7 +6858,7 @@ gobble_input (expected)
6936 so that read_key_sequence will notice the new current buffer. */ 6858 so that read_key_sequence will notice the new current buffer. */
6937 6859
6938void 6860void
6939record_asynch_buffer_change () 6861record_asynch_buffer_change (void)
6940{ 6862{
6941 struct input_event event; 6863 struct input_event event;
6942 Lisp_Object tem; 6864 Lisp_Object tem;
@@ -6986,8 +6908,7 @@ record_asynch_buffer_change ()
6986 this is a bad time to try to read input. */ 6908 this is a bad time to try to read input. */
6987 6909
6988static int 6910static int
6989read_avail_input (expected) 6911read_avail_input (int expected)
6990 int expected;
6991{ 6912{
6992 int nread = 0; 6913 int nread = 0;
6993 int err = 0; 6914 int err = 0;
@@ -7313,7 +7234,7 @@ tty_read_avail_input (struct terminal *terminal,
7313} 7234}
7314 7235
7315void 7236void
7316handle_async_input () 7237handle_async_input (void)
7317{ 7238{
7318 interrupt_input_pending = 0; 7239 interrupt_input_pending = 0;
7319#ifdef SYNC_INPUT 7240#ifdef SYNC_INPUT
@@ -7340,7 +7261,7 @@ handle_async_input ()
7340} 7261}
7341 7262
7342void 7263void
7343process_pending_signals () 7264process_pending_signals (void)
7344{ 7265{
7345 if (interrupt_input_pending) 7266 if (interrupt_input_pending)
7346 handle_async_input (); 7267 handle_async_input ();
@@ -7351,8 +7272,7 @@ process_pending_signals ()
7351/* Note SIGIO has been undef'd if FIONREAD is missing. */ 7272/* Note SIGIO has been undef'd if FIONREAD is missing. */
7352 7273
7353static SIGTYPE 7274static SIGTYPE
7354input_available_signal (signo) 7275input_available_signal (int signo)
7355 int signo;
7356{ 7276{
7357 /* Must preserve main program's value of errno. */ 7277 /* Must preserve main program's value of errno. */
7358 int old_errno = errno; 7278 int old_errno = errno;
@@ -7381,7 +7301,7 @@ input_available_signal (signo)
7381 dealing with, without assuming that every file which uses 7301 dealing with, without assuming that every file which uses
7382 UNBLOCK_INPUT also has #included the files necessary to get SIGIO. */ 7302 UNBLOCK_INPUT also has #included the files necessary to get SIGIO. */
7383void 7303void
7384reinvoke_input_signal () 7304reinvoke_input_signal (void)
7385{ 7305{
7386#ifdef SIGIO 7306#ifdef SIGIO
7387 handle_async_input (); 7307 handle_async_input ();
@@ -7410,9 +7330,7 @@ struct user_signal_info
7410static struct user_signal_info *user_signals = NULL; 7330static struct user_signal_info *user_signals = NULL;
7411 7331
7412void 7332void
7413add_user_signal (sig, name) 7333add_user_signal (int sig, const char *name)
7414 int sig;
7415 const char *name;
7416{ 7334{
7417 struct user_signal_info *p; 7335 struct user_signal_info *p;
7418 7336
@@ -7432,8 +7350,7 @@ add_user_signal (sig, name)
7432} 7350}
7433 7351
7434static SIGTYPE 7352static SIGTYPE
7435handle_user_signal (sig) 7353handle_user_signal (int sig)
7436 int sig;
7437{ 7354{
7438 int old_errno = errno; 7355 int old_errno = errno;
7439 struct user_signal_info *p; 7356 struct user_signal_info *p;
@@ -7462,8 +7379,7 @@ handle_user_signal (sig)
7462} 7379}
7463 7380
7464static char * 7381static char *
7465find_user_signal_name (sig) 7382find_user_signal_name (int sig)
7466 int sig;
7467{ 7383{
7468 struct user_signal_info *p; 7384 struct user_signal_info *p;
7469 7385
@@ -7475,7 +7391,7 @@ find_user_signal_name (sig)
7475} 7391}
7476 7392
7477static int 7393static int
7478store_user_signal_events () 7394store_user_signal_events (void)
7479{ 7395{
7480 struct user_signal_info *p; 7396 struct user_signal_info *p;
7481 struct input_event buf; 7397 struct input_event buf;
@@ -7525,8 +7441,7 @@ static int menu_bar_items_index;
7525 OLD is an old vector we can optionally reuse, or nil. */ 7441 OLD is an old vector we can optionally reuse, or nil. */
7526 7442
7527Lisp_Object 7443Lisp_Object
7528menu_bar_items (old) 7444menu_bar_items (Lisp_Object old)
7529 Lisp_Object old;
7530{ 7445{
7531 /* The number of keymaps we're scanning right now, and the number of 7446 /* The number of keymaps we're scanning right now, and the number of
7532 keymaps we have allocated space for. */ 7447 keymaps we have allocated space for. */
@@ -7666,9 +7581,7 @@ menu_bar_items (old)
7666Lisp_Object item_properties; 7581Lisp_Object item_properties;
7667 7582
7668static void 7583static void
7669menu_bar_item (key, item, dummy1, dummy2) 7584menu_bar_item (Lisp_Object key, Lisp_Object item, Lisp_Object dummy1, void *dummy2)
7670 Lisp_Object key, item, dummy1;
7671 void *dummy2;
7672{ 7585{
7673 struct gcpro gcpro1; 7586 struct gcpro gcpro1;
7674 int i; 7587 int i;
@@ -7743,8 +7656,7 @@ menu_bar_item (key, item, dummy1, dummy2)
7743 7656
7744 /* This is used as the handler when calling menu_item_eval_property. */ 7657 /* This is used as the handler when calling menu_item_eval_property. */
7745static Lisp_Object 7658static Lisp_Object
7746menu_item_eval_property_1 (arg) 7659menu_item_eval_property_1 (Lisp_Object arg)
7747 Lisp_Object arg;
7748{ 7660{
7749 /* If we got a quit from within the menu computation, 7661 /* If we got a quit from within the menu computation,
7750 quit all the way out of it. This takes care of C-] in the debugger. */ 7662 quit all the way out of it. This takes care of C-] in the debugger. */
@@ -7757,8 +7669,7 @@ menu_item_eval_property_1 (arg)
7757/* Evaluate an expression and return the result (or nil if something 7669/* Evaluate an expression and return the result (or nil if something
7758 went wrong). Used to evaluate dynamic parts of menu items. */ 7670 went wrong). Used to evaluate dynamic parts of menu items. */
7759Lisp_Object 7671Lisp_Object
7760menu_item_eval_property (sexpr) 7672menu_item_eval_property (Lisp_Object sexpr)
7761 Lisp_Object sexpr;
7762{ 7673{
7763 int count = SPECPDL_INDEX (); 7674 int count = SPECPDL_INDEX ();
7764 Lisp_Object val; 7675 Lisp_Object val;
@@ -7778,9 +7689,7 @@ menu_item_eval_property (sexpr)
7778 otherwise. */ 7689 otherwise. */
7779 7690
7780int 7691int
7781parse_menu_item (item, inmenubar) 7692parse_menu_item (Lisp_Object item, int inmenubar)
7782 Lisp_Object item;
7783 int inmenubar;
7784{ 7693{
7785 Lisp_Object def, tem, item_string, start; 7694 Lisp_Object def, tem, item_string, start;
7786 Lisp_Object filter; 7695 Lisp_Object filter;
@@ -8088,9 +7997,7 @@ static void append_tool_bar_item (void);
8088 tool bar items found. */ 7997 tool bar items found. */
8089 7998
8090Lisp_Object 7999Lisp_Object
8091tool_bar_items (reuse, nitems) 8000tool_bar_items (Lisp_Object reuse, int *nitems)
8092 Lisp_Object reuse;
8093 int *nitems;
8094{ 8001{
8095 Lisp_Object *maps; 8002 Lisp_Object *maps;
8096 int nmaps, i; 8003 int nmaps, i;
@@ -8168,9 +8075,7 @@ tool_bar_items (reuse, nitems)
8168/* Process the definition of KEY which is DEF. */ 8075/* Process the definition of KEY which is DEF. */
8169 8076
8170static void 8077static void
8171process_tool_bar_item (key, def, data, args) 8078process_tool_bar_item (Lisp_Object key, Lisp_Object def, Lisp_Object data, void *args)
8172 Lisp_Object key, def, data;
8173 void *args;
8174{ 8079{
8175 int i; 8080 int i;
8176 extern Lisp_Object Qundefined; 8081 extern Lisp_Object Qundefined;
@@ -8255,8 +8160,7 @@ process_tool_bar_item (key, def, data, args)
8255 A text label to show with the tool bar button if labels are enabled. */ 8160 A text label to show with the tool bar button if labels are enabled. */
8256 8161
8257static int 8162static int
8258parse_tool_bar_item (key, item) 8163parse_tool_bar_item (Lisp_Object key, Lisp_Object item)
8259 Lisp_Object key, item;
8260{ 8164{
8261 /* Access slot with index IDX of vector tool_bar_item_properties. */ 8165 /* Access slot with index IDX of vector tool_bar_item_properties. */
8262#define PROP(IDX) XVECTOR (tool_bar_item_properties)->contents[IDX] 8166#define PROP(IDX) XVECTOR (tool_bar_item_properties)->contents[IDX]
@@ -8386,7 +8290,7 @@ parse_tool_bar_item (key, item)
8386 EMACS_INT max_lbl = 2*tool_bar_max_label_size; 8290 EMACS_INT max_lbl = 2*tool_bar_max_label_size;
8387 Lisp_Object new_lbl; 8291 Lisp_Object new_lbl;
8388 8292
8389 if (strlen (caption) < max_lbl && caption[0] != '\0') 8293 if (strlen (caption) < max_lbl && caption[0] != '\0')
8390 { 8294 {
8391 strcpy (buf, caption); 8295 strcpy (buf, caption);
8392 while (buf[0] != '\0' && buf[strlen (buf) -1] == '.') 8296 while (buf[0] != '\0' && buf[strlen (buf) -1] == '.')
@@ -8398,17 +8302,17 @@ parse_tool_bar_item (key, item)
8398 if (strlen (caption) <= max_lbl) 8302 if (strlen (caption) <= max_lbl)
8399 label = caption; 8303 label = caption;
8400 8304
8401 if (strlen (label) <= max_lbl && label[0] != '\0') 8305 if (strlen (label) <= max_lbl && label[0] != '\0')
8402 { 8306 {
8403 int i; 8307 int i;
8404 if (label != buf) strcpy (buf, label); 8308 if (label != buf) strcpy (buf, label);
8405 8309
8406 for (i = 0; i < strlen (buf); ++i) 8310 for (i = 0; i < strlen (buf); ++i)
8407 { 8311 {
8408 if (buf[i] == '-') buf[i] = ' '; 8312 if (buf[i] == '-') buf[i] = ' ';
8409 } 8313 }
8410 label = buf; 8314 label = buf;
8411 8315
8412 } 8316 }
8413 else label = ""; 8317 else label = "";
8414 8318
@@ -8448,8 +8352,7 @@ parse_tool_bar_item (key, item)
8448 that can be reused. */ 8352 that can be reused. */
8449 8353
8450static void 8354static void
8451init_tool_bar_items (reuse) 8355init_tool_bar_items (Lisp_Object reuse)
8452 Lisp_Object reuse;
8453{ 8356{
8454 if (VECTORP (reuse)) 8357 if (VECTORP (reuse))
8455 tool_bar_items_vector = reuse; 8358 tool_bar_items_vector = reuse;
@@ -8463,7 +8366,7 @@ init_tool_bar_items (reuse)
8463 tool_bar_item_properties */ 8366 tool_bar_item_properties */
8464 8367
8465static void 8368static void
8466append_tool_bar_item () 8369append_tool_bar_item (void)
8467{ 8370{
8468 Lisp_Object *to, *from; 8371 Lisp_Object *to, *from;
8469 8372
@@ -8507,11 +8410,8 @@ append_tool_bar_item ()
8507 and do auto-saving in the inner call of read_char. */ 8410 and do auto-saving in the inner call of read_char. */
8508 8411
8509static Lisp_Object 8412static Lisp_Object
8510read_char_x_menu_prompt (nmaps, maps, prev_event, used_mouse_menu) 8413read_char_x_menu_prompt (int nmaps, Lisp_Object *maps, Lisp_Object prev_event,
8511 int nmaps; 8414 int *used_mouse_menu)
8512 Lisp_Object *maps;
8513 Lisp_Object prev_event;
8514 int *used_mouse_menu;
8515{ 8415{
8516 int mapno; 8416 int mapno;
8517 8417
@@ -8595,10 +8495,7 @@ static char *read_char_minibuf_menu_text;
8595static int read_char_minibuf_menu_width; 8495static int read_char_minibuf_menu_width;
8596 8496
8597static Lisp_Object 8497static Lisp_Object
8598read_char_minibuf_menu_prompt (commandflag, nmaps, maps) 8498read_char_minibuf_menu_prompt (int commandflag, int nmaps, Lisp_Object *maps)
8599 int commandflag ;
8600 int nmaps;
8601 Lisp_Object *maps;
8602{ 8499{
8603 int mapno; 8500 int mapno;
8604 register Lisp_Object name; 8501 register Lisp_Object name;
@@ -8863,10 +8760,8 @@ read_char_minibuf_menu_prompt (commandflag, nmaps, maps)
8863 NEXT may be the same array as CURRENT. */ 8760 NEXT may be the same array as CURRENT. */
8864 8761
8865static int 8762static int
8866follow_key (key, nmaps, current, defs, next) 8763follow_key (Lisp_Object key, int nmaps, Lisp_Object *current, Lisp_Object *defs,
8867 Lisp_Object key; 8764 Lisp_Object *next)
8868 Lisp_Object *current, *defs, *next;
8869 int nmaps;
8870{ 8765{
8871 int i, first_binding; 8766 int i, first_binding;
8872 8767
@@ -8915,9 +8810,8 @@ typedef struct keyremap
8915 that it is indeed a vector). */ 8810 that it is indeed a vector). */
8916 8811
8917static Lisp_Object 8812static Lisp_Object
8918access_keymap_keyremap (map, key, prompt, do_funcall) 8813access_keymap_keyremap (Lisp_Object map, Lisp_Object key, Lisp_Object prompt,
8919 Lisp_Object map, key, prompt; 8814 int do_funcall)
8920 int do_funcall;
8921{ 8815{
8922 Lisp_Object next; 8816 Lisp_Object next;
8923 8817
@@ -8968,10 +8862,8 @@ access_keymap_keyremap (map, key, prompt, do_funcall)
8968 The return value is non-zero if the remapping actually took place. */ 8862 The return value is non-zero if the remapping actually took place. */
8969 8863
8970static int 8864static int
8971keyremap_step (keybuf, bufsize, fkey, input, doit, diff, prompt) 8865keyremap_step (Lisp_Object *keybuf, int bufsize, volatile keyremap *fkey,
8972 Lisp_Object *keybuf, prompt; 8866 int input, int doit, int *diff, Lisp_Object prompt)
8973 keyremap *fkey;
8974 int input, doit, *diff, bufsize;
8975{ 8867{
8976 Lisp_Object next, key; 8868 Lisp_Object next, key;
8977 8869
@@ -9063,14 +8955,9 @@ keyremap_step (keybuf, bufsize, fkey, input, doit, diff, prompt)
9063 from the selected window's buffer. */ 8955 from the selected window's buffer. */
9064 8956
9065static int 8957static int
9066read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last, 8958read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
9067 can_return_switch_frame, fix_current_buffer) 8959 int dont_downcase_last, int can_return_switch_frame,
9068 Lisp_Object *keybuf; 8960 int fix_current_buffer)
9069 int bufsize;
9070 Lisp_Object prompt;
9071 int dont_downcase_last;
9072 int can_return_switch_frame;
9073 int fix_current_buffer;
9074{ 8961{
9075 volatile Lisp_Object from_string; 8962 volatile Lisp_Object from_string;
9076 volatile int count = SPECPDL_INDEX (); 8963 volatile int count = SPECPDL_INDEX ();
@@ -10565,7 +10452,7 @@ give to the command you invoke, if it asks for an argument. */)
10565/* Return nonzero if input events are pending. */ 10452/* Return nonzero if input events are pending. */
10566 10453
10567int 10454int
10568detect_input_pending () 10455detect_input_pending (void)
10569{ 10456{
10570 if (!input_pending) 10457 if (!input_pending)
10571 get_input_pending (&input_pending, 0); 10458 get_input_pending (&input_pending, 0);
@@ -10577,7 +10464,7 @@ detect_input_pending ()
10577 pending. */ 10464 pending. */
10578 10465
10579int 10466int
10580detect_input_pending_ignore_squeezables () 10467detect_input_pending_ignore_squeezables (void)
10581{ 10468{
10582 if (!input_pending) 10469 if (!input_pending)
10583 get_input_pending (&input_pending, READABLE_EVENTS_IGNORE_SQUEEZABLES); 10470 get_input_pending (&input_pending, READABLE_EVENTS_IGNORE_SQUEEZABLES);
@@ -10588,8 +10475,7 @@ detect_input_pending_ignore_squeezables ()
10588/* Return nonzero if input events are pending, and run any pending timers. */ 10475/* Return nonzero if input events are pending, and run any pending timers. */
10589 10476
10590int 10477int
10591detect_input_pending_run_timers (do_display) 10478detect_input_pending_run_timers (int do_display)
10592 int do_display;
10593{ 10479{
10594 int old_timers_run = timers_run; 10480 int old_timers_run = timers_run;
10595 10481
@@ -10620,7 +10506,7 @@ detect_input_pending_run_timers (do_display)
10620 So calling this function unnecessarily can't do any harm. */ 10506 So calling this function unnecessarily can't do any harm. */
10621 10507
10622void 10508void
10623clear_input_pending () 10509clear_input_pending (void)
10624{ 10510{
10625 input_pending = 0; 10511 input_pending = 0;
10626} 10512}
@@ -10632,7 +10518,7 @@ clear_input_pending ()
10632 to do in that case. It isn't trivial. */ 10518 to do in that case. It isn't trivial. */
10633 10519
10634int 10520int
10635requeued_events_pending_p () 10521requeued_events_pending_p (void)
10636{ 10522{
10637 return (!NILP (Vunread_command_events) || unread_command_char != -1); 10523 return (!NILP (Vunread_command_events) || unread_command_char != -1);
10638} 10524}
@@ -10904,8 +10790,7 @@ On such systems, Emacs starts a subshell instead of suspending. */)
10904 Then in any case stuff anything Emacs has read ahead and not used. */ 10790 Then in any case stuff anything Emacs has read ahead and not used. */
10905 10791
10906void 10792void
10907stuff_buffered_input (stuffstring) 10793stuff_buffered_input (Lisp_Object stuffstring)
10908 Lisp_Object stuffstring;
10909{ 10794{
10910#ifdef SIGTSTP /* stuff_char is defined if SIGTSTP. */ 10795#ifdef SIGTSTP /* stuff_char is defined if SIGTSTP. */
10911 register unsigned char *p; 10796 register unsigned char *p;
@@ -10943,8 +10828,7 @@ stuff_buffered_input (stuffstring)
10943} 10828}
10944 10829
10945void 10830void
10946set_waiting_for_input (time_to_clear) 10831set_waiting_for_input (struct timeval *time_to_clear)
10947 EMACS_TIME *time_to_clear;
10948{ 10832{
10949 input_available_clear_time = time_to_clear; 10833 input_available_clear_time = time_to_clear;
10950 10834
@@ -10958,7 +10842,7 @@ set_waiting_for_input (time_to_clear)
10958} 10842}
10959 10843
10960void 10844void
10961clear_waiting_for_input () 10845clear_waiting_for_input (void)
10962{ 10846{
10963 /* Tell handle_interrupt not to throw back to read_char, */ 10847 /* Tell handle_interrupt not to throw back to read_char, */
10964 waiting_for_input = 0; 10848 waiting_for_input = 0;
@@ -10972,8 +10856,8 @@ clear_waiting_for_input ()
10972 Otherwise, the handler kills Emacs. */ 10856 Otherwise, the handler kills Emacs. */
10973 10857
10974static SIGTYPE 10858static SIGTYPE
10975interrupt_signal (signalnum) /* If we don't have an argument, */ 10859interrupt_signal (int signalnum) /* If we don't have an argument, some */
10976 int signalnum; /* some compilers complain in signal calls. */ 10860 /* compilers complain in signal calls. */
10977{ 10861{
10978 /* Must preserve main program's value of errno. */ 10862 /* Must preserve main program's value of errno. */
10979 int old_errno = errno; 10863 int old_errno = errno;
@@ -11017,7 +10901,7 @@ interrupt_signal (signalnum) /* If we don't have an argument, */
11017 non-nil, it stops the job right away. */ 10901 non-nil, it stops the job right away. */
11018 10902
11019static void 10903static void
11020handle_interrupt () 10904handle_interrupt (void)
11021{ 10905{
11022 char c; 10906 char c;
11023 10907
@@ -11143,7 +11027,7 @@ handle_interrupt ()
11143/* Handle a C-g by making read_char return C-g. */ 11027/* Handle a C-g by making read_char return C-g. */
11144 11028
11145void 11029void
11146quit_throw_to_read_char () 11030quit_throw_to_read_char (void)
11147{ 11031{
11148 sigfree (); 11032 sigfree ();
11149 /* Prevent another signal from doing this before we finish. */ 11033 /* Prevent another signal from doing this before we finish. */
@@ -11478,8 +11362,7 @@ The `posn-' functions access elements of such lists. */)
11478 * Set up a new kboard object with reasonable initial values. 11362 * Set up a new kboard object with reasonable initial values.
11479 */ 11363 */
11480void 11364void
11481init_kboard (kb) 11365init_kboard (KBOARD *kb)
11482 KBOARD *kb;
11483{ 11366{
11484 kb->Voverriding_terminal_local_map = Qnil; 11367 kb->Voverriding_terminal_local_map = Qnil;
11485 kb->Vlast_command = Qnil; 11368 kb->Vlast_command = Qnil;
@@ -11513,8 +11396,7 @@ init_kboard (kb)
11513 * it a second time. 11396 * it a second time.
11514 */ 11397 */
11515static void 11398static void
11516wipe_kboard (kb) 11399wipe_kboard (KBOARD *kb)
11517 KBOARD *kb;
11518{ 11400{
11519 xfree (kb->kbd_macro_buffer); 11401 xfree (kb->kbd_macro_buffer);
11520} 11402}
@@ -11522,8 +11404,7 @@ wipe_kboard (kb)
11522/* Free KB and memory referenced from it. */ 11404/* Free KB and memory referenced from it. */
11523 11405
11524void 11406void
11525delete_kboard (kb) 11407delete_kboard (KBOARD *kb)
11526 KBOARD *kb;
11527{ 11408{
11528 KBOARD **kbp; 11409 KBOARD **kbp;
11529 11410
@@ -11548,7 +11429,7 @@ delete_kboard (kb)
11548} 11429}
11549 11430
11550void 11431void
11551init_keyboard () 11432init_keyboard (void)
11552{ 11433{
11553 /* This is correct before outermost invocation of the editor loop */ 11434 /* This is correct before outermost invocation of the editor loop */
11554 command_loop_level = -1; 11435 command_loop_level = -1;
@@ -11648,7 +11529,7 @@ struct event_head head_table[] = {
11648}; 11529};
11649 11530
11650void 11531void
11651syms_of_keyboard () 11532syms_of_keyboard (void)
11652{ 11533{
11653 pending_funcalls = Qnil; 11534 pending_funcalls = Qnil;
11654 staticpro (&pending_funcalls); 11535 staticpro (&pending_funcalls);
@@ -12424,7 +12305,7 @@ and tool-bar buttons. */);
12424} 12305}
12425 12306
12426void 12307void
12427keys_of_keyboard () 12308keys_of_keyboard (void)
12428{ 12309{
12429 initial_define_key (global_map, Ctl ('Z'), "suspend-emacs"); 12310 initial_define_key (global_map, Ctl ('Z'), "suspend-emacs");
12430 initial_define_key (control_x_map, Ctl ('Z'), "suspend-emacs"); 12311 initial_define_key (control_x_map, Ctl ('Z'), "suspend-emacs");
@@ -12484,7 +12365,7 @@ keys_of_keyboard ()
12484/* Mark the pointers in the kboard objects. 12365/* Mark the pointers in the kboard objects.
12485 Called by the Fgarbage_collector. */ 12366 Called by the Fgarbage_collector. */
12486void 12367void
12487mark_kboards () 12368mark_kboards (void)
12488{ 12369{
12489 KBOARD *kb; 12370 KBOARD *kb;
12490 Lisp_Object *p; 12371 Lisp_Object *p;