diff options
Diffstat (limited to 'lib/libcurses/tinfo/lib_tputs.c')
-rw-r--r-- | lib/libcurses/tinfo/lib_tputs.c | 38 |
1 files changed, 21 insertions, 17 deletions
diff --git a/lib/libcurses/tinfo/lib_tputs.c b/lib/libcurses/tinfo/lib_tputs.c index 6084d441902..fb20e9dc782 100644 --- a/lib/libcurses/tinfo/lib_tputs.c +++ b/lib/libcurses/tinfo/lib_tputs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_tputs.c,v 1.8 2000/10/08 22:47:02 millert Exp $ */ +/* $OpenBSD: lib_tputs.c,v 1.9 2001/01/22 18:01:54 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * @@ -47,16 +47,18 @@ #include <termcap.h> /* ospeed */ #include <tic.h> -MODULE_ID("$From: lib_tputs.c,v 1.51 2000/10/08 00:22:24 tom Exp $") +MODULE_ID("$From: lib_tputs.c,v 1.55 2000/12/10 02:55:08 tom Exp $"); -char PC = 0; /* used by termcap library */ -short ospeed = 0; /* used by termcap library */ +NCURSES_EXPORT_VAR(char) +PC = 0; /* used by termcap library */ +NCURSES_EXPORT_VAR(NCURSES_OSPEED) ospeed = 0; /* used by termcap library */ -int _nc_nulls_sent = 0; /* used by 'tack' program */ +NCURSES_EXPORT_VAR(int) +_nc_nulls_sent = 0; /* used by 'tack' program */ -static int (*my_outch) (int c) = _nc_outch; + static int (*my_outch) (int c) = _nc_outch; -int +NCURSES_EXPORT(int) delay_output(int ms) { T((T_CALLED("delay_output(%d)"), ms)); @@ -77,13 +79,13 @@ delay_output(int ms) returnCode(OK); } -void +NCURSES_EXPORT(void) _nc_flush(void) { (void) fflush(NC_OUTPUT); } -int +NCURSES_EXPORT(int) _nc_outch(int ch) { #ifdef TRACE @@ -111,7 +113,7 @@ _nc_outch(int ch) * No surrogates supported (we're storing only one 16-bit Unicode value per * cell). */ -int +NCURSES_EXPORT(int) _nc_utf8_outch(int ch) { static const unsigned byteMask = 0xBF; @@ -170,14 +172,15 @@ _nc_utf8_outch(int ch) } #endif -int +NCURSES_EXPORT(int) putp(const char *string) { return tputs(string, 1, _nc_outch); } -int -tputs(const char *string, int affcnt, int (*outc) (int)) +NCURSES_EXPORT(int) +tputs +(const char *string, int affcnt, int (*outc) (int)) { bool always_delay; bool normal_delay; @@ -264,25 +267,26 @@ tputs(const char *string, int affcnt, int (*outc) (int)) bool mandatory; string++; - if ((!isdigit(*string) && *string != '.') || !strchr(string, '>')) { + if ((!isdigit(CharOf(*string)) && *string != '.') + || !strchr(string, '>')) { (*outc) ('$'); (*outc) ('<'); continue; } number = 0; - while (isdigit(*string)) { + while (isdigit(CharOf(*string))) { number = number * 10 + (*string - '0'); string++; } number *= 10; if (*string == '.') { string++; - if (isdigit(*string)) { + if (isdigit(CharOf(*string))) { number += (*string - '0'); string++; } - while (isdigit(*string)) + while (isdigit(CharOf(*string))) string++; } |