X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Ftinfo%2Flib_tputs.c;h=0b12624ee005c75757114736846a9a04dfa9d9fa;hp=aab3351905cef871bae6dba24bda48f1c1c1dae6;hb=7a6bbc8cf41c5186d46accc3d08622dc86526b34;hpb=e6c7286022d8a7a7ea7f15a6ffa7f9addb00e42d diff --git a/ncurses/tinfo/lib_tputs.c b/ncurses/tinfo/lib_tputs.c index aab33519..0b12624e 100644 --- a/ncurses/tinfo/lib_tputs.c +++ b/ncurses/tinfo/lib_tputs.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2003,2007 Free Software Foundation, Inc. * + * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -29,6 +29,8 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * + * and: Thomas E. Dickey 1996-on * + * and: Juergen Pfeifer 2009 * ****************************************************************************/ /* @@ -45,17 +47,33 @@ #include /* ospeed */ #include -MODULE_ID("$Id: lib_tputs.c,v 1.64 2007/09/29 20:37:13 tom Exp $") +MODULE_ID("$Id: lib_tputs.c,v 1.68 2009/02/28 21:08:18 tom Exp $") 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 */ +#if NCURSES_NO_PADDING +NCURSES_EXPORT(void) +_nc_set_no_padding(SCREEN *sp) +{ + bool no_padding = (getenv("NCURSES_NO_PADDING") != 0); + + if (sp) + sp->_no_padding = no_padding; + else + _nc_prescreen._no_padding = no_padding; + + TR(TRACE_CHARPUT | TRACE_MOVE, ("padding will%s be used", + GetNoPadding(sp) ? " not" : "")); +} +#endif + static int (*my_outch) (int c) = _nc_outch; NCURSES_EXPORT(int) -delay_output(int ms) +NCURSES_SP_NAME(delay_output) (NCURSES_SP_DCLx int ms) { T((T_CALLED("delay_output(%d)"), ms)); @@ -75,19 +93,35 @@ delay_output(int ms) returnCode(OK); } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +delay_output(int ms) +{ + return NCURSES_SP_NAME(delay_output) (CURRENT_SCREEN, ms); +} +#endif + NCURSES_EXPORT(void) -_nc_flush(void) +NCURSES_SP_NAME(_nc_flush) (NCURSES_SP_DCL0) { (void) fflush(NC_OUTPUT); } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(void) +_nc_flush(void) +{ + NCURSES_SP_NAME(_nc_flush) (CURRENT_SCREEN); +} +#endif + NCURSES_EXPORT(int) -_nc_outch(int ch) +NCURSES_SP_NAME(_nc_outch) (NCURSES_SP_DCLx int ch) { COUNT_OUTCHARS(1); - if (SP != 0 - && SP->_cleanup) { + if (SP_PARM != 0 + && SP_PARM->_cleanup) { char tmp = ch; /* * POSIX says write() is safe in a signal handler, but the @@ -100,6 +134,14 @@ _nc_outch(int ch) return OK; } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +_nc_outch(int ch) +{ + return NCURSES_SP_NAME(_nc_outch) (CURRENT_SCREEN, ch); +} +#endif + NCURSES_EXPORT(int) putp(const char *string) { @@ -147,7 +189,7 @@ tputs(const char *string, int affcnt, int (*outc) (int)) !xon_xoff && padding_baud_rate #if NCURSES_NO_PADDING - && (SP == 0 || !(SP->_no_padding)) + && !GetNoPadding(SP) #endif && (_nc_baudrate(ospeed) >= padding_baud_rate); }