Mercurial > hg > xemacs-beta
comparison src/console.c @ 5118:e0db3c197671 ben-lisp-object
merge up to latest default branch, doesn't compile yet
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Sat, 26 Dec 2009 21:18:49 -0600 |
parents | 3742ea8250b5 d674024a8674 |
children | d1247f3cc363 |
comparison
equal
deleted
inserted
replaced
5117:3742ea8250b5 | 5118:e0db3c197671 |
---|---|
113 | 113 |
114 | 114 |
115 | 115 |
116 static const struct memory_description console_data_description_1 []= { | 116 static const struct memory_description console_data_description_1 []= { |
117 #ifdef HAVE_TTY | 117 #ifdef HAVE_TTY |
118 #ifdef NEW_GC | |
119 { XD_LISP_OBJECT, tty_console }, | |
120 #else /* not NEW_GC */ | |
118 { XD_BLOCK_PTR, tty_console, 1, { &tty_console_data_description} }, | 121 { XD_BLOCK_PTR, tty_console, 1, { &tty_console_data_description} }, |
122 #endif /* not NEW_GC */ | |
119 #endif | 123 #endif |
124 #ifdef NEW_GC | |
125 { XD_LISP_OBJECT, stream_console }, | |
126 #else /* not NEW_GC */ | |
120 { XD_BLOCK_PTR, stream_console, 1, { &stream_console_data_description} }, | 127 { XD_BLOCK_PTR, stream_console, 1, { &stream_console_data_description} }, |
128 #endif /* not NEW_GC */ | |
121 { XD_END } | 129 { XD_END } |
122 }; | 130 }; |
123 | 131 |
124 static const struct sized_memory_description console_data_description = { | 132 static const struct sized_memory_description console_data_description = { |
125 sizeof (void *), console_data_description_1 | 133 sizeof (void *), console_data_description_1 |
170 write_fmt_string_lisp (printcharfun, " on %S", 1, | 178 write_fmt_string_lisp (printcharfun, " on %S", 1, |
171 CONSOLE_CONNECTION (con)); | 179 CONSOLE_CONNECTION (con)); |
172 write_fmt_string (printcharfun, " 0x%x>", con->header.uid); | 180 write_fmt_string (printcharfun, " 0x%x>", con->header.uid); |
173 } | 181 } |
174 | 182 |
175 DEFINE_NONDUMPABLE_LISP_OBJECT ("console", console, mark_console, | 183 DEFINE_NODUMP_LISP_OBJECT ("console", console, mark_console, |
176 print_console, 0, 0, 0, | 184 print_console, 0, 0, 0, |
177 console_description, | 185 console_description, |
178 struct console); | 186 struct console); |
179 | 187 |
180 | 188 |
978 /* If STUFFSTRING is a string, stuff its contents as pending terminal input. | 986 /* If STUFFSTRING is a string, stuff its contents as pending terminal input. |
979 Then in any case stuff anything Emacs has read ahead and not used. */ | 987 Then in any case stuff anything Emacs has read ahead and not used. */ |
980 | 988 |
981 void | 989 void |
982 stuff_buffered_input ( | 990 stuff_buffered_input ( |
983 #ifdef BSD | 991 #if defined(BSD) && defined(HAVE_TTY) |
984 Lisp_Object stuffstring | 992 Lisp_Object stuffstring |
985 #else | 993 #else |
986 Lisp_Object UNUSED (stuffstring) | 994 Lisp_Object UNUSED (stuffstring) |
987 #endif | 995 #endif |
988 ) | 996 ) |
989 { | 997 { |
990 /* stuff_char works only in BSD, versions 4.2 and up. */ | 998 /* stuff_char works only in BSD, versions 4.2 and up. */ |
991 #if defined (BSD) | 999 #if defined(BSD) && defined(HAVE_TTY) |
992 if (!CONSOLEP (Vcontrolling_terminal) || | 1000 if (!CONSOLEP (Vcontrolling_terminal) || |
993 !CONSOLE_LIVE_P (XCONSOLE (Vcontrolling_terminal))) | 1001 !CONSOLE_LIVE_P (XCONSOLE (Vcontrolling_terminal))) |
994 return; | 1002 return; |
995 | 1003 |
996 if (STRINGP (stuffstring)) | 1004 if (STRINGP (stuffstring)) |
1012 if (kbd_fetch_ptr == kbd_buffer + KBD_BUFFER_SIZE) | 1020 if (kbd_fetch_ptr == kbd_buffer + KBD_BUFFER_SIZE) |
1013 kbd_fetch_ptr = kbd_buffer; | 1021 kbd_fetch_ptr = kbd_buffer; |
1014 stuff_char (XCONSOLE (Vcontrolling_terminal), *kbd_fetch_ptr++); | 1022 stuff_char (XCONSOLE (Vcontrolling_terminal), *kbd_fetch_ptr++); |
1015 } | 1023 } |
1016 # endif | 1024 # endif |
1017 #endif /* BSD */ | 1025 #endif /* BSD && HAVE_TTY */ |
1018 } | 1026 } |
1019 | 1027 |
1020 DEFUN ("suspend-console", Fsuspend_console, 0, 1, "", /* | 1028 DEFUN ("suspend-console", Fsuspend_console, 0, 1, "", /* |
1021 Suspend a console. For tty consoles, it sends a signal to suspend | 1029 Suspend a console. For tty consoles, it sends a signal to suspend |
1022 the process in charge of the tty, and removes the devices and | 1030 the process in charge of the tty, and removes the devices and |
1185 | 1193 |
1186 void | 1194 void |
1187 syms_of_console (void) | 1195 syms_of_console (void) |
1188 { | 1196 { |
1189 INIT_LISP_OBJECT (console); | 1197 INIT_LISP_OBJECT (console); |
1198 #ifdef NEW_GC | |
1199 #ifdef HAVE_TTY | |
1200 INIT_LISP_OBJECT (tty_console); | |
1201 #endif | |
1202 INIT_LISP_OBJECT (stream_console); | |
1203 #endif /* NEW_GC */ | |
1190 | 1204 |
1191 DEFSUBR (Fvalid_console_type_p); | 1205 DEFSUBR (Fvalid_console_type_p); |
1192 DEFSUBR (Fconsole_type_list); | 1206 DEFSUBR (Fconsole_type_list); |
1193 DEFSUBR (Fcdfw_console); | 1207 DEFSUBR (Fcdfw_console); |
1194 DEFSUBR (Fselected_console); | 1208 DEFSUBR (Fselected_console); |
1307 Fprovide (intern ("window-system")); | 1321 Fprovide (intern ("window-system")); |
1308 #endif | 1322 #endif |
1309 } | 1323 } |
1310 | 1324 |
1311 /* The docstrings for DEFVAR_* are recorded externally by make-docfile. */ | 1325 /* The docstrings for DEFVAR_* are recorded externally by make-docfile. */ |
1312 #ifdef MC_ALLOC | 1326 #ifdef NEW_GC |
1313 #define DEFVAR_CONSOLE_LOCAL_1(lname, field_name, forward_type, magic_fun) \ | 1327 #define DEFVAR_CONSOLE_LOCAL_1(lname, field_name, forward_type, magic_fun) \ |
1314 do { \ | 1328 do { \ |
1315 struct symbol_value_forward *I_hate_C = \ | 1329 struct symbol_value_forward *I_hate_C = \ |
1316 alloc_lrecord_type (struct symbol_value_forward, \ | 1330 alloc_lrecord_type (struct symbol_value_forward, \ |
1317 &lrecord_symbol_value_forward); \ | 1331 &lrecord_symbol_value_forward); \ |
1331 \ | 1345 \ |
1332 *((Lisp_Object *)(offset + (char *)XCONSOLE (Vconsole_local_symbols))) \ | 1346 *((Lisp_Object *)(offset + (char *)XCONSOLE (Vconsole_local_symbols))) \ |
1333 = intern (lname); \ | 1347 = intern (lname); \ |
1334 } \ | 1348 } \ |
1335 } while (0) | 1349 } while (0) |
1336 #else /* not MC_ALLOC */ | 1350 #else /* not NEW_GC */ |
1337 #define DEFVAR_CONSOLE_LOCAL_1(lname, field_name, forward_type, magicfun) \ | 1351 #define DEFVAR_CONSOLE_LOCAL_1(lname, field_name, forward_type, magicfun) \ |
1338 do { \ | 1352 do { \ |
1339 static const struct symbol_value_forward I_hate_C = \ | 1353 static const struct symbol_value_forward I_hate_C = \ |
1340 { /* struct symbol_value_forward */ \ | 1354 { /* struct symbol_value_forward */ \ |
1341 { /* struct symbol_value_magic */ \ | 1355 { /* struct symbol_value_magic */ \ |
1364 \ | 1378 \ |
1365 *((Lisp_Object *)(offset + (char *)XCONSOLE (Vconsole_local_symbols))) \ | 1379 *((Lisp_Object *)(offset + (char *)XCONSOLE (Vconsole_local_symbols))) \ |
1366 = intern (lname); \ | 1380 = intern (lname); \ |
1367 } \ | 1381 } \ |
1368 } while (0) | 1382 } while (0) |
1369 #endif /* not MC_ALLOC */ | 1383 #endif /* not NEW_GC */ |
1370 | 1384 |
1371 #define DEFVAR_CONSOLE_LOCAL_MAGIC(lname, field_name, magicfun) \ | 1385 #define DEFVAR_CONSOLE_LOCAL_MAGIC(lname, field_name, magicfun) \ |
1372 DEFVAR_CONSOLE_LOCAL_1 (lname, field_name, \ | 1386 DEFVAR_CONSOLE_LOCAL_1 (lname, field_name, \ |
1373 SYMVAL_SELECTED_CONSOLE_FORWARD, magicfun) | 1387 SYMVAL_SELECTED_CONSOLE_FORWARD, magicfun) |
1374 #define DEFVAR_CONSOLE_LOCAL(lname, field_name) \ | 1388 #define DEFVAR_CONSOLE_LOCAL(lname, field_name) \ |