Commit Graph

17 Commits

Author SHA1 Message Date
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