comparison src/console.c @ 380:8626e4521993 r21-2-5

Import from CVS: tag r21-2-5
author cvs
date Mon, 13 Aug 2007 11:07:10 +0200
parents cc15677e0335
children 74fd4e045ea6
comparison
equal deleted inserted replaced
379:76b7d63099ad 380:8626e4521993
98 static Lisp_Object 98 static Lisp_Object
99 mark_console (Lisp_Object obj, void (*markobj) (Lisp_Object)) 99 mark_console (Lisp_Object obj, void (*markobj) (Lisp_Object))
100 { 100 {
101 struct console *con = XCONSOLE (obj); 101 struct console *con = XCONSOLE (obj);
102 102
103 #define MARKED_SLOT(x) ((markobj) (con->x)); 103 #define MARKED_SLOT(x) ((void) (markobj (con->x)));
104 #include "conslots.h" 104 #include "conslots.h"
105 #undef MARKED_SLOT 105 #undef MARKED_SLOT
106 106
107 /* Can be zero for Vconsole_defaults, Vconsole_local_symbols */ 107 /* Can be zero for Vconsole_defaults, Vconsole_local_symbols */
108 if (con->conmeths) 108 if (con->conmeths)
109 { 109 {
110 ((markobj) (con->conmeths->symbol)); 110 markobj (con->conmeths->symbol);
111 MAYBE_CONMETH (con, mark_console, (con, markobj)); 111 MAYBE_CONMETH (con, mark_console, (con, markobj));
112 } 112 }
113 113
114 return Qnil; 114 return Qnil;
115 } 115 }
283 283
284 void 284 void
285 set_console_last_nonminibuf_frame (struct console *con, 285 set_console_last_nonminibuf_frame (struct console *con,
286 Lisp_Object frame) 286 Lisp_Object frame)
287 { 287 {
288 con->_last_nonminibuf_frame = frame; 288 con->last_nonminibuf_frame = frame;
289 } 289 }
290 290
291 DEFUN ("consolep", Fconsolep, 1, 1, 0, /* 291 DEFUN ("consolep", Fconsolep, 1, 1, 0, /*
292 Return non-nil if OBJECT is a console. 292 Return non-nil if OBJECT is a console.
293 */ 293 */
1139 #ifdef HAVE_WINDOW_SYSTEM 1139 #ifdef HAVE_WINDOW_SYSTEM
1140 Fprovide (intern ("window-system")); 1140 Fprovide (intern ("window-system"));
1141 #endif 1141 #endif
1142 } 1142 }
1143 1143
1144 /* DOC is ignored because it is snagged and recorded externally 1144 /* The docstrings for DEFVAR_* are recorded externally by make-docfile. */
1145 * by make-docfile */ 1145
1146 /* Declaring this stuff as const produces 'Cannot reinitialize' messages 1146 /* Declaring this stuff as const produces 'Cannot reinitialize' messages
1147 from SunPro C's fix-and-continue feature (a way neato feature that 1147 from SunPro C's fix-and-continue feature (a way neato feature that
1148 makes debugging unbelievably more bearable) */ 1148 makes debugging unbelievably more bearable) */
1149 #define DEFVAR_CONSOLE_LOCAL(lname, field_name) do { \ 1149 #define DEFVAR_CONSOLE_LOCAL_1(lname, field_name, forward_type, magicfun) do { \
1150 static CONST_IF_NOT_DEBUG struct symbol_value_forward I_hate_C \ 1150 static CONST_IF_NOT_DEBUG struct symbol_value_forward I_hate_C \
1151 = { { { symbol_value_forward_lheader_initializer, \ 1151 = { { { symbol_value_forward_lheader_initializer, \
1152 (struct lcrecord_header *) &(console_local_flags.field_name), 69 }, \ 1152 (struct lcrecord_header *) &(console_local_flags.field_name), 69 }, \
1153 SYMVAL_SELECTED_CONSOLE_FORWARD }, 0 }; \ 1153 forward_type }, magicfun }; \
1154 defvar_console_local ((lname), &I_hate_C); \ 1154 { \
1155 int offset = ((char *)symbol_value_forward_forward (&I_hate_C) \
1156 - (char *)&console_local_flags); \
1157 \
1158 defvar_magic (lname, &I_hate_C); \
1159 \
1160 *((Lisp_Object *)(offset + (char *)XCONSOLE (Vconsole_local_symbols))) \
1161 = intern (lname); \
1162 } \
1155 } while (0) 1163 } while (0)
1156 1164
1157 #define DEFVAR_CONSOLE_LOCAL_MAGIC(lname, field_name, magicfun) do { \ 1165 #define DEFVAR_CONSOLE_LOCAL_MAGIC(lname, field_name, magicfun) \
1158 static CONST_IF_NOT_DEBUG struct symbol_value_forward I_hate_C \ 1166 DEFVAR_CONSOLE_LOCAL_1 (lname, field_name, \
1159 = { { { symbol_value_forward_lheader_initializer, \ 1167 SYMVAL_SELECTED_CONSOLE_FORWARD, magicfun)
1160 (struct lcrecord_header *) &(console_local_flags.field_name), 69 }, \ 1168 #define DEFVAR_CONSOLE_LOCAL(lname, field_name) \
1161 SYMVAL_SELECTED_CONSOLE_FORWARD }, magicfun }; \ 1169 DEFVAR_CONSOLE_LOCAL_MAGIC (lname, field_name, 0)
1162 defvar_console_local ((lname), &I_hate_C); \ 1170 #define DEFVAR_CONST_CONSOLE_LOCAL_MAGIC(lname, field_name, magicfun) \
1163 } while (0) 1171 DEFVAR_CONSOLE_LOCAL_1 (lname, field_name, \
1164 1172 SYMVAL_CONST_SELECTED_CONSOLE_FORWARD, magicfun)
1165 #define DEFVAR_CONST_CONSOLE_LOCAL(lname, field_name) do { \ 1173 #define DEFVAR_CONST_CONSOLE_LOCAL(lname, field_name) \
1166 static CONST_IF_NOT_DEBUG struct symbol_value_forward I_hate_C \ 1174 DEFVAR_CONST_CONSOLE_LOCAL_MAGIC (lname, field_name, 0)
1167 = { { { symbol_value_forward_lheader_initializer, \ 1175
1168 (struct lcrecord_header *) &(console_local_flags.field_name), 69 }, \ 1176 #define DEFVAR_CONSOLE_DEFAULTS_MAGIC(lname, field_name, magicfun) \
1169 SYMVAL_CONST_SELECTED_CONSOLE_FORWARD }, 0 }; \ 1177 DEFVAR_SYMVAL_FWD(lname, &(console_local_flags.field_name), \
1170 defvar_console_local ((lname), &I_hate_C); \ 1178 SYMVAL_DEFAULT_CONSOLE_FORWARD, magicfun)
1171 } while (0) 1179 #define DEFVAR_CONSOLE_DEFAULTS(lname, field_name) \
1172 1180 DEFVAR_CONSOLE_DEFAULTS_MAGIC (lname, field_name, 0)
1173 #define DEFVAR_CONST_CONSOLE_LOCAL_MAGIC(lname, field_name, magicfun) do { \
1174 static CONST_IF_NOT_DEBUG struct symbol_value_forward I_hate_C \
1175 = { { { symbol_value_forward_lheader_initializer, \
1176 (struct lcrecord_header *) &(console_local_flags.field_name), 69 }, \
1177 SYMVAL_CONST_SELECTED_CONSOLE_FORWARD }, magicfun }; \
1178 defvar_console_local ((lname), &I_hate_C); \
1179 } while (0)
1180
1181 #define DEFVAR_CONSOLE_DEFAULTS(lname, field_name) do { \
1182 static CONST_IF_NOT_DEBUG struct symbol_value_forward I_hate_C \
1183 = { { { symbol_value_forward_lheader_initializer, \
1184 (struct lcrecord_header *) &(console_local_flags.field_name), 69 }, \
1185 SYMVAL_DEFAULT_CONSOLE_FORWARD }, 0 }; \
1186 defvar_mumble ((lname), &I_hate_C, sizeof (I_hate_C)); \
1187 } while (0)
1188
1189 #define DEFVAR_CONSOLE_DEFAULTS_MAGIC(lname, field_name, magicfun) do { \
1190 static CONST_IF_NOT_DEBUG struct symbol_value_forward I_hate_C \
1191 = { { { symbol_value_forward_lheader_initializer, \
1192 (struct lcrecord_header *) &(console_local_flags.field_name), 69 }, \
1193 SYMVAL_DEFAULT_CONSOLE_FORWARD }, magicfun }; \
1194 defvar_mumble ((lname), &I_hate_C, sizeof (I_hate_C)); \
1195 } while (0)
1196
1197 static void
1198 defvar_console_local (CONST char *namestring,
1199 CONST struct symbol_value_forward *m)
1200 {
1201 int offset = ((char *)symbol_value_forward_forward (m)
1202 - (char *)&console_local_flags);
1203
1204 defvar_mumble (namestring, m, sizeof (*m));
1205
1206 *((Lisp_Object *)(offset + (char *)XCONSOLE (Vconsole_local_symbols)))
1207 = intern (namestring);
1208 }
1209 1181
1210 static void 1182 static void
1211 nuke_all_console_slots (struct console *con, Lisp_Object zap) 1183 nuke_all_console_slots (struct console *con, Lisp_Object zap)
1212 { 1184 {
1213 zero_lcrecord (con); 1185 zero_lcrecord (con);