Lines Matching full:scp

82 static void history_to_screen(scr_stat *scp);
86 sc_alloc_history_buffer(scr_stat *scp, int lines, int prev_ysize, int wait) in sc_alloc_history_buffer() argument
90 * SC_HISTORY_SIZE lines or scp->ysize lines, whichever in sc_alloc_history_buffer()
104 lines = imax(lines, scp->ysize); in sc_alloc_history_buffer()
107 history = prev_history = scp->history; in sc_alloc_history_buffer()
108 scp->history = NULL; in sc_alloc_history_buffer()
120 min_lines = imax(SC_HISTORY_SIZE, scp->ysize); in sc_alloc_history_buffer()
124 scp->history = prev_history; in sc_alloc_history_buffer()
137 sc_vtb_init(history, VTB_RINGBUFFER, scp->xsize, lines, in sc_alloc_history_buffer()
140 sc_vtb_clear(history, scp->sc->scr_map[0x20], in sc_alloc_history_buffer()
144 scp->history_pos = sc_vtb_tail(history); in sc_alloc_history_buffer()
146 scp->history_pos = 0; in sc_alloc_history_buffer()
156 scp->history = history; in sc_alloc_history_buffer()
187 sc_free_history_buffer(scr_stat *scp, int prev_ysize) in sc_free_history_buffer() argument
193 history = scp->history; in sc_free_history_buffer()
194 scp->history = NULL; in sc_free_history_buffer()
209 sc_hist_save(scr_stat *scp) in sc_hist_save() argument
211 sc_vtb_append(&scp->vtb, 0, scp->history, scp->xsize*scp->ysize); in sc_hist_save()
212 scp->history_pos = sc_vtb_tail(scp->history); in sc_hist_save()
217 sc_hist_restore(scr_stat *scp) in sc_hist_restore() argument
221 if (scp->history_pos != sc_vtb_tail(scp->history)) { in sc_hist_restore()
222 scp->history_pos = sc_vtb_tail(scp->history); in sc_hist_restore()
223 history_to_screen(scp); in sc_hist_restore()
228 sc_vtb_seek(scp->history, sc_vtb_pos(scp->history, in sc_hist_restore()
229 sc_vtb_tail(scp->history), in sc_hist_restore()
230 -scp->xsize*scp->ysize)); in sc_hist_restore()
236 history_to_screen(scr_stat *scp) in history_to_screen() argument
241 pos = scp->history_pos; in history_to_screen()
242 for (i = 1; i <= scp->ysize; ++i) { in history_to_screen()
243 pos = sc_vtb_pos(scp->history, pos, -scp->xsize); in history_to_screen()
244 sc_vtb_copy(scp->history, pos, in history_to_screen()
245 &scp->vtb, scp->xsize*(scp->ysize - i), in history_to_screen()
246 scp->xsize); in history_to_screen()
248 mark_all(scp); in history_to_screen()
253 sc_hist_home(scr_stat *scp) in sc_hist_home() argument
255 scp->history_pos = sc_vtb_tail(scp->history); in sc_hist_home()
256 history_to_screen(scp); in sc_hist_home()
261 sc_hist_end(scr_stat *scp) in sc_hist_end() argument
263 scp->history_pos = sc_vtb_pos(scp->history, sc_vtb_tail(scp->history), in sc_hist_end()
264 scp->xsize*scp->ysize); in sc_hist_end()
265 history_to_screen(scp); in sc_hist_end()
270 sc_hist_up_line(scr_stat *scp) in sc_hist_up_line() argument
272 if (sc_vtb_pos(scp->history, scp->history_pos, -(scp->xsize*scp->ysize)) in sc_hist_up_line()
273 == sc_vtb_tail(scp->history)) in sc_hist_up_line()
275 scp->history_pos = sc_vtb_pos(scp->history, scp->history_pos, in sc_hist_up_line()
276 -scp->xsize); in sc_hist_up_line()
277 history_to_screen(scp); in sc_hist_up_line()
283 sc_hist_down_line(scr_stat *scp) in sc_hist_down_line() argument
285 if (scp->history_pos == sc_vtb_tail(scp->history)) in sc_hist_down_line()
287 scp->history_pos = sc_vtb_pos(scp->history, scp->history_pos, in sc_hist_down_line()
288 scp->xsize); in sc_hist_down_line()
289 history_to_screen(scp); in sc_hist_down_line()
296 scr_stat *scp; in sc_hist_ioctl() local
301 scp = SC_STAT(tp); in sc_hist_ioctl()
304 if (scp->status & BUFFER_SAVED) in sc_hist_ioctl()
307 *(int *)data, scp->ysize, extra_history_size)); in sc_hist_ioctl()
308 error = sc_alloc_history_buffer(scp, in sc_hist_ioctl()
309 imax(*(int *)data, scp->ysize), in sc_hist_ioctl()
310 scp->ysize, TRUE); in sc_hist_ioctl()
312 sc_vtb_rows(scp->history), extra_history_size)); in sc_hist_ioctl()
316 scp = SC_STAT(tp); in sc_hist_ioctl()
317 sc_vtb_clear(scp->history, scp->sc->scr_map[0x20], in sc_hist_ioctl()