Commit Graph

25 Commits

Author SHA1 Message Date
Kevin Easton
eb14b44413 Use current terminal size in term_reset()
Fixes a regression introduced by 70ac43ce77 where
the scroll region would be reset to the original terminal size, not current.
2018-05-07 20:13:23 +10:00
Kevin Easton
563ab3efeb Use current screen size rather than original terminal size in term_clear_screen()
Also renames the function term_clrscr() to term_clear_screen() and remove the term_clear_screen()
macro.
2018-05-05 13:34:13 +10:00
Kevin Easton
1e97709bd8 Use output_screen size instead of current_term in term_scroll
This fixes a regression in commmit 70ac43ce77,
where the original screen size would be used to scroll after the terminal had
been resized.  If the screen was shrunk, this caused display problems when
running under GNU Screen.

Using output_screen size means that it stands a better chance of working on
non-default screens, too.
2018-05-05 11:31:31 +10:00
gdinit
bac141898b Correct spelling of some client messages, comments and function names 2017-10-20 14:57:17 +11:00
Kevin Easton
70ac43ce77 Remove globals 'li' and 'co' in term.c
These globals were used to store the original terminal dimesions from the terminal database (or
in the case of reattaching, supplied by scr-bx) to be applied if the current terminal dimensions
could not be determined.

Instead, we leave the original terminal dimensions in current_term->TI_lines and current_term->TI_cols,
and create current_term->li and current_term->co to store the current terminal dimensions (as eg.
supplied by scr-bx).
2017-09-15 17:15:24 +10:00
Kevin Easton
c9b0e654b5 Remove unused variables BC, UP and my_PC
These appear to be a hangover from old termcap-using code, but there's nothing in BX that uses them anymore.
2017-09-02 07:03:10 +10:00
Kevin Easton
9080475ff7 Remove unnecessary typecasts in initialisation of tcaps[] 2017-09-02 04:55:19 +10:00
Kevin Easton
742eeb33f7 Restore terminal settings after flushing output, not before 2017-08-22 22:26:50 +10:00
Kevin Easton
8f4b5600a5 Make the tcaps table const and static
This table isn't modified or referenced outside of term.c, so it can be const static.

The 'const' moves ~20K from the data segment to the text segment (on 64 bit), reducing the total size of
the BitchX data segment by 10%.
2017-05-12 11:24:00 +10:00
Kevin Easton
bb5e9920d2 Squash a warning when compiling with a some curses library configurations.
ncurses can optionally declare tigetstr(), tigetnum() and tigetflags() with a
const char * argument, indicated by the NCURSES_CONST macro.  So we use this 
macro, if available, to optionally declare cap2str.iname as const char *.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@530 13b04d17-f746-0410-82c6-800466cd88b0
2014-11-06 10:25:37 +00:00
Kevin Easton
b2ae3c888f Cleanup get_term_capability(), silences some warnings.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@463 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-13 13:35:10 +00:00
Kevin Easton
ecabc12b3d Add helper macros to always call tparm() with 10 arguments.
This ensures portability to systems with a fixed-argument list declaration
of tparm(), like NetBSD curses.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@436 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-10 06:27:03 +00:00
Kevin Easton
0fe37326a3 Rebuild configure and defs.h.in from new configure.in, and update code to match.
This simplifies the inclusion logic in ircterm.h, and updates term.c to include
term.h if available.  This removes the declarations for setupterm(), tigetstr(),
tigetnum(), tigetflag(), tgetent(), tgetstr(), tgetnum() and tgetflag() from
term.c as those should be defined in term.h or termcap.h.

This should make the system declaration of tparm() available to term.c, which
will fix a crash on NetBSD x86-64 caused by the implicit declaration of tparm()
having a return type of 'int' while the real function has a return type of
'char *'.

We have to include term.h in term.c, not in ircterm.h because term.h defines
a large number of macros, at least two of which ('lines' and 'goto_window')
conflict with names in use in the rest of the codebase.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@435 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-10 05:38:06 +00:00
Tim Cava
112b38ac7a Revert the last commit. It accidentally had autogenerated files in it.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@432 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-07 03:00:24 +00:00
Tim Cava
276fd24258 Use snprintf rather than sprintf. From pvaldes.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@431 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-07 02:41:16 +00:00
Kevin Easton
456a0061f0 Fix output when client is built against termcap.
The pointer passed to tgetstr() must not be reset each time around the loop.
Also some other minor cleanups in term_init().


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@428 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-01 13:06:02 +00:00
Kevin Easton
338a8ecd4c Remove unnecessary declarations in term.c for wserv builds.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@312 13b04d17-f746-0410-82c6-800466cd88b0
2013-08-12 09:40:59 +00:00
Tim Cava
6ae6edc0fb Make the definition of Tgetstr() use the value of y, when terminfo is
available, which quiets an unused variable warning.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@289 13b04d17-f746-0410-82c6-800466cd88b0
2013-07-15 04:13:52 +00:00
Tim Cava
2d80cbb680 Restore this variable, as it's used when terminfo isn't available.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@288 13b04d17-f746-0410-82c6-800466cd88b0
2013-07-15 03:48:43 +00:00
Tim Cava
3b509dfa52 Kill an unused variable in term_init().
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@287 13b04d17-f746-0410-82c6-800466cd88b0
2013-07-15 03:17:49 +00:00
Kevin Easton
cc0b75f2dd Include <termios.h> in preference to <sys/termios.h>.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@275 13b04d17-f746-0410-82c6-800466cd88b0
2013-07-14 02:01:59 +00:00
Tim Cava
4ff0b8d2d5 Make sure setupterm() returns ERR before examining the status value.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@252 13b04d17-f746-0410-82c6-800466cd88b0
2013-07-01 01:23:18 +00:00
Kevin Easton
b0d74f970d Merge from ircii-pana-1.1 branch (removal of tparm declaration) - see rev 16
change.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@17 13b04d17-f746-0410-82c6-800466cd88b0
2008-03-10 06:38:25 +00:00
Kevin Easton
533c3dbcbf Turn on SVN keyword replacement for $Date$, $Author$, $Revision$, $Id$ for all
*.c and *.h files.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/branches/ircii-pana-1.1@3 13b04d17-f746-0410-82c6-800466cd88b0
2008-02-25 09:49:14 +00:00
Kevin Easton
28febcfea9 Initial import of the ircii-pana-1.1-final source tree.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/tags/ircii-pana-1.1-final@1 13b04d17-f746-0410-82c6-800466cd88b0
2008-02-25 09:25:32 +00:00