diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2001-01-22 18:02:21 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2001-01-22 18:02:21 +0000 |
commit | 7fe795010750d2e2889d7085abeaa1ee0926c69b (patch) | |
tree | b52138c43e052b09287afed0fb6351cd31249bda /lib/libcurses/tty/lib_mvcur.c | |
parent | 85db479b2362c15a2266e01737d835e86cda1b1e (diff) |
Update to ncurses-5.2-20010114
Diffstat (limited to 'lib/libcurses/tty/lib_mvcur.c')
-rw-r--r-- | lib/libcurses/tty/lib_mvcur.c | 51 |
1 files changed, 29 insertions, 22 deletions
diff --git a/lib/libcurses/tty/lib_mvcur.c b/lib/libcurses/tty/lib_mvcur.c index 0c72f2b5c96..45b0a2b7178 100644 --- a/lib/libcurses/tty/lib_mvcur.c +++ b/lib/libcurses/tty/lib_mvcur.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_mvcur.c,v 1.9 2000/10/08 22:47:04 millert Exp $ */ +/* $OpenBSD: lib_mvcur.c,v 1.10 2001/01/22 18:02:00 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * @@ -154,7 +154,7 @@ #include <term.h> #include <ctype.h> -MODULE_ID("$From: lib_mvcur.c,v 1.72 2000/10/08 00:58:25 tom Exp $") +MODULE_ID("$From: lib_mvcur.c,v 1.77 2000/12/10 03:04:30 tom Exp $") #define CURRENT_ROW SP->_cursrow /* phys cursor row */ #define CURRENT_COLUMN SP->_curscol /* phys cursor column */ @@ -208,8 +208,9 @@ trace_normalized_cost(const char *capname, const char *cap, int affcnt) #endif -int -_nc_msec_cost(const char *const cap, int affcnt) +NCURSES_EXPORT(int) +_nc_msec_cost +(const char *const cap, int affcnt) /* compute the cost of a given operation */ { if (cap == 0) @@ -224,11 +225,11 @@ _nc_msec_cost(const char *const cap, int affcnt) float number = 0.0; for (cp += 2; *cp != '>'; cp++) { - if (isdigit(*cp)) + if (isdigit(CharOf(*cp))) number = number * 10 + (*cp - '0'); else if (*cp == '*') number *= affcnt; - else if (*cp == '.' && (*++cp != '>') && isdigit(*cp)) + else if (*cp == '.' && (*++cp != '>') && isdigit(CharOf(*cp))) number += (*cp - '0') / 10.0; } @@ -264,7 +265,7 @@ reset_scroll_region(void) } } -void +NCURSES_EXPORT(void) _nc_mvcur_resume(void) /* what to do at initialization time and after each shellout */ { @@ -294,7 +295,7 @@ _nc_mvcur_resume(void) } } -void +NCURSES_EXPORT(void) _nc_mvcur_init(void) /* initialize the cost structure */ { @@ -408,7 +409,7 @@ _nc_mvcur_init(void) _nc_mvcur_resume(); } -void +NCURSES_EXPORT(void) _nc_mvcur_wrap(void) /* wrap up cursor-addressing mode */ { @@ -571,6 +572,8 @@ relative_move(string_desc * target, int from_y, int from_x, int to_y, int #endif /* USE_HARD_TABS */ #if defined(REAL_ATTR) && defined(WANT_CHAR) + if (n <= 0 || n >= (int) check.s_size) + ovw = FALSE; #if BSD_TPUTS /* * If we're allowing BSD-style padding in tputs, don't generate @@ -828,8 +831,9 @@ onscreen_mvcur(int yold, int xold, int ynew, int xnew, bool ovw) return (ERR); } -int -mvcur(int yold, int xold, int ynew, int xnew) +NCURSES_EXPORT(int) +mvcur +(int yold, int xold, int ynew, int xnew) /* optimized cursor move from (yold, xold) to (ynew, xnew) */ { TR(TRACE_MOVE, ("mvcur(%d,%d,%d,%d) called", yold, xold, ynew, xnew)); @@ -883,7 +887,7 @@ mvcur(int yold, int xold, int ynew, int xnew) } #if defined(TRACE) || defined(NCURSES_TEST) -int _nc_optimize_enable = OPTIMIZE_ALL; +NCURSES_EXPORT_VAR(int) _nc_optimize_enable = OPTIMIZE_ALL; #endif #if defined(MAIN) || defined(NCURSES_TEST) @@ -896,13 +900,15 @@ int _nc_optimize_enable = OPTIMIZE_ALL; #include <tic.h> #include <dump_entry.h> -const char *_nc_progname = "mvcur"; +NCURSES_EXPORT_VAR(const char *) +_nc_progname = "mvcur"; -static unsigned long xmits; + static unsigned long xmits; /* these override lib_tputs.c */ -int -tputs(const char *string, int affcnt GCC_UNUSED, int (*outc) (int) GCC_UNUSED) +NCURSES_EXPORT(int) +tputs +(const char *string, int affcnt GCC_UNUSED, int (*outc) (int) GCC_UNUSED) /* stub tputs() that dumps sequences in a visible form */ { if (profiling) @@ -912,24 +918,25 @@ tputs(const char *string, int affcnt GCC_UNUSED, int (*outc) (int) GCC_UNUSED) return (OK); } -int +NCURSES_EXPORT(int) putp(const char *string) { return (tputs(string, 1, _nc_outch)); } -int +NCURSES_EXPORT(int) _nc_outch(int ch) { putc(ch, stdout); return OK; } -char PC = 0; /* used by termcap library */ -short ospeed = 0; /* used by termcap library */ -int _nc_nulls_sent = 0; /* used by 'tack' program */ +NCURSES_EXPORT_VAR(char) PC = 0; /* used by termcap library */ +NCURSES_EXPORT_VAR(NCURSES_OSPEED) ospeed = 0; /* used by termcap library */ +NCURSES_EXPORT_VAR(int) +_nc_nulls_sent = 0; /* used by 'tack' program */ -int +NCURSES_EXPORT(int) delay_output(int ms GCC_UNUSED) { return OK; |