MCPcopy Create free account
hub / github.com/gwsw/less / ltputs

Function ltputs

screen.c:1619–1659  ·  view source on GitHub ↗

* Like tputs but we handle $<...> delay strings here because * some implementations of tputs don't perform delays correctly. */

(str, affcnt, f_putc)

Source from the content-addressed store, hash-verified

1617 * some implementations of tputs don't perform delays correctly.
1618 */
1619 static void
1620ltputs(str, affcnt, f_putc)
1621 char *str;
1622 int affcnt;
1623 int (*f_putc)(int);
1624{
1625 while (str != NULL && *str != '\0')
1626 {
1627#if HAVE_STRSTR
1628 char *obrac = strstr(str, "$<");
1629 if (obrac != NULL)
1630 {
1631 char str2[64];
1632 int slen = obrac - str;
1633 if (slen < sizeof(str2))
1634 {
1635 int delay;
1636 /* Output first part of string (before "$<"). */
1637 memcpy(str2, str, slen);
1638 str2[slen] = '\0';
1639 do_tputs(str2, affcnt, f_putc);
1640 str += slen + 2;
1641 /* Perform the delay. */
1642 delay = lstrtoi(str, &str);
1643 if (*str == '*')
1644 delay *= affcnt;
1645 flush();
1646 sleep_ms(delay);
1647 /* Skip past closing ">" at end of delay string. */
1648 str = strstr(str, ">");
1649 if (str != NULL)
1650 str++;
1651 continue;
1652 }
1653 }
1654#endif
1655 /* Pass the rest of the string to tputs and we're done. */
1656 do_tputs(str, affcnt, f_putc);
1657 break;
1658 }
1659}
1660#endif /* MSDOS_COMPILER */
1661
1662/*

Callers 15

init_mouseFunction · 0.85
deinit_mouseFunction · 0.85
initFunction · 0.85
deinitFunction · 0.85
homeFunction · 0.85
add_lineFunction · 0.85
lower_leftFunction · 0.85
line_leftFunction · 0.85
goto_lineFunction · 0.85
vbellFunction · 0.85
clearFunction · 0.85
clear_eolFunction · 0.85

Calls 4

memcpyFunction · 0.85
do_tputsFunction · 0.85
flushFunction · 0.85
sleep_msFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…