X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/a191746d468664780a04846f900f1fd6d842e139..f93ce652c5d1361b00a28db7bbb9e638197a6676:/sbr/terminal.c?ds=inline diff --git a/sbr/terminal.c b/sbr/terminal.c index 9ce9a3bb..14eca97b 100644 --- a/sbr/terminal.c +++ b/sbr/terminal.c @@ -106,7 +106,7 @@ sc_length (void) static int -outc (int c) +outc (TPUTS_PUTC_ARG c) { return putchar(c); } @@ -175,11 +175,57 @@ get_term_stringcap(char *capability) tputs(parm, 1, termbytes); - termcbufp = '\0'; + *termcbufp = '\0'; return termcbuf; } +/* + * Return a parameterized terminfo capability + */ + +char * +get_term_stringparm(char *capability, long arg1, long arg2) +{ + char *parm; + + initialize_terminfo(); + + if (termstatus == -1) + return NULL; + + termcbufp = termcbuf; + + parm = tigetstr(capability); + + if (parm == (char *) -1 || parm == NULL) { + return NULL; + } + + parm = tparm(parm, arg1, arg2, 0, 0, 0, 0, 0, 0, 0); + + tputs(parm, 1, termbytes); + + *termcbufp = '\0'; + + return termcbuf; +} + +/* + * Return the value of the specified numeric capability + */ + +int +get_term_numcap(char *capability) +{ + initialize_terminfo(); + + if (termstatus == -1) + return -1; + + return tigetnum(capability); +} + /* * Store a sequence of characters in our local buffer */