Lines Matching refs:sp

55 vs_busy(SCR *sp, const char *msg, busy_t btype)  in vs_busy()  argument
66 if (F_ISSET(sp, SC_EX | SC_SCR_EXWROTE)) in vs_busy()
69 gp = sp->gp; in vs_busy()
70 vip = VIP(sp); in vs_busy()
89 (void)gp->scr_cursor(sp, &vip->busy_oldy, &vip->busy_oldx); in vs_busy()
92 p = msg_cat(sp, msg, &len); in vs_busy()
93 (void)gp->scr_move(sp, LASTLINE(sp), 0); in vs_busy()
94 (void)gp->scr_addstr(sp, p, len); in vs_busy()
95 (void)gp->scr_cursor(sp, &notused, &vip->busy_fx); in vs_busy()
96 (void)gp->scr_clrtoeol(sp); in vs_busy()
97 (void)gp->scr_move(sp, LASTLINE(sp), vip->busy_fx); in vs_busy()
109 (void)gp->scr_move(sp, LASTLINE(sp), 0); in vs_busy()
110 (void)gp->scr_clrtoeol(sp); in vs_busy()
112 (void)gp->scr_move(sp, vip->busy_oldy, vip->busy_oldx); in vs_busy()
129 (void)gp->scr_move(sp, LASTLINE(sp), vip->busy_fx); in vs_busy()
130 (void)gp->scr_addstr(sp, flagc + vip->busy_ch++, 1); in vs_busy()
131 (void)gp->scr_move(sp, LASTLINE(sp), vip->busy_fx); in vs_busy()
134 (void)gp->scr_refresh(sp, 0); in vs_busy()
144 vs_home(SCR *sp) in vs_home() argument
146 (void)sp->gp->scr_move(sp, LASTLINE(sp), 0); in vs_home()
147 (void)sp->gp->scr_refresh(sp, 0); in vs_home()
157 vs_update(SCR *sp, const char *m1, const CHAR_T *m2) in vs_update() argument
164 gp = sp->gp; in vs_update()
174 if (F_ISSET(sp, SC_SCR_EXWROTE)) { in vs_update()
176 INT2CHAR(sp, m2, STRLEN(m2) + 1, np, nlen); in vs_update()
177 (void)ex_printf(sp, in vs_update()
179 (void)ex_fflush(sp); in vs_update()
186 (void)gp->scr_cursor(sp, &oldy, &oldx); in vs_update()
189 (void)gp->scr_move(sp, LASTLINE(sp), 0); in vs_update()
190 (void)gp->scr_clrtoeol(sp); in vs_update()
198 if (len > sp->cols - 2) in vs_update()
199 mlen = len = sp->cols - 2; in vs_update()
200 (void)gp->scr_addstr(sp, m1, mlen); in vs_update()
205 if (len + mlen > sp->cols - 2) in vs_update()
206 mlen = (sp->cols - 2) - len; in vs_update()
207 (void)gp->scr_waddstr(sp, m2, mlen); in vs_update()
210 (void)gp->scr_move(sp, oldy, oldx); in vs_update()
211 (void)gp->scr_refresh(sp, 0); in vs_update()
227 vs_msg(SCR *sp, mtype_t mtype, char *line, size_t len) in vs_msg() argument
234 gp = sp->gp; in vs_msg()
235 vip = VIP(sp); in vs_msg()
243 if (F_ISSET(sp, SC_TINPUT_INFO) || F_ISSET(gp, G_BELLSCHED)) in vs_msg()
244 if (F_ISSET(sp, SC_SCR_VI)) { in vs_msg()
246 (void)gp->scr_bell(sp); in vs_msg()
255 if (F_ISSET(sp, SC_TINPUT_INFO)) in vs_msg()
273 if (F_ISSET(sp, SC_EX | SC_SCR_EXWROTE)) { in vs_msg()
274 if (!F_ISSET(sp, SC_SCR_EX)) in vs_msg()
275 if (F_ISSET(sp, SC_SCR_EXWROTE)) { in vs_msg()
276 if (sp->gp->scr_screen(sp, SC_EX)) in vs_msg()
279 if (ex_init(sp)) in vs_msg()
283 (void)gp->scr_attr(sp, SA_INVERSE, 1); in vs_msg()
286 (void)gp->scr_attr(sp, SA_INVERSE, 0); in vs_msg()
289 F_CLR(sp, SC_EX_WAIT_NO); in vs_msg()
291 if (!F_ISSET(sp, SC_SCR_EX)) in vs_msg()
292 (void)sp->gp->scr_screen(sp, SC_VI); in vs_msg()
297 if (!F_ISSET(sp, SC_SCR_VI)) { in vs_msg()
298 (void)vs_msgsave(sp, mtype, line, len); in vs_msg()
303 (void)gp->scr_cursor(sp, &oldy, &oldx); in vs_msg()
307 vs_output(sp, mtype, line, len); in vs_msg()
335 if (IS_ONELINE(sp)) in vs_msg()
336 (void)msg_cmsg(sp, CMSG_CONT_S, &padding); in vs_msg()
341 maxcols = sp->cols - 1; in vs_msg()
344 vs_output(sp, vip->mtype, ".\n", 2); in vs_msg()
346 vs_output(sp, vip->mtype, ";", 1); in vs_msg()
347 vs_output(sp, M_NONE, " ", 1); in vs_msg()
371 vs_output(sp, mtype, s, e - s); in vs_msg()
374 vs_output(sp, M_NONE, "\n", 1); in vs_msg()
376 if (INTERRUPTED(sp)) in vs_msg()
380 ret: (void)gp->scr_move(sp, oldy, oldx); in vs_msg()
381 (void)gp->scr_refresh(sp, 0); in vs_msg()
389 vs_output(SCR *sp, mtype_t mtype, const char *line, int llen) in vs_output() argument
398 gp = sp->gp; in vs_output()
399 vip = VIP(sp); in vs_output()
411 if (len + vip->lcontinue > sp->cols) in vs_output()
412 len = sp->cols - vip->lcontinue; in vs_output()
421 if (!IS_ONELINE(sp)) { in vs_output()
423 (void)gp->scr_move(sp, in vs_output()
424 LASTLINE(sp) - 1, 0); in vs_output()
425 (void)gp->scr_clrtoeol(sp); in vs_output()
426 (void)vs_divider(sp); in vs_output()
431 if (vip->totalcount == sp->t_maxrows && in vs_output()
439 vs_scroll(sp, NULL, SCROLL_W_QUIT); in vs_output()
441 (void)gp->scr_move(sp, LASTLINE(sp), 0); in vs_output()
445 if (INTERRUPTED(sp)) in vs_output()
448 (void)gp->scr_move(sp, LASTLINE(sp), vip->lcontinue); in vs_output()
452 (void)gp->scr_attr(sp, SA_INVERSE, 1); in vs_output()
457 (void)gp->scr_addstr(sp, cbuf, cbp - cbuf); \ in vs_output()
476 (void)gp->scr_attr(sp, SA_INVERSE, 0); in vs_output()
479 (void)gp->scr_clrtoeol(sp); in vs_output()
495 gp->scr_cursor(sp, &notused, &vip->lcontinue); in vs_output()
508 vs_ex_resolve(SCR *sp, int *continuep) in vs_ex_resolve() argument
515 gp = sp->gp; in vs_ex_resolve()
516 vip = VIP(sp); in vs_ex_resolve()
524 vs_output(sp, vip->mtype, ".", 1); in vs_ex_resolve()
545 if (F_ISSET(sp, SC_SCR_EXWROTE)) { in vs_ex_resolve()
546 if (sp->gp->scr_screen(sp, SC_VI)) in vs_ex_resolve()
549 if (!F_ISSET(sp, SC_EX_WAIT_YES) && vip->totalcount < 2) { in vs_ex_resolve()
550 F_CLR(sp, SC_EX_WAIT_NO); in vs_ex_resolve()
555 F_CLR(sp, SC_EX_WAIT_YES); in vs_ex_resolve()
562 if (!F_ISSET(sp, SC_EX_WAIT_NO) && !INTERRUPTED(sp)) { in vs_ex_resolve()
563 wtype = F_ISSET(sp, SC_EXIT | SC_EXIT_FORCE | in vs_ex_resolve()
565 if (F_ISSET(sp, SC_SCR_EXWROTE)) in vs_ex_resolve()
566 vs_wait(sp, continuep, wtype); in vs_ex_resolve()
568 vs_scroll(sp, continuep, wtype); in vs_ex_resolve()
574 if (F_ISSET(sp, SC_SCR_EXWROTE)) in vs_ex_resolve()
581 if (TAILQ_NEXT(sp, q) != NULL) in vs_ex_resolve()
582 F_SET(sp, SC_SCR_REDRAW); in vs_ex_resolve()
586 F_SET(sp, SC_SCR_REFORMAT); in vs_ex_resolve()
589 (void)gp->scr_attr(sp, SA_ALTERNATE, 1); in vs_ex_resolve()
595 F_CLR(sp, SC_SCR_EXWROTE | SC_EX_WAIT_NO); in vs_ex_resolve()
610 sp->rows ? 1 : sp->rows - vip->totalcount; in vs_ex_resolve()
611 ev.e_tlno = sp->rows; in vs_ex_resolve()
617 (void)vs_repaint(sp, &ev); in vs_ex_resolve()
632 vs_resolve(SCR *sp, SCR *csp, int forcewait) in vs_resolve() argument
648 gp = sp->gp; in vs_resolve()
649 vip = VIP(sp); in vs_resolve()
651 csp = sp; in vs_resolve()
659 (void)gp->scr_bell(sp); in vs_resolve()
663 if (F_ISSET(sp, SC_STATUS)) { in vs_resolve()
664 F_CLR(sp, SC_STATUS); in vs_resolve()
665 msgq_status(sp, sp->lno, MSTAT_TRUNCATE); in vs_resolve()
669 mod_rpt(sp); in vs_resolve()
678 if (!F_ISSET(sp, SC_SCR_VI) && vs_refresh(sp, 1)) in vs_resolve()
681 gp->scr_msg(sp, mp->mtype, mp->buf, mp->len); in vs_resolve()
699 vs_scroll(sp, NULL, SCROLL_W); in vs_resolve()
710 vs_scroll(sp, NULL, SCROLL_W); in vs_resolve()
714 sp->rows ? 1 : sp->rows - vip->totalcount; in vs_resolve()
715 ev.e_tlno = sp->rows; in vs_resolve()
726 (void)vs_repaint(sp, &ev); in vs_resolve()
739 vs_scroll(SCR *sp, int *continuep, sw_t wtype) in vs_scroll() argument
744 gp = sp->gp; in vs_scroll()
745 vip = VIP(sp); in vs_scroll()
746 if (!IS_ONELINE(sp)) { in vs_scroll()
752 (void)gp->scr_move(sp, vip->totalcount < in vs_scroll()
753 sp->rows ? LASTLINE(sp) - vip->totalcount : 0, 0); in vs_scroll()
754 (void)gp->scr_deleteln(sp); in vs_scroll()
757 if (TAILQ_NEXT(sp, q) != NULL) { in vs_scroll()
758 (void)gp->scr_move(sp, LASTLINE(sp), 0); in vs_scroll()
759 (void)gp->scr_insertln(sp); in vs_scroll()
762 if (wtype == SCROLL_W_QUIT && vip->linecount < sp->t_maxrows) in vs_scroll()
764 vs_wait(sp, continuep, wtype); in vs_scroll()
772 vs_wait(SCR *sp, int *continuep, sw_t wtype) in vs_wait() argument
780 gp = sp->gp; in vs_wait()
781 vip = VIP(sp); in vs_wait()
783 (void)gp->scr_move(sp, LASTLINE(sp), 0); in vs_wait()
784 if (IS_ONELINE(sp)) in vs_wait()
785 p = msg_cmsg(sp, CMSG_CONT_S, &len); in vs_wait()
789 p = msg_cmsg(sp, CMSG_CONT_Q, &len); in vs_wait()
792 p = msg_cmsg(sp, CMSG_CONT_EX, &len); in vs_wait()
795 p = msg_cmsg(sp, CMSG_CONT, &len); in vs_wait()
801 (void)gp->scr_addstr(sp, p, len); in vs_wait()
806 (void)gp->scr_clrtoeol(sp); in vs_wait()
807 (void)gp->scr_refresh(sp, 0); in vs_wait()
813 if (v_event_get(sp, &ev, 0, 0)) in vs_wait()
822 (void)gp->scr_bell(sp); in vs_wait()
843 vs_divider(SCR *sp) in vs_divider() argument
850 sizeof(DIVIDESTR) - 1 > sp->cols ? sp->cols : sizeof(DIVIDESTR) - 1; in vs_divider()
851 gp = sp->gp; in vs_divider()
852 (void)gp->scr_attr(sp, SA_INVERSE, 1); in vs_divider()
853 (void)gp->scr_addstr(sp, DIVIDESTR, len); in vs_divider()
854 (void)gp->scr_attr(sp, SA_INVERSE, 0); in vs_divider()
862 vs_msgsave(SCR *sp, mtype_t mt, char *p, size_t len) in vs_msgsave() argument
874 CALLOC_GOTO(sp, mp_n, 1, sizeof(MSGS)); in vs_msgsave()
875 MALLOC_GOTO(sp, mp_n->buf, len); in vs_msgsave()
881 gp = sp->gp; in vs_msgsave()