Lines Matching +full:num +full:- +full:cs

2  * ed.screen.c: Editor/termcap-curses interface
4 /*-
341 * A very useful table from justin@crim.ca (Justin Bur) :-)
343 * - first (and second:-) case fixed)
347 * -------------- ------- ------- ------------ ------------
350 * No Wrap no -- yes yes
363 xfree(t->str); in TCset()
364 t->str = NULL; in TCset()
369 t->str = xrealloc(t->str, size); in TCset()
370 memcpy(t->str, cap, size); in TCset()
403 for (t = tstr; t->name != NULL; t++) { in TellTC()
404 s = strsave(t->str && *t->str ? t->str : CGETS(7, 13, "(empty)")); in TellTC()
406 xprintf("\t%36s (%s) == %s\n", t->long_name, t->name, s); in TellTC()
450 for (ts = tstr; ts->name != NULL; ts++) in SetTC()
451 if (strcmp(ts->name, what) == 0) in SetTC()
453 if (ts->name != NULL) { in SetTC()
475 for (tv = tval; tv->name != NULL; tv++) in SetTC()
476 if (strcmp(tv->name, what) == 0) in SetTC()
479 if (tv->name != NULL) { in SetTC()
483 tv->val = 1; in SetTC()
485 tv->val = 0; in SetTC()
487 stderror(ERR_SETTCUS, tv->name); in SetTC()
499 tv->val = atoi(how); in SetTC()
537 if (v[0][0] == '-') { in EchoTC()
600 for (t = tstr; t->name != NULL; t++) in EchoTC()
601 if (strcmp(t->name, cv) == 0) { in EchoTC()
602 scap = t->str; in EchoTC()
605 if (t->name == NULL) in EchoTC()
774 CStr cs; in DefaultArrowKeys() local
793 cs.len = 3; in DefaultArrowKeys()
795 cs.buf = strA; AddXkey(&cs, &arrow[A_K_UP].fun, arrow[A_K_UP].type); in DefaultArrowKeys()
796 cs.buf = strB; AddXkey(&cs, &arrow[A_K_DN].fun, arrow[A_K_DN].type); in DefaultArrowKeys()
797 cs.buf = strC; AddXkey(&cs, &arrow[A_K_RT].fun, arrow[A_K_RT].type); in DefaultArrowKeys()
798 cs.buf = strD; AddXkey(&cs, &arrow[A_K_LT].fun, arrow[A_K_LT].type); in DefaultArrowKeys()
799 cs.buf = strH; AddXkey(&cs, &arrow[A_K_HO].fun, arrow[A_K_HO].type); in DefaultArrowKeys()
800 cs.buf = strF; AddXkey(&cs, &arrow[A_K_EN].fun, arrow[A_K_EN].type); in DefaultArrowKeys()
801 cs.buf = stOA; AddXkey(&cs, &arrow[A_K_UP].fun, arrow[A_K_UP].type); in DefaultArrowKeys()
802 cs.buf = stOB; AddXkey(&cs, &arrow[A_K_DN].fun, arrow[A_K_DN].type); in DefaultArrowKeys()
803 cs.buf = stOC; AddXkey(&cs, &arrow[A_K_RT].fun, arrow[A_K_RT].type); in DefaultArrowKeys()
804 cs.buf = stOD; AddXkey(&cs, &arrow[A_K_LT].fun, arrow[A_K_LT].type); in DefaultArrowKeys()
805 cs.buf = stOH; AddXkey(&cs, &arrow[A_K_HO].fun, arrow[A_K_HO].type); in DefaultArrowKeys()
806 cs.buf = stOF; AddXkey(&cs, &arrow[A_K_EN].fun, arrow[A_K_EN].type); in DefaultArrowKeys()
809 cs.len = 2; in DefaultArrowKeys()
810 cs.buf = &strA[1]; AddXkey(&cs, &arrow[A_K_UP].fun, arrow[A_K_UP].type); in DefaultArrowKeys()
811 cs.buf = &strB[1]; AddXkey(&cs, &arrow[A_K_DN].fun, arrow[A_K_DN].type); in DefaultArrowKeys()
812 cs.buf = &strC[1]; AddXkey(&cs, &arrow[A_K_RT].fun, arrow[A_K_RT].type); in DefaultArrowKeys()
813 cs.buf = &strD[1]; AddXkey(&cs, &arrow[A_K_LT].fun, arrow[A_K_LT].type); in DefaultArrowKeys()
814 cs.buf = &strH[1]; AddXkey(&cs, &arrow[A_K_HO].fun, arrow[A_K_HO].type); in DefaultArrowKeys()
815 cs.buf = &strF[1]; AddXkey(&cs, &arrow[A_K_EN].fun, arrow[A_K_EN].type); in DefaultArrowKeys()
816 cs.buf = &stOA[1]; AddXkey(&cs, &arrow[A_K_UP].fun, arrow[A_K_UP].type); in DefaultArrowKeys()
817 cs.buf = &stOB[1]; AddXkey(&cs, &arrow[A_K_DN].fun, arrow[A_K_DN].type); in DefaultArrowKeys()
818 cs.buf = &stOC[1]; AddXkey(&cs, &arrow[A_K_RT].fun, arrow[A_K_RT].type); in DefaultArrowKeys()
819 cs.buf = &stOD[1]; AddXkey(&cs, &arrow[A_K_LT].fun, arrow[A_K_LT].type); in DefaultArrowKeys()
820 cs.buf = &stOH[1]; AddXkey(&cs, &arrow[A_K_HO].fun, arrow[A_K_HO].type); in DefaultArrowKeys()
821 cs.buf = &stOF[1]; AddXkey(&cs, &arrow[A_K_EN].fun, arrow[A_K_EN].type); in DefaultArrowKeys()
831 if (Strcmp(name->buf, arrow[i].name) == 0) { in SetArrowKeys()
836 return -1; in SetArrowKeys()
854 if (Strcmp(name->buf, arrow[i].name) == 0) { in ClearArrowKeys()
858 return -1; in ClearArrowKeys()
867 if (name->len == 0 || Strcmp(name->buf, arrow[i].name) == 0) in PrintArrowKeys()
879 CStr cs; in BindArrowKeys() local
892 cs.buf = str2short(p); in BindArrowKeys()
893 cs.len = Strlen(cs.buf); in BindArrowKeys()
897 * 1. They are multi-character arrow keys and the user in BindArrowKeys()
898 * has not re-assigned the leading character, or in BindArrowKeys()
899 * has re-assigned the leading character to be F_XKEY in BindArrowKeys()
903 ClearXkey(map, &cs); in BindArrowKeys()
907 AddXkey(&cs, &arrow[i].fun, arrow[i].type); in BindArrowKeys()
911 ClearXkey(map, &cs); in BindArrowKeys()
915 AddXkey(&cs, &arrow[i].fun, arrow[i].type); in BindArrowKeys()
1006 /* PWP 6-27-88 -- if the tty driver thinks that we can tab, we ask termcap */
1030 del = where - CursorV; in MoveToLine()
1037 for (h = TermH - 1; h > 0 && Display[CursorV][h] == CHAR_DBWIDTH; in MoveToLine()
1038 h--) in MoveToLine()
1042 so_write(&Display[CursorV][CursorH], TermH - CursorH); /* updates CursorH/V*/ in MoveToLine()
1043 del--; in MoveToLine()
1051 for ( ; del > 0; del--) in MoveToLine()
1059 if (GoodStr(T_UP) && (-del > 1 || !GoodStr(T_up))) in MoveToLine()
1060 (void) tputs(tgoto(Str(T_UP), -del, -del), -del, PUTPURE); in MoveToLine()
1064 for (i = 0; i < -del; i++) in MoveToLine()
1094 del = where - CursorH; in MoveToChar()
1096 if ((del < -4 || del > 4) && GoodStr(T_ch)) in MoveToChar()
1114 TermH - 1 for the wrapping, it would be nice to in MoveToChar()
1116 - but this doesn't work for all terminals! */ in MoveToChar()
1122 so_write(&Display[CursorV][CursorH], where - CursorH); in MoveToChar()
1127 if ((-del > 4) && GoodStr(T_LE)) in MoveToChar()
1128 (void) tputs(tgoto(Str(T_LE), -del, -del), -del, PUTPURE); in MoveToChar()
1131 if (T_Tabs ? (-del > ((where >> 3) + (where & 07))) in MoveToChar()
1132 : (-del > where)) { in MoveToChar()
1137 for (i = 0; i < -del; i++) in MoveToChar()
1165 prompt_len = promptc - Prompt; in so_write()
1169 region_start = (Cursor - InputBuf) + prompt_len; in so_write()
1172 region_start = (min(Cursor, Mark) - InputBuf) + prompt_len; in so_write()
1173 region_end = (max(Cursor, Mark) - InputBuf) + prompt_len; in so_write()
1188 if (highlighting && cur_pos == (Cursor - InputBuf) + prompt_len) in so_write()
1206 } while (--n); in so_write()
1230 CursorH = TermH - 1; in so_write()
1236 DeleteChars(int num) /* deletes <num> characters */ in DeleteChars() argument
1238 if (num <= 0) in DeleteChars()
1249 if (num > TermH) { in DeleteChars()
1251 xprintf(CGETS(7, 17, "DeleteChars: num is riduculous: %d\r\n"), num); in DeleteChars()
1258 if ((num > 1) || !GoodStr(T_dc)) { /* if dc would be more expen. */ in DeleteChars()
1259 (void) tputs(tgoto(Str(T_DC), num, num), num, PUTPURE); in DeleteChars()
1267 while (num--) in DeleteChars()
1274 /* Puts terminal in insert character mode, or inserts num characters in the
1277 Insert_write(Char *cp, int num) in Insert_write() argument
1279 if (num <= 0) in Insert_write()
1289 if (num > TermH) { in Insert_write()
1291 xprintf(CGETS(7, 19, "StartInsert: num is riduculous: %d\r\n"), num); in Insert_write()
1298 if ((num > 1) || !GoodStr(T_ic)) { /* if ic would be more expen. */ in Insert_write()
1299 (void) tputs(tgoto(Str(T_IC), num, num), num, PUTPURE); in Insert_write()
1300 so_write(cp, num); /* this updates CursorH/V */ in Insert_write()
1307 so_write(cp, num); /* this updates CursorH/V */ in Insert_write()
1309 if (GoodStr(T_ip)) /* have to make num chars insert */ in Insert_write()
1317 if (GoodStr(T_ic)) /* have to make num chars insert */ in Insert_write()
1322 if (GoodStr(T_ip)) /* have to make num chars insert */ in Insert_write()
1325 } while (--num); in Insert_write()
1329 /* clear to end of line. There are num characters to clear */
1331 ClearEOL(int num) in ClearEOL() argument
1335 if (num <= 0) in ClearEOL()
1341 for (i = 0; i < num; i++) in ClearEOL()
1343 CursorH += num; /* have written num spaces */ in ClearEOL()
1434 if (i == -1) { in GetTermCaps()
1448 for (t = tstr; t->name != NULL; t++) in GetTermCaps()
1460 for (t = tstr; t->name != NULL; t++) in GetTermCaps()
1461 TCset(t, tgetstr(t->name, &area)); in GetTermCaps()
1533 if (ioctl(SHIN, TIOCGWINSZ, (ioctl_t) &ws) != -1) { in GetSize()
1547 if (ioctl(SHIN, TIOCGSIZE, (ioctl_t) &ts) != -1) { in GetSize()
1571 size_t len = (ptr - termcap) + Strlen(tag); in UpdateVal()
1630 termcap[TC_BUFSIZE-1] = '\0'; in ChangeSize()
1637 * Chop the termcap string at TC_BUFSIZE-1 characters to avoid in ChangeSize()
1638 * core-dumps in the termcap routines in ChangeSize()
1640 termcap[TC_BUFSIZE - 1] = '\0'; in ChangeSize()
1647 ReBufferDisplay(); /* re-make display buffers */ in ChangeSize()