MCPcopy Create free account
hub / github.com/antirez/ds4 / input_thread_main

Function input_thread_main

ds4_eval.c:1826–1852  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1824 fprintf(stderr,
1825 "ds4-eval: --hard-limit-reply-budget (%d) must be smaller than --tokens (%d)\n",
1826 c.hard_limit_reply_budget, c.max_tokens);
1827 exit(2);
1828 }
1829 if (ds4_think_mode_enabled(c.think_mode) &&
1830 c.soft_limit_reply_budget < c.hard_limit_reply_budget) {
1831 fprintf(stderr,
1832 "ds4-eval: --soft-limit-reply-budget (%d) must be >= --hard-limit-reply-budget (%d)\n",
1833 c.soft_limit_reply_budget, c.hard_limit_reply_budget);
1834 exit(2);
1835 }
1836 return c;
1837}
1838
1839static int terminal_size(int *cols, int *rows) {
1840 struct winsize ws;
1841 if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &ws) != 0 || ws.ws_col == 0 || ws.ws_row == 0) {
1842 *cols = 80;
1843 *rows = 24;
1844 return -1;
1845 }
1846 *cols = ws.ws_col;
1847 *rows = ws.ws_row;
1848 return 0;
1849}
1850
1851static void term_move(int row, int col) {
1852 printf("\x1b[%d;%dH", row, col);
1853}
1854
1855static void term_clear_to_eol(void) {

Callers

nothing calls this directly

Calls 1

input_queue_keyFunction · 0.85

Tested by

no test coverage detected