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
The new logic is considerably shorter and simpler, and should mean that
terminfo is properly used in preference to termcap on NetBSD. This also
allows us to include term.h in term.c, where the system definition of
tparm() lives on some systems (NetBSD is one such).
The new logic also means we link against libtinfo in preference to
libncurses, which should mean a little less memory used at runtime and a
fraction faster startup time.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@434 13b04d17-f746-0410-82c6-800466cd88b0
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
Replace unused .format_var member of status_expandos list with .args. For
expandos which have a subformat, this stores how many arguments are passed to
sprintf() when the subformat is expanded in the callback function. The
convert_sub_format() function then uses this to limit the number of %s
conversion specifiers it creates in the converted subformat.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@426 13b04d17-f746-0410-82c6-800466cd88b0
The old code was reusing the 'window' variable, which means that it
could pick up the STATUS_NOTIFY format from the wrong window. You
would only have noticed this if you have windows with different settings
for STATUS_NOTIFY.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@425 13b04d17-f746-0410-82c6-800466cd88b0
Status formats support a %<PAD>c syntax for specifying padding. This change
ensures that we only use padding consisting of the characters "0123456789.",
which ensures it won't confuse sprintf.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@424 13b04d17-f746-0410-82c6-800466cd88b0
We can also rearrange things to remove the need for the add_ext variable,
hopefully also making the logic a bit more clear.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@423 13b04d17-f746-0410-82c6-800466cd88b0
variable name across functions. Use strlcat rather than strmcat.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@409 13b04d17-f746-0410-82c6-800466cd88b0
BIG_BUFFER_SIZE. Even with many flags enabled the output string shouldn't
be larger than 512 bytes. Use strlcat rather than strmcat.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@407 13b04d17-f746-0410-82c6-800466cd88b0
Previously it would carefully construct a string, then do nothing with it.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@392 13b04d17-f746-0410-82c6-800466cd88b0