Mercurial > hg > xemacs-beta
comparison src/console-stream.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 | d674024a8674 |
children | d1247f3cc363 |
comparison
equal
deleted
inserted
replaced
5117:3742ea8250b5 | 5118:e0db3c197671 |
---|---|
51 static const struct memory_description stream_console_data_description_1 [] = { | 51 static const struct memory_description stream_console_data_description_1 [] = { |
52 { XD_LISP_OBJECT, offsetof (struct stream_console, instream) }, | 52 { XD_LISP_OBJECT, offsetof (struct stream_console, instream) }, |
53 { XD_END } | 53 { XD_END } |
54 }; | 54 }; |
55 | 55 |
56 #ifdef NEW_GC | |
57 DEFINE_DUMPABLE_INTERNAL_LISP_OBJECT ("stream-console", stream_console, | |
58 0, stream_console_data_description_1, | |
59 Lisp_Stream_Console); | |
60 #else /* not NEW_GC */ | |
56 const struct sized_memory_description stream_console_data_description = { | 61 const struct sized_memory_description stream_console_data_description = { |
57 sizeof (struct stream_console), stream_console_data_description_1 | 62 sizeof (struct stream_console), stream_console_data_description_1 |
58 }; | 63 }; |
64 #endif /* not NEW_GC */ | |
59 | 65 |
60 static void | 66 static void |
61 stream_init_console (struct console *con, Lisp_Object UNUSED (params)) | 67 stream_init_console (struct console *con, Lisp_Object UNUSED (params)) |
62 { | 68 { |
63 Lisp_Object tty = CONSOLE_CONNECTION (con); | 69 Lisp_Object tty = CONSOLE_CONNECTION (con); |
64 struct stream_console *stream_con; | 70 struct stream_console *stream_con; |
65 | 71 |
72 #ifdef NEW_GC | |
73 if (CONSOLE_STREAM_DATA (con) == NULL) | |
74 CONSOLE_STREAM_DATA (con) = alloc_lrecord_type (struct stream_console, | |
75 &lrecord_stream_console); | |
76 #else /* not NEW_GC */ | |
66 if (CONSOLE_STREAM_DATA (con) == NULL) | 77 if (CONSOLE_STREAM_DATA (con) == NULL) |
67 CONSOLE_STREAM_DATA (con) = xnew_and_zero (struct stream_console); | 78 CONSOLE_STREAM_DATA (con) = xnew_and_zero (struct stream_console); |
79 #endif /* not NEW_GC */ | |
68 | 80 |
69 stream_con = CONSOLE_STREAM_DATA (con); | 81 stream_con = CONSOLE_STREAM_DATA (con); |
70 | 82 |
71 stream_con->instream = Qnil; | 83 stream_con->instream = Qnil; |
72 | 84 |
121 fflush (stream_con->out); | 133 fflush (stream_con->out); |
122 } | 134 } |
123 if (stream_con->in != stdin) | 135 if (stream_con->in != stdin) |
124 retry_fclose (stream_con->in); | 136 retry_fclose (stream_con->in); |
125 | 137 |
138 #ifndef NEW_GC | |
126 xfree (stream_con, struct stream_console *); | 139 xfree (stream_con, struct stream_console *); |
140 #endif /* not NEW_GC */ | |
127 CONSOLE_STREAM_DATA (con) = NULL; | 141 CONSOLE_STREAM_DATA (con) = NULL; |
128 } | 142 } |
129 } | 143 } |
130 | 144 |
131 Lisp_Object | 145 Lisp_Object |