diff -Nru linpac-0.24/AUTHORS linpac-0.25/AUTHORS --- linpac-0.24/AUTHORS 2015-11-19 23:43:43.000000000 +0000 +++ linpac-0.25/AUTHORS 2017-12-11 04:47:34.000000000 +0000 @@ -1,5 +1,6 @@ Authors: David Ranch +Martin Cooper Jerry Dunmire Steven Loomis Radek Burget diff -Nru linpac-0.24/ChangeLog linpac-0.25/ChangeLog --- linpac-0.24/ChangeLog 2015-11-19 23:43:57.000000000 +0000 +++ linpac-0.25/ChangeLog 2017-12-11 04:47:47.000000000 +0000 @@ -1,3 +1,555 @@ +commit da13303 +Author: David Ranch +Date: 2017-12-10 + + Updated the Changelog based upon recent Git commit comments + +ChangeLog + +commit e55cf6f +Merge: de8d158 33a4c0c +Author: David Ranch +Date: 2017-12-10 + + Merge branch 'develop' + + Conflicts: + ChangeLog + +commit 33a4c0c +Author: David Ranch +Date: 2017-12-10 + + Added KD6YAM + +AUTHORS + +commit 8c1676b +Author: David Ranch +Date: 2017-12-10 + + major clean-up, moved items around, added new items + +linpac-todo.txt + +commit 039ab39 +Author: David Ranch +Date: 2017-12-10 + + align both versions + +macro/en/help.mac + +commit ae6d8a6 +Author: David Ranch +Date: 2017-12-10 + + Added Martin Cooper (KD6YAM) for his helpful contributions + +README + +commit dd27b77 +Author: David Ranch +Date: 2017-12-10 + + new development version + +configure.ac + +commit 6a52f1d +Merge: f117b59 78daf75 +Author: Martin Cooper +Date: 2017-12-09 + + Merge branch 'cleanup' into develop + + Cleanup of compiler warnings and bug fixes. + +commit f117b59 +Author: David Ranch +Date: 2017-12-08 + + updated develop version + +configure.ac + +commit d438590 +Merge: 20d3042 0b52ba9 +Author: David Ranch +Date: 2017-12-08 + + Merge branch 'loadreduce-try2' into develop + +commit 20d3042 +Author: David Ranch +Date: 2017-12-08 + + date fix + +doc/applguide.html + +commit 78daf75 +Author: Martin Cooper +Date: 2017-12-08 + + Fix a bug in file name input handling. + + The UI would hang after the user entered a file name in order to insert, + export, or attach a file. This was caused by fall-through from the case + that had finished handling of file name input. + +src/applications/mailer/mail_edit.cc + +commit bba9d99 +Author: Martin Cooper +Date: 2017-12-07 + + Fix bugs related to mail header field lengths. + + Header length checking and formatting was using multiple inconsistent + lengths for the same field, as well as checking the length for one field + against the state of another. Added new constants and macros, factored + out formatting, and corrected all length checks to address this. + +src/applications/mailer/mail_edit.cc + +commit 118a2d5 +Author: Martin Cooper +Date: 2017-12-07 + + Fix warning about ignoring system() result. + +src/applications/save7pl.cc + +commit fd481b1 +Author: Martin Cooper +Date: 2017-12-07 + + Fix warnings about ambiguous 'else'; add braces. + +src/applications/autobin.cc +src/applications/mailer/mail_filt.cc +src/editor.cc +src/sources.cc +src/windows.cc + +commit be7b814 +Author: Martin Cooper +Date: 2017-12-07 + + Fix warning about tmpnam; use mkstemp instead. + +src/applications/logbook.cc + +commit 3f67908 +Author: Martin Cooper +Date: 2017-12-07 + + Fix warnings about signed array subscripts. + +src/applications/mailer/mail_edit.cc +src/applications/mailer/mail_list.cc +src/editor.cc +src/windows.cc + +commit fe5f35c +Author: Martin Cooper +Date: 2017-12-07 + + Fix warnings about unused variables and results. + +src/applications/bell.cc +src/applications/getmsg.cc +src/applications/join.c +src/applications/save7pl.cc +src/applications/yapp.cc +src/data.cc + +commit 0b52ba9 +Author: Martin Cooper +Date: 2017-12-02 + + Correct loop control variable type. + +src/applications/mailer/mail_edit.cc +src/applications/mailer/mail_input.cc +src/editor.cc + +commit f483086 +Author: Martin Cooper +Date: 2017-11-22 + + Add support for new EV_KEY_PRESS_MULTI event. + + This event is supported wherever the user might think to paste into the mail + application. For example, when composing a new message, the To and Subject + lines and the message body might be pasted into; when creating a new filter, + the name might be pasted into. + +src/applications/mailer/mail.cc +src/applications/mailer/mail_edit.cc +src/applications/mailer/mail_filt.cc +src/applications/mailer/mail_input.cc +src/applications/mailer/mail_input.h +src/applications/mailer/tevent.h + +commit d94cb01 +Author: Martin Cooper +Date: 2017-11-22 + + Document the new EV_KEY_PRESS_MULTI event. + +doc/events.txt +doc/objects.txt + +commit dc95b8f +Author: Martin Cooper +Date: 2017-11-22 + + Add support for new EV_KEY_PRESS_MULTI event. + + Accumulate immediately-available key presses and generate a single event, + instead of an individual event for each key press. Previously, each key + press required a full cycle around the application's idle loop. + + Only printable characters are accumulated, so that this does not interfere + with immediate actions, or changes of state, triggered by control characters. + +src/editor.cc +src/keyboard.cc +src/tevent.h + +commit f161491 +Author: Martin Cooper +Date: 2017-11-22 + + Fix a typo that appears in the mail UI. + +src/applications/mailer/mail_list.cc + +commit ba0c81e +Author: Martin Cooper +Date: 2017-11-22 + + Use the correct type (WINDOW) for ncurses windows. + + Incorrect include ordering had caused a problem with using the WINDOW type + in some type definitions. Correcting the order of includes resolves the + the problem, allowing the correct type to be used, and allowing the removal + of numerous reinterpret_cast invocations, and temporary variables, that + were previously required. + +src/applications/mailer/mail.cc +src/applications/mailer/mail_comp.cc +src/applications/mailer/mail_comp.h +src/applications/mailer/mail_edit.cc +src/applications/mailer/mail_filt.cc +src/applications/mailer/mail_filt.h +src/applications/mailer/mail_help.cc +src/applications/mailer/mail_help.h +src/applications/mailer/mail_input.cc +src/applications/mailer/mail_input.h +src/applications/mailer/mail_list.cc +src/applications/mailer/mail_list.h +src/applications/mailer/mail_screen.cc +src/applications/mailer/mail_screen.h + +commit edcdecf +Author: Martin Cooper +Date: 2017-11-19 + + Fix inconsistent args in wgetch() calls. + + If the first call returns an Alt, a second call is made to determine the key + to be modified. The code was erroneously using a different WINDOW arg for + the second call. + +src/keyboard.cc + +commit 6b40825 +Author: Martin Cooper +Date: 2017-11-19 + + Use the correct type (WINDOW) for the key window. + + Incorrect include ordering had caused a problem with using the WINDOW type + in the Keyscan type definition. Correcting the order of includes resolves + the problem, allowing the correct type to be used, and allowing the removal + of numerous reinterpret_cast invocations that were previously required. + +src/keyboard.cc +src/keyboard.h + +commit 708601b +Author: David Ranch +Date: 2017-11-12 + + update dev version + +configure.ac + +commit f94537a +Author: David Ranch +Date: 2017-11-12 + + KD6YAM: load reduction patches with mail app fixes + +src/applications/liblinpac/lpapp.c +src/linpac.cc + +commit 068fece +Author: David Ranch +Date: 2017-11-06 + + noted message issue when no destination callsign is given + +linpac-todo.txt + +commit d2b4aaa +Author: David Ranch +Date: 2017-11-05 + + Added that the doc/manual.txt file isn't getting updated from the html doc + +linpac-todo.txt + +commit b9618ba +Author: David Ranch +Date: 2017-11-05 + + Added mention of known issue with long predictable network interface names + +README +doc/manual.html + +commit c37eca1 +Author: David Ranch +Date: 2017-11-04 + + new development version + +configure.ac + +commit 44ece4f +Author: David Ranch +Date: 2017-11-04 + + KD6YAM: Fix incorrect condition leading to EPIPE / broken pipe errors + +src/sources.cc + +commit f5dd868 +Author: David Ranch +Date: 2017-11-01 + + new development version + +configure.ac + +commit 1ccfb93 +Author: David Ranch +Date: 2017-11-01 + + added omitted comp, SP, and SB commands + +macro/init.mac + +commit 7436dff +Author: David Ranch +Date: 2017-11-01 + + added omitted send message commands in help + +macro/help.mac + +commit 7baf8c3 +Author: David Ranch +Date: 2017-11-01 + + added omitted send message commands + +macro/commands + +commit 46641a2 +Author: David Ranch +Date: 2017-10-21 + + Updated the copyright date + +README + +commit a6cd4e1 +Author: David Ranch +Date: 2017-10-21 + + Updated the alternative AX.25 stack URL from the old Google one to the VE7FET repo + +README + +commit 8c748d6 +Author: David Ranch +Date: 2017-10-21 + + Updated development snapshot date + +configure.ac + +commit 5639ab2 +Author: David Ranch +Date: 2017-10-21 + + segfault fixes exposed in newer GCCs. Thanks to Martin Cooper KD6YAM + +src/data.cc +src/windows.cc + +commit bce365b +Author: David Ranch +Date: 2017-10-02 + + Added new segmentation fault issue for Alt-X with incorrect OSX Alt keymapping + +linpac-todo.txt + +commit 9ada5f6 +Author: David Ranch +Date: 2017-09-30 + + Added new segmentation fault issue on misconfigured ax25 stacks + +linpac-todo.txt + +commit b9b35c7 +Author: David Ranch +Date: 2017-09-02 + + Added a check for stale lock files and some comments + +contrib/start-linpac.sh + +commit 757d3c4 +Author: David Ranch +Date: 2017-03-16 + + Added autoreconf help in certain errors + +README + +commit 9cf2377 +Merge: 017e50a e9ebaae +Author: David Ranch +Date: 2016-09-10 + + Merge commit 'e9ebaae017cfb02f96c56c8f2609e391fd277031' into develop + +commit 017e50a +Author: David Ranch +Date: 2016-09-09 + + improve version display output + +src/commands.cc + +commit cb5c5d2 +Author: David Ranch +Date: 2016-09-09 + + new development version + +configure.ac + +commit 0a2e66b +Author: David Ranch +Date: 2016-09-02 + + Updating displayed callsign and comments from OK2JBG to KI6ZHD + +src/applications/join.c +src/applications/mailer/mail_screen.cc +src/applications/testapp.c +src/linpac.cc + +commit e89af88 +Author: Steven R. Loomis +Date: 2016-02-04 + + Show Connected/Disconnected properly. + + fix connected/disconnected text. + + https://sourceforge.net/p/linpac/bugs/21/ + +src/windows.cc + +commit e9ebaae +Author: Steven R. Loomis +Date: 2016-02-04 + + Fix error message on console. + + Fixes: https://sourceforge.net/p/linpac/bugs/23/ + + Change 1 -> 0 so "permission denied" error doesn't show up randomly on screen! + + In console: "Alt-X to exit. : Operation not permitted" + + (actually was in Spanish on my system) + + Signed-off-by: Steven R. Loomis + +src/linpac.cc + +commit 091e821 +Author: David Ranch +Date: 2016-01-30 + + Add specific tinfo checks for distros that are missing pkgconfig files for Ncurses - PClinux (mandriva) + +configure.ac + +commit 5ab8a10 +Author: David Ranch +Date: 2016-01-29 + + Updated the author, version, and added an example of the startup prompting + +doc/manual.html + +commit 80a39f5 +Author: David Ranch +Date: 2015-11-29 + + start linpac detached and then attach if possible + +contrib/start-linpac.sh + +commit 178ede8 +Author: David Ranch +Date: 2015-11-29 + + better grepping, disabled logging for Ncurses UI + +contrib/start-linpac.sh + +commit 17c5f04 +Author: David Ranch +Date: 2015-11-19 + + Updated the Changelog to start 0.25 + +ChangeLog + +commit 1c67d7c +Author: David Ranch +Date: 2015-11-19 + + Updated to 0.25 version for next release + +README +configure.ac +contrib/packaging/rpm/linpac.spec +linpac.lsm + commit de8d158 Author: David Ranch Date: 2015-11-19 diff -Nru linpac-0.24/configure linpac-0.25/configure --- linpac-0.24/configure 2015-11-19 23:43:50.000000000 +0000 +++ linpac-0.25/configure 2017-12-11 04:47:41.000000000 +0000 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.63 for LinPac 0.24. +# Generated by GNU Autoconf 2.63 for LinPac 0.25. # # Report bugs to . # @@ -745,8 +745,8 @@ # Identity of this package. PACKAGE_NAME='LinPac' PACKAGE_TARNAME='linpac' -PACKAGE_VERSION='0.24' -PACKAGE_STRING='LinPac 0.24' +PACKAGE_VERSION='0.25' +PACKAGE_STRING='LinPac 0.25' PACKAGE_BUGREPORT='linpac@trinnet.net ' ac_unique_file="src/linpac.cc" @@ -1482,7 +1482,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures LinPac 0.24 to adapt to many kinds of systems. +\`configure' configures LinPac 0.25 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1552,7 +1552,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of LinPac 0.24:";; + short | recursive ) echo "Configuration of LinPac 0.25:";; esac cat <<\_ACEOF @@ -1655,7 +1655,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -LinPac configure 0.24 +LinPac configure 0.25 generated by GNU Autoconf 2.63 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1669,7 +1669,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by LinPac $as_me 0.24, which was +It was created by LinPac $as_me 0.25, which was generated by GNU Autoconf 2.63. Invocation command line was $ $0 $@ @@ -10917,7 +10917,7 @@ # Define the identity of the package. PACKAGE='linpac' - VERSION='0.24' + VERSION='0.25' cat >>confdefs.h <<_ACEOF @@ -15890,6 +15890,153 @@ fi +#Add specific tinfo checks for distros that are missing pkgconfig files for Ncurses - PClinux (mandriva) +{ $as_echo "$as_me:$LINENO: checking for tgetent in -ltinfo" >&5 +$as_echo_n "checking for tgetent in -ltinfo... " >&6; } +if test "${ac_cv_lib_tinfo_tgetent+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ltinfo $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char tgetent (); +int +main () +{ +return tgetent (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_tinfo_tgetent=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_tinfo_tgetent=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_tinfo_tgetent" >&5 +$as_echo "$ac_cv_lib_tinfo_tgetent" >&6; } +if test "x$ac_cv_lib_tinfo_tgetent" = x""yes; then + USE_TERMCAP_LIB=-ltinfo +else + { $as_echo "$as_me:$LINENO: checking for tgetent in -ltermcap" >&5 +$as_echo_n "checking for tgetent in -ltermcap... " >&6; } +if test "${ac_cv_lib_termcap_tgetent+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ltermcap $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char tgetent (); +int +main () +{ +return tgetent (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_termcap_tgetent=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_termcap_tgetent=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_termcap_tgetent" >&5 +$as_echo "$ac_cv_lib_termcap_tgetent" >&6; } +if test "x$ac_cv_lib_termcap_tgetent" = x""yes; then + USE_TERMCAP_LIB=-ltermcap +else + { { $as_echo "$as_me:$LINENO: error: Linpac requires ncurses library." >&5 +$as_echo "$as_me: error: Linpac requires ncurses library." >&2;} + { (exit 1); exit 1; }; } +fi + +fi + + + + # Definitions @@ -15901,7 +16048,7 @@ # TODO: move VERINFO to a more prominate location or eliminated it cat >>confdefs.h <<\_ACEOF -#define VERINFO "Development snapshot 080714" +#define VERINFO "Development snapshot 121017-develop" _ACEOF @@ -16381,7 +16528,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by LinPac $as_me 0.24, which was +This file was extended by LinPac $as_me 0.25, which was generated by GNU Autoconf 2.63. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -16444,7 +16591,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_version="\\ -LinPac config.status 0.24 +LinPac config.status 0.25 configured by $0, generated by GNU Autoconf 2.63, with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" diff -Nru linpac-0.24/configure.ac linpac-0.25/configure.ac --- linpac-0.24/configure.ac 2015-11-19 23:43:43.000000000 +0000 +++ linpac-0.25/configure.ac 2017-12-11 04:47:34.000000000 +0000 @@ -1,7 +1,7 @@ dnl Process this file with autoconf to produce a configure script. # Prelude -AC_INIT([LinPac], [0.24], [linpac@trinnet.net] , , [http://linpac.sourceforge.net/]) +AC_INIT([LinPac], [0.25], [linpac@trinnet.net] , , [http://linpac.sourceforge.net/]) AC_PREREQ([2.63]) AC_CONFIG_SRCDIR([src/linpac.cc]) AC_CONFIG_AUX_DIR([build-aux]) @@ -62,13 +62,20 @@ # Checks for library functions AC_CHECK_LIB([ncurses], [main], , [AC_MSG_ERROR([ncurses library not found !])]) +#Add specific tinfo checks for distros that are missing pkgconfig files for Ncurses - PClinux (mandriva) +AC_CHECK_LIB(tinfo, tgetent, USE_TERMCAP_LIB=-ltinfo, + AC_CHECK_LIB(termcap, tgetent, USE_TERMCAP_LIB=-ltermcap, + AC_MSG_ERROR([[Linpac requires ncurses library.]]))) + + + # Definitions AH_TEMPLATE([NEW_AX25], [AX.25 version]) AH_TEMPLATE([NO_SOCKLEN_T], [Socket length type]) AH_TEMPLATE([NEW_AX25], [AX.25 version]) AH_TEMPLATE([VERINFO], [Version string]) # TODO: move VERINFO to a more prominate location or eliminated it -AC_DEFINE([VERINFO], ["Development snapshot 080714"]) +AC_DEFINE([VERINFO], ["Development snapshot 121017-develop"]) # Package Options # TODO: make sure this is the up-to-date method and that it works right diff -Nru linpac-0.24/contrib/packaging/rpm/linpac.spec linpac-0.25/contrib/packaging/rpm/linpac.spec --- linpac-0.24/contrib/packaging/rpm/linpac.spec 2015-11-19 23:43:43.000000000 +0000 +++ linpac-0.25/contrib/packaging/rpm/linpac.spec 2017-12-11 04:47:34.000000000 +0000 @@ -1,7 +1,7 @@ #Spec file for LinPac %define name linpac -%define version 0.24 +%define version 0.25 %define release 1 %define debug_package %{nil} @@ -75,6 +75,8 @@ %postun %changelog +* Thu Nov 19 2015 David Ranch +- Start of 0.25 version * Fri Sep 18 2015 David Ranch - New 0.24 version * Wed Sep 16 2015 David Ranch diff -Nru linpac-0.24/contrib/start-linpac.sh linpac-0.25/contrib/start-linpac.sh --- linpac-0.24/contrib/start-linpac.sh 2015-11-19 23:43:43.000000000 +0000 +++ linpac-0.25/contrib/start-linpac.sh 2017-12-11 04:47:34.000000000 +0000 @@ -3,6 +3,9 @@ # /usr/local/sbin/start-linpac.sh # dranch@arrl.net +# 09/02/17 - Added a check for stale lock files +# 11/29/15 - Removed screen logging as it doesn't work well for Ncurses UIs +# - Start linpac and then attach to it if possible # 12/11/14 - Enabled screen logging to a specific file # 08/30/14 - disabled screen logging # 02/06/14 - Added screen loggin @@ -16,12 +19,20 @@ # # Don't enable screen logging (-L) as it just creates ANSI trash in the logs -if [ -n "`ps aux | grep -i screen | grep -i linpac`" ]; then +if [ -n "`ps aux | grep -v grep | grep -i screen | grep -i linpac`" ]; then echo -e "\nLinpac already running under Screen. Resuming" screen -d -r linpac else echo -e "\nPrevious Linpac not found. Starting" + if [ -f /var/lock/LinPac.0 ]; then + echo -e "\nPrevious LinPac lock file found in /var/lock/LinPac.0" + echo -e "Remove this lock file and try again" + exit 1 + fi date > /var/log/linpac.log - screen -c $HOME/.screenrc-svxlink -S linpac sudo linpac + screen -d -m -S linpac sudo linpac + #Comment out the following line if you don't want screen to attach to the + # started Linpac screen session right now + screen -d -r linpac fi diff -Nru linpac-0.24/debian/changelog linpac-0.25/debian/changelog --- linpac-0.24/debian/changelog 2020-03-22 15:47:39.000000000 +0000 +++ linpac-0.25/debian/changelog 2020-08-04 21:30:47.000000000 +0000 @@ -1,14 +1,12 @@ -linpac (0.24-3build2) focal; urgency=medium +linpac (0.25-1) unstable; urgency=medium - * No-change rebuild for libgcc-s1 package name change. + * Team upload. + * New upstream version. + * Add debian/gitlab-ci.yml. + * DH 13. + * Create salsa repository. - -- Matthias Klose Sun, 22 Mar 2020 16:47:39 +0100 - -linpac (0.24-3build1) cosmic; urgency=medium - - * No-change rebuild for ncurses soname changes. - - -- Matthias Klose Thu, 03 May 2018 15:20:01 +0000 + -- Christoph Berg Tue, 04 Aug 2020 23:30:47 +0200 linpac (0.24-3) unstable; urgency=medium diff -Nru linpac-0.24/debian/compat linpac-0.25/debian/compat --- linpac-0.24/debian/compat 2015-09-15 13:55:21.000000000 +0000 +++ linpac-0.25/debian/compat 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -9 diff -Nru linpac-0.24/debian/control linpac-0.25/debian/control --- linpac-0.24/debian/control 2017-07-03 12:43:32.000000000 +0000 +++ linpac-0.25/debian/control 2020-08-04 21:26:47.000000000 +0000 @@ -4,8 +4,10 @@ Homepage: https://sourceforge.net/projects/linpac/ Maintainer: Debian Hamradio Maintainers Uploaders: Colin Tuckley -Build-Depends: debhelper (>= 9), libax25-dev, libncurses-dev, ax25-apps, dh-autoreconf -Standards-Version: 3.9.8 +Build-Depends: debhelper-compat (= 13), libax25-dev, libncurses-dev, ax25-apps +Standards-Version: 4.5.0 +Vcs-Browser: https://salsa.debian.org/debian-hamradio-team/linpac +Vcs-Git: https://salsa.debian.org/debian-hamradio-team/linpac.git Package: linpac Architecture: any diff -Nru linpac-0.24/debian/gitlab-ci.yml linpac-0.25/debian/gitlab-ci.yml --- linpac-0.24/debian/gitlab-ci.yml 1970-01-01 00:00:00.000000000 +0000 +++ linpac-0.25/debian/gitlab-ci.yml 2020-08-04 20:58:22.000000000 +0000 @@ -0,0 +1,6 @@ +include: + - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/salsa-ci.yml + - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/pipeline-jobs.yml + +reprotest: + extends: .test-reprotest-diffoscope diff -Nru linpac-0.24/debian/rules linpac-0.25/debian/rules --- linpac-0.24/debian/rules 2015-09-18 09:38:17.000000000 +0000 +++ linpac-0.25/debian/rules 2020-08-04 21:20:23.000000000 +0000 @@ -1,8 +1,9 @@ #!/usr/bin/make -f -# -*- makefile -*- -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 +include /usr/share/dpkg/architecture.mk + +override_dh_auto_configure: + dh_auto_configure -- --libexecdir=/usr/lib/$(DEB_HOST_MULTIARCH) %: - dh $@ --with autoreconf + dh $@ diff -Nru linpac-0.24/doc/applguide.html linpac-0.25/doc/applguide.html --- linpac-0.24/doc/applguide.html 2015-11-19 23:43:43.000000000 +0000 +++ linpac-0.25/doc/applguide.html 2017-12-11 04:47:34.000000000 +0000 @@ -13,7 +13,8 @@
Version 0.16 -

(c) 1998 - 2001 by Radek Burget OK2JBG

+

(c) David Ranch KI6ZHD (linpac@trinnet.net) 2002 - 2016
+(c) 1998 - 2001 by Radek Burget OK2JBG


diff -Nru linpac-0.24/doc/events.txt linpac-0.25/doc/events.txt --- linpac-0.24/doc/events.txt 2015-11-19 23:43:43.000000000 +0000 +++ linpac-0.25/doc/events.txt 2017-12-11 04:47:34.000000000 +0000 @@ -2,7 +2,7 @@ ---------------------- This list contains the description of almost all events that can occur in -LinPac. Each application can generate any of these events and in can also +LinPac. Each application can generate any of these events and it can also handle any of them. The names of the source objects are written in parenthesis. The list of @@ -12,11 +12,17 @@ a) User interaction EV_KEY_PRESS (key pressed) -Generated by: The user interface (Keyscan) when a keyboard button is pressed +Generated by: The user interface (Keyscan) when a keyboard key is pressed Handled by : User interface Data : x - key code (ncurses-compatibile) y - 0 when Alt wasn't pressed +EV_KEY_PRESS_MULTI (multiple keys pressed) +Generated by: The user interface (Keyscan) when multiple printable keyboard + keys are pressed in rapid succession +Handled by : User interface +Data : data - pointer to c-string + EV_TEXT_RAW (raw output text) Generated by: Text editor (Editor*) when the text line is confirmed Macro processor (Macro*) (line from a macro) diff -Nru linpac-0.24/doc/manual.html linpac-0.25/doc/manual.html --- linpac-0.24/doc/manual.html 2015-11-19 23:43:43.000000000 +0000 +++ linpac-0.25/doc/manual.html 2017-12-11 04:47:34.000000000 +0000 @@ -5,7 +5,7 @@ - + LinPac User Manual @@ -16,8 +16,8 @@
-
Version 0.16 -

(c) 1998 - 2002 by Radek Burget OK2JBG

+
Version 0.25 +

(c) 1998 - 2017 by David Ranch KI6ZHD


@@ -85,38 +85,75 @@

2 First configuration

When linpac is started for the first time, it automaticaly creates the -directory called LinPac in your home directory. This directory contains -your personal LinPac configuration. When creating this directory LinPac asks -for basic information and prepares a useable configuration for you. -

LinPac functions are based on the very simple interpreted language (actually - it's not a language, it's something like the batch files in DOS). In the -LinPac home directory there is the subdirectory 'macro', that contains all -the scripts written in this language, let's call them macros. Each macro can -be run in LinPac and it implements some action. The simplest case of the -macro is normal text file, that is just printed to the screen (or sent to -the peer) when executed. The language is described in chapter -6.

- -

There is a macro called init.mac in the macro directory. - This macro is executed each time LinPac is started and contains the commands - to setup the callsigns and other settings. You can modify this file to change - the initial configuration of LinPac.

- -

You may also want to change following files:

- -

ctext.mac - this file is executed when the peer connects and should +directory called LinPac in the running user's home directory. This +directory will contain your personal LinPac configuration settings. After +creating this directory, LinPac asks for basic callsign, port and other +information and prepares a useable configuration for you. An example setup +dialog is as shows where we are using the bogus call "n0call" logging into +the local BBS "n0ary-1": +

+$ linpac + +Hello dear user. You seem to run LinPac for the first time. +LinPac has to create a directory in your home directory for storing +your personal configuration. + +For creating your personal configuration please answer following questions: + +Your callsign: +n0call + +Enter your home BBS callsign with SSID : +n0ary-1 + +Enter the name of port to connect N0ARY-1 +d710 + +Enter the digipeaters used to connect N0ARY-1 or press enter +when no digipeaters are used: + + +Enter the full hierarchical address of N0ARY-1 +(e.g. #MOR.CZE.EU) +#NCA.CA.USA.NOAM + +Thank you, N0CALL +Please wait a moment for creating your personal configuration +Installation done. +Press ENTER to run LinPac +

+

The above information is then stored in the $HOME/LinPac/macro/init.mac file as +various 'functions'. These functions are based on the very simple interpreted +language (actually it's not a language but something like the batch files in +DOS). In the LinPac/macro directory, it contains all the scripts written in this +language. The init.mac macro is loaded at start of loading Linpac which contains +the commands to setup the callsigns and other settings. You can modify this file +to change the initial configuration of LinPac. Other macros can be run in LinPac +desired or required. The simplest case of the macro is normal text file that is +just printed to the screen (or sent to the remote peer) when executed. The language +is described in chapter 6.

+ +

You may also want to review/change following macro files:

+ +

+ info.mac - contains the information about your system +ctext.mac - this file is executed when the peer connects and should contain the greeting text
quit.mac - this is called when user enters the Quit command (end of connection). It should print some farewell and disconnect.
- info.mac - contains the information about your system

+

-

After this you should be able to make your first connection.

+

After this you should be able to make your first connection. +

3 LinPac controls

- After running LinPac the main screen apears. In the standard configuraion - it's divided to five parts (described from top of the screen to bottom): + After automatically running the LinPac setup routing, the main screen should apear. +If you see a segmentation fault, please see +Linux AX.25 issues with long predictable network interface names for a work around. +Moving on, in Linpac's main interface in the standard configuraion, the screen is divided +to five parts (described from top of the screen to bottom):
  • QSO window: this window contains the text that came from the @@ -478,8 +515,8 @@ add the argument -c <callsign>.

    Examples:
    - :Name John
    - :Name -c OK2JBG -l JN89HF Radek
    + :Name David
    + :Name -c KI6ZHD -l CM97ai David
    :Name -i

    @@ -830,6 +867,7 @@

10 Copying

+ LinPac is Copyright (c) 2002-2016 bu David Ranch KI6ZHD LinPac is Copyright (c) 1998-2002 by Radek Burget, OK2JBG

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -1274,12 +1312,12 @@


-
Last update: 29.7.2002 +
Last update: 11/5/2017
Please report any mistakes to radkovo@centrum.cz
+ href="mailto:linpac@trinnet.net">linpac@trinnet.net

diff -Nru linpac-0.24/doc/objects.txt linpac-0.25/doc/objects.txt --- linpac-0.24/doc/objects.txt 2015-11-19 23:43:43.000000000 +0000 +++ linpac-0.25/doc/objects.txt 2017-12-11 04:47:34.000000000 +0000 @@ -8,8 +8,8 @@ ----------------+----------------------------------------------------------- SCREEN | Screen manager. | - Keyscan | Reads the keyboard, generates appropriate events when a - | key is pressed (EV_KEY_PRESS) + Keyscan | Reads the keyboard, generates appropriate events when one or + | more keys are pressed (EV_KEY_PRESS, EV_KEY_PRESS_MULTI) | Command | Interpret commands represented by EV_DO_COMMANDS, | EV_TEXT_COOKED (starting with :) or EV_LINE_RECV @@ -33,7 +33,8 @@ QSOWin8 | in EV_DATA_INPUT, EV_DATA_OUTPUT and EV_LOCAL_MSG events. | Editor0 - | Editor windows each channel (0 = unproto mode). Reads the - Editor8 | EV_KEY_PRESSED events and produces EV_TEXT_RAW events. + Editor8 | EV_KEY_PRESSED and EV_KEY_PRESS_MULTI events and produces + | EV_TEXT_RAW events. | Statln1 - | Managers of additional status lines (one for each Statln8 | channel). diff -Nru linpac-0.24/linpac.lsm linpac-0.25/linpac.lsm --- linpac-0.24/linpac.lsm 2015-11-19 23:43:43.000000000 +0000 +++ linpac-0.25/linpac.lsm 2017-12-11 04:47:34.000000000 +0000 @@ -1,7 +1,7 @@ Begin4 Title: linpac -Version: 0.24 -Entered-date: 18 Sep 15 +Version: 0.25 +Entered-date: 19 Nov 15 Description: Terminal for packet radio with mail client Keywords: AX.25 packet radio terminal Author: dranch@trinnet.net (David Ranch) diff -Nru linpac-0.24/macro/commands linpac-0.25/macro/commands --- linpac-0.24/macro/commands 2015-11-19 23:43:43.000000000 +0000 +++ linpac-0.25/macro/commands 2017-12-11 04:47:34.000000000 +0000 @@ -21,3 +21,5 @@ users Users users CStatus pw PW +sb SB +sp SP diff -Nru linpac-0.24/macro/en/help.mac linpac-0.25/macro/en/help.mac --- linpac-0.24/macro/en/help.mac 2015-11-19 23:43:43.000000000 +0000 +++ linpac-0.25/macro/en/help.mac 2017-12-11 04:47:34.000000000 +0000 @@ -1,24 +1,27 @@ LinPac - available commands ~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - //Activity - print the time since last operator response - //Bell - call operator by acoustic signal - //CStatus - list of connected stations - //Disconnect - end the QSO immediately - //Echo - send the text back - //Help - this help - //Info - print station info - //MHeard - list of heard stations - //Name - store your name - //Quit - normal end of QSO - //Read - send text file - //RBin - send binary file - //RPrg - send the file using autobin protocol - //RTt - determine round trip time - //Users - list of connected stations - //VERsion - print the version of LinPac - //Write - Start writing to the text file (stop with "//W off") - //WBin - Start writing to the binary file - (stop with "//WBin off") - //YPUT - send the file using YAPP protocol + //Activity - print the time since last operator response + //Bell - call operator by acoustic signal + //COMPress - Turn on Huffman compression - your client must + support compression for this to work + //CStatus - list of connected stations + //Disconnect - end the QSO immediately + //Echo - send the text back + //Help - this help + //Info - print station info + //MHeard - list of heard stations + //Name - store your name + //Quit - normal end of QSO + //Read - send text file + //RBin - send binary file + //RPrg - send the file using autobin protocol + //RTt - determine round trip time (linpac to linpac ping) + //SP
[subject] - write a Private message to user [opt. subject] + //SB
[subject] - write a Bulletin message to everyone [opt. subject] + //Users - list of connected stations + //VERsion - print the version of LinPac + //Write - Start writing to the text file (stop with "//W off") + //WBin - Start writing to the binary file + (stop with "//WBin off") + //YPUT - send the file using YAPP protocol diff -Nru linpac-0.24/macro/help.mac linpac-0.25/macro/help.mac --- linpac-0.24/macro/help.mac 2015-11-19 23:43:43.000000000 +0000 +++ linpac-0.25/macro/help.mac 2017-12-11 04:47:34.000000000 +0000 @@ -1,24 +1,27 @@ LinPac - available commands ~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - //Activity - print the time since last operator response - //Bell - call operator by acoustic signal - //CStatus - list of connected stations - //Disconnect - end the QSO immediately - //Echo - send the text back - //Help - this help - //Info - print station info - //MHeard - list of heard stations - //Name - store your name - //Quit - normal end of QSO - //Read - send text file - //RBin - send binary file - //RPrg - send the file using autobin protocol - //RTt - determine round trip time - //Users - list of connected stations - //VERsion - print the version of LinPac - //Write - Start writing to the text file (stop with "//W off") - //WBin - Start writing to the binary file - (stop with "//WBin off") - //YPUT - send the file using YAPP protocol + //Activity - print the time since last operator response + //Bell - call operator by acoustic signal + //COMPress - Turn on Huffman compression - your client must + support compression for this to work + //CStatus - list of connected stations + //Disconnect - end the QSO immediately + //Echo - send the text back + //Help - this help + //Info - print station info + //MHeard - list of heard stations + //Name - store your name + //Quit - normal end of QSO + //Read - send text file + //RBin - send binary file + //RPrg - send the file using autobin protocol + //RTt - determine round trip time (linpac to linpac ping) + //SP
[subject] - write a Private message to user [opt. subject] + //SB
[subject] - write a Bulletin message to everyone [opt. subject] + //Users - list of connected stations + //VERsion - print the version of LinPac + //Write - Start writing to the text file (stop with "//W off") + //WBin - Start writing to the binary file + (stop with "//WBin off") + //YPUT - send the file using YAPP protocol diff -Nru linpac-0.24/macro/init.mac linpac-0.25/macro/init.mac --- linpac-0.24/macro/init.mac 2015-11-19 23:43:43.000000000 +0000 +++ linpac-0.25/macro/init.mac 2017-12-11 04:47:34.000000000 +0000 @@ -36,25 +36,26 @@ mycall@6 #CALL# mycall@7 #CALL# mycall@8 #CALL# -;; Unproto calls +;; Unproto calls destination (unsrc) and digi path (undest) unsrc LINPAC undest INFO ;; Other settings cbell on knax on +;; Required to be on or linpac won't accept any // commands from the remote user remote on infolevel 1 ;; Default QRG set QRG@0 "144.8125 MHz" -;; Default encoding translation (for all channels) +;; Default encoding translation (for all channels) - controlled by terminal 0 set DEF_ENC@0 iso1 translate %DEF_ENC@0 ;; Default set of enabled remote commands -set DEF_RCMD@0 "AB D E VER L RP B MH N RT YPUT W R WB RB A CONV I H Q U CS" +set DEF_RCMD@0 "AB D E VER L RP B MH N RT YPUT W R WB RB A COMP CONV I H Q U CS SP SB" ;; Paths set SAVE_PATH "./save" diff -Nru linpac-0.24/README linpac-0.25/README --- linpac-0.24/README 2015-11-19 23:43:43.000000000 +0000 +++ linpac-0.25/README 2017-12-11 04:47:34.000000000 +0000 @@ -1,6 +1,6 @@ -LinPac version 0.24 (stable release) -Copyright (c) 2015 by David Ranch (KI6ZHD) +LinPac version 0.25 (stable release) +Copyright (c) 2017 by David Ranch (KI6ZHD) Linpac is a modular console-oriented packet radio terminal for Linux with a built-in messaging client. Using Linux's native AX.25 network stack, it @@ -22,12 +22,15 @@ - David Ranch (KI6ZHD) Packet radio mail: KI6ZHD@N0ARY.#NCA.CA.USA.NOAM + - Martin Cooper (KD6YAM) - Polling load reduction; mail bug fixes; warning cleanups - Jerry Dunmire (KA6HLD) - Auto-tools - Steven Loomis (K6SPI) - Misc patches -Many thanks to the original author of Linpac: -Radek Burget OK2JBG ( radkovo@centrum.cz ) +Many thanks to the original author of Linpac for creating this flexible +and valuable package for Linux: + + Radek Burget OK2JBG ( radkovo@centrum.cz ) QUICK INSTALATION FROM A RELEASE PACKAGE @@ -41,7 +44,7 @@ --------- If you plan to use Linpac for recieving and sending your packet mail via a remote BBS system (not required), you must install the ax25mail-utils - package first before first running Linpac. This package can be found + package first BEFORE first running Linpac. This package can be found at http://ax25mail.sf.net @@ -51,7 +54,7 @@ their own repositories, they are usually very old and lack several important fixes. You can read more about these improvements here: - https://code.google.com/p/linuxax25/wiki/Ax25AppsDiffs + https://github.com/ve7fet/linuxax25 Dependencies: @@ -66,28 +69,50 @@ I recommend all users install or build the AX.25 stack from this alternative provider for now: - https://code.google.com/p/linuxax25/source/browse/#svn%2Fdownloads + https://github.com/ve7fet/linuxax25 Once you have installed the above dependencies, please run: ./configure -NOTE: If the "configure" prompt isn't present, you probably got the sources - from Git. If so, run the following: +NOTE: If the "configure" prompt isn't present, you probably got your source + code from Git. If so, run the following: autoreconf --install ./configure - If autoreconf doesn't run, you need to install the Auto-tools: - Deb-based: + If autoreconf doesn't run, it probably means you need to install Autotools: + + deb-based: sudo apt-get install automake autoconf rpm-based yum install automake autoconf + If "autoreconf --install" fails with: + + src/applications/liblinpac/Makefile.am:4: error: Libtool library used but 'LIBTOOL' is undefined + src/applications/liblinpac/Makefile.am:4: The usual way to define 'LIBTOOL' is to add 'LT_INIT' + src/applications/liblinpac/Makefile.am:4: to 'configure.ac' and run 'aclocal' and 'autoconf' again. + src/applications/liblinpac/Makefile.am:4: If 'LT_INIT' is in 'configure.ac', make sure + src/applications/liblinpac/Makefile.am:4: its definition is in aclocal's search path. + + Do the following: + + deb-based: + sudo apt-get install libtool + libtoolize + autoreconf --install + + rpm-based: + sudo yum install libtool + libtoolize + autoreconf --install + + The default installation destination directory prefix is /usr/local/*. If you want to change this, add the following configuure --prefix switch: @@ -151,11 +176,46 @@ KNOWN PROBLEMS ~~~~~~~~~~~~~~ + + - Signifincant issue with AX.25 and Raspbian Stretch + + I have confirmed that with Raspian Stretch, there is some sort of conflict with + it's newly enabled predictable network interface names. What are those? If you + run the command "ifconfig" or "ip addr", you will no longer see Ethernet + interfaces with names like "eth0" but instead, you'll see something like + "enxb827eb5f05". How's that for catchy? For known reasons to the AX.25 kernel + maintainers, in the sa_data kernel data structure, both the stock Raspbian AX.25 + .debs and the 3rd party VE7FET ax.25 debs will give errors like the following when + ANY network interface name is longer than 13 characters: + + SIOCGIFHWADDR: No such device + + Programs like beacon will fail to start. Linpac will also crash upon start with + + /usr/bin/linpac: line 181: 9811 Segmentation fault $PKG_BINDIR/linpac $* + + Fortunately, if you disable predictable network interface names, things work fine. + To do this, do the following steps: + + sudo vi /boot/cmdline.txt + + #append the following to the end of the one line in this file + net.ifnames=0 biosdevname=0 + + Reboot your Raspberry Pi and things will work from there on out. Btw, if Linpac + crashed on you, your terminal might be screwed up and not working properly. + + To fix that, run the commands: + + stty sane + rm -f rm /var/lock/LinPac.0 + + - The --enable-LINKSTATIC configuration option does not work. + - The --enable-LINKSTATIC configuration option does not work. Please see the linpac-todo.txt file in this source package as well as see - http://linpac.sf.net for actual problems and their solution. + http://linpac.sf.net for other possible problems and their solutions. NOTES FOR HACKING with the Source code diff -Nru linpac-0.24/src/applications/autobin.cc linpac-0.25/src/applications/autobin.cc --- linpac-0.24/src/applications/autobin.cc 2015-11-19 23:43:43.000000000 +0000 +++ linpac-0.25/src/applications/autobin.cc 2017-12-11 04:47:34.000000000 +0000 @@ -256,8 +256,10 @@ lp_remove_statline(); message("LinPac: Autobin RX finished, CRC = %i.\r", crc); if (!old_form) + { if (crc == ex_crc) message(" CRC check OK.\r"); else message(" CRC check FAILED.\r"); + } fclose(f); if (ut.actime != 0) utime(fname, &ut); diff -Nru linpac-0.24/src/applications/bell.cc linpac-0.25/src/applications/bell.cc --- linpac-0.24/src/applications/bell.cc 2015-11-19 23:43:43.000000000 +0000 +++ linpac-0.25/src/applications/bell.cc 2017-12-11 04:47:34.000000000 +0000 @@ -49,7 +49,7 @@ int main(int argc, char **argv) { - int dsp; + //int dsp; int i; int active; diff -Nru linpac-0.24/src/applications/getmsg.cc linpac-0.25/src/applications/getmsg.cc --- linpac-0.24/src/applications/getmsg.cc 2015-11-19 23:43:43.000000000 +0000 +++ linpac-0.25/src/applications/getmsg.cc 2017-12-11 04:47:34.000000000 +0000 @@ -87,7 +87,6 @@ int get_one_message(FILE *fin, char **buf, int *bsize, char *title) { int eot; - int hd_length; int ch; char c; char ofset[7]; @@ -107,7 +106,7 @@ fprintf(stderr, "getmsg: bad starting character (0x%x)\n", ch); return 2; /* format violated */ } - hd_length = safe_fgetc(fin); + (void)safe_fgetc(fin); // read and discard header length lp_statline("Reading message"); diff -Nru linpac-0.24/src/applications/join.c linpac-0.25/src/applications/join.c --- linpac-0.24/src/applications/join.c 2015-11-19 23:43:43.000000000 +0000 +++ linpac-0.25/src/applications/join.c 2017-12-11 04:47:34.000000000 +0000 @@ -1,5 +1,6 @@ /* join - join two LinPac channels + (c) David Ranch KI6ZHD (linpac@trinnet.net) 2002 - 2016 (c) 1998-2001 by OK2JBG */ #include @@ -62,8 +63,6 @@ int main(int argc, char **argv) { - char teststr[256]; - lp_app_ident("join"); if (lp_start_appl()) { diff -Nru linpac-0.24/src/applications/liblinpac/lpapp.c linpac-0.25/src/applications/liblinpac/lpapp.c --- linpac-0.24/src/applications/liblinpac/lpapp.c 2015-11-19 23:43:43.000000000 +0000 +++ linpac-0.25/src/applications/liblinpac/lpapp.c 2017-12-11 04:47:34.000000000 +0000 @@ -31,8 +31,11 @@ /* Path to AXPORTS */ #define AXPORTS "/etc/ax25/axports" -/* Number of waiting cycles for creating the event gate */ -#define WAIT_CYCLES 64 +/* Delay time while waiting for event gate, in nsecs */ +#define GATE_WAIT_DELAY 10*1000*1000 + +/* How long to wait for app startup, in secs */ +#define MAX_GATE_WAIT 2 /* LinPac TCP port */ #define API_PORT 0x4c50 @@ -232,8 +235,9 @@ Event ev; struct sockaddr_in addr; struct hostent *host; - int cnt = WAIT_CYCLES; /* Number of waiting cycles for creating - the event gate */ + struct timespec delay; + time_t wait_start; + long waited; setlocale(LC_ALL, ""); /* use locale */ setbuf(stdout, NULL); /* linpac does the buffering for us */ app_pid = getpid(); @@ -279,17 +283,18 @@ ev.type = EV_NONE; ev.data = NULL; /* Wait for the gate */ + delay.tv_sec = 0; + delay.tv_nsec = GATE_WAIT_DELAY; + wait_start = time(NULL); do { /* LinPac will signal the remote application before creating the gate */ if (lp_get_event(&ev) && ev.type == EV_APP_STREMOTE && ev.x == app_pid) - { - cnt = WAIT_CYCLES; app_remote = 1; - } - cnt--; /* wait cycles */ - } while ((ev.type != EV_GATE_FINISHED || ev.x != app_pid) && cnt > 0); - if (cnt <= 0) { close(sock); return 0; }/* timeout */ + nanosleep(&delay, NULL); /* ignore any interruptions */ + waited = time(NULL) - wait_start; + } while ((ev.type != EV_GATE_FINISHED || ev.x != app_pid) && waited < MAX_GATE_WAIT); + if (waited >= MAX_GATE_WAIT) { close(sock); return 0; }/* timeout */ app_chn = ev.chn; /* connection established */ /* close sockets on exit */ diff -Nru linpac-0.24/src/applications/logbook.cc linpac-0.25/src/applications/logbook.cc --- linpac-0.24/src/applications/logbook.cc 2015-11-19 23:43:43.000000000 +0000 +++ linpac-0.25/src/applications/logbook.cc 2017-12-11 04:47:34.000000000 +0000 @@ -5,6 +5,7 @@ Usage: logbook */ #include +#include #include #include #include @@ -52,7 +53,9 @@ void stop_record(char *logname, char *dest, char *qrg) { FILE *f, *t; - char tname[256], s[256]; + int tfd; + char tname[] = "/tmp/logbookXXXXXX"; + char s[256]; f = fopen(logname, "r"); if (f == NULL) @@ -61,13 +64,14 @@ return; } - if (tmpnam(tname) == NULL) + tfd = mkstemp(tname); + if (tfd == -1) { fprintf(stderr, "logbook: cannot generate temp filename\n"); } else { - t = fopen(tname, "w"); + t = fdopen(tfd, "w"); if (t == NULL) { fprintf(stderr, "logbook: cannot open temp file %s\n", tname); diff -Nru linpac-0.24/src/applications/mailer/mail.cc linpac-0.25/src/applications/mailer/mail.cc --- linpac-0.24/src/applications/mailer/mail.cc 2015-11-19 23:43:43.000000000 +0000 +++ linpac-0.25/src/applications/mailer/mail.cc 2017-12-11 04:47:34.000000000 +0000 @@ -16,6 +16,7 @@ #include #include #include +#include #include "lpapp.h" #include "mail_call.h" #include "mail_data.h" @@ -87,7 +88,7 @@ } else act = false; } - else if (act && ev->type == EV_KEY_PRESS) + else if (act && (ev->type == EV_KEY_PRESS || ev->type == EV_KEY_PRESS_MULTI)) { main_scr.handle_event(ev); if (focused != NULL) diff -Nru linpac-0.24/src/applications/mailer/mail_comp.cc linpac-0.25/src/applications/mailer/mail_comp.cc --- linpac-0.24/src/applications/mailer/mail_comp.cc 2015-11-19 23:43:43.000000000 +0000 +++ linpac-0.25/src/applications/mailer/mail_comp.cc 2017-12-11 04:47:34.000000000 +0000 @@ -9,14 +9,15 @@ mail_comp.cc - message composer interface */ +#include #include "mail_comp.h" #include "mail_edit.h" Composer *comp; -void start_composer(void *parent, int wx1, int wy1, int wx2, int wy2, char *toaddr, char *subject) +void start_composer(WINDOW *parent, int wx1, int wy1, int wx2, int wy2, char *toaddr, char *subject) { - comp = new Composer((WINDOW *)parent, wx1, wy1, wx2, wy2, toaddr, subject); + comp = new Composer(parent, wx1, wy1, wx2, wy2, toaddr, subject); } void comp_insert(char *s, bool quote) diff -Nru linpac-0.24/src/applications/mailer/mail_comp.h linpac-0.25/src/applications/mailer/mail_comp.h --- linpac-0.24/src/applications/mailer/mail_comp.h 2015-11-19 23:43:43.000000000 +0000 +++ linpac-0.25/src/applications/mailer/mail_comp.h 2017-12-11 04:47:34.000000000 +0000 @@ -11,7 +11,7 @@ */ extern char old_help[80]; //help text to be set back after editor finishes -void start_composer(void *parent, int wx1, int wy1, int wx2, int wy2, char *toaddr, char *subject); +void start_composer(WINDOW *parent, int wx1, int wy1, int wx2, int wy2, char *toaddr, char *subject); void comp_insert(char *s, bool quote = true); void comp_edredraw(); diff -Nru linpac-0.24/src/applications/mailer/mail_edit.cc linpac-0.25/src/applications/mailer/mail_edit.cc --- linpac-0.24/src/applications/mailer/mail_edit.cc 2015-11-19 23:43:43.000000000 +0000 +++ linpac-0.25/src/applications/mailer/mail_edit.cc 2017-12-11 04:47:34.000000000 +0000 @@ -17,6 +17,7 @@ #include #include #include +#include #include "lpapp.h" #include "mail_edit.h" @@ -27,11 +28,17 @@ #define LINE_LEN 200 #define ADDR_LEN 64 -#define SCREEN_LINES (x2-x1-2) +#define ADDR_FMT "%-64.64s" +#define SUBJ_LEN 78 +#define SUBJ_FMT "%-78.78s" +#define ENC_LEN 32 +#define ENC_FMT "%-32.32s" +#define HEADER_FMT(hdr,fmt) ("%-7.7s : " fmt) , hdr #define TAB_SIZE 8 #define SYSLINES 3 +#define SCREEN_LINES (x2-x1-2) //uncoment this to make BS to skip to previous line when pressed at the //begining of line @@ -206,6 +213,20 @@ wmove(win, cry, crx); wrefresh(win); } + + if (ev->type==EV_KEY_PRESS_MULTI) + { + if (!ev->y) + { + // Treat this the same as if we received multiple EV_KEY_PRESS events + // where each event is guaranteed to be only a printable character. + char *buffer = (char *)ev->data; + for (unsigned ix = 0; ix < strlen(buffer); ix++) + newch(buffer[ix]); + } + wmove(win, cry, crx); + wrefresh(win); + } } void Editor::draw(bool all) @@ -451,7 +472,7 @@ char *p = s; while (*p) { - if (*p < convcnt) *p = conv[*p]; + if (*p < convcnt) *p = conv[(unsigned)*p]; p++; } } @@ -493,8 +514,8 @@ } else strcpy(to, ""); - subj = new char[LINE_LEN]; - if (subject != NULL) strncpy(subj, subject, LINE_LEN-1); + subj = new char[SUBJ_LEN]; + if (subject != NULL) strncpy(subj, subject, SUBJ_LEN-1); else strcpy(subj, ""); //win = subwin(parent, y2-y1+1, x2-x1+1, y1, x1); @@ -512,7 +533,7 @@ ed = new Editor(win, x1+1, y1+SYSLINES+3, x2-1, y2-1, maxlines); load_texts(); - old_focus_window = (WINDOW *) focus_window; + old_focus_window = focus_window; focus_window = win; old_focused = focused; focused = this; @@ -616,8 +637,10 @@ else ed->errormsg("Cannot open file"); delete[] name; } + return; } - else if (ev->type == EV_KEY_PRESS) + + if (ev->type == EV_KEY_PRESS) { ed->clear_error(); if (!ev->y) switch (ev->x) @@ -709,11 +732,36 @@ if (toupper(ev->x) == 'P' || toupper(ev->x) == 'B') type = toupper(ev->x); if (cry == 2) - if (strlen(to)type == EV_KEY_PRESS_MULTI) + { + // Only triggered by pasting, so here we need only support the To and Subject + // fields, plus the editor. + ed->clear_error(); + if (cry > SYSLINES) // editor + ed->handle_event(ev); + else if (cry == 0 || cry == 2) // To or Subject + { + // Treat this the same as if we received multiple EV_KEY_PRESS events + // where each event is guaranteed to be only a printable character. + char *buffer = (char *)ev->data; + char *target = (cry == 0 ? to : subj); + unsigned target_len = (cry == 0 ? ADDR_LEN : SUBJ_LEN); + for (unsigned ix = 0; ix < strlen(buffer); ix++) + { + if (strlen(target)type == EV_KEY_PRESS || ev->type == EV_KEY_PRESS_MULTI) + { if (cry <= SYSLINES) draw_header(); if (cry == 0) {crx = strlen(to); wmove(win, 1, 12+crx);} if (cry == 1) {crx = 0; wmove(win, 2, 12);} @@ -725,13 +773,13 @@ void Composer::draw_header() { - mvwprintw(win, 1, 2, "To : %-40.40s", to); - mvwprintw(win, 2, 2, "Type : %c", type); - mvwprintw(win, 3, 2, "Subject : %-40.40s", subj); + mvwprintw(win, 1, 2, HEADER_FMT("To",ADDR_FMT), to); + mvwprintw(win, 2, 2, HEADER_FMT("Type","%c"), type); + mvwprintw(win, 3, 2, HEADER_FMT("Subject",SUBJ_FMT), subj); if (ttabnum == -1) - mvwprintw(win, 4, 2, "Encode : "); + mvwprintw(win, 4, 2, HEADER_FMT("Encode","")); else - mvwprintw(win, 4, 2, "Encode : %-40.40s", tables[ttabnum]); + mvwprintw(win, 4, 2, HEADER_FMT("Encode",ENC_FMT), tables[ttabnum]); } void Composer::draw(bool all) @@ -831,7 +879,7 @@ if (ttabnum > -1) load_table(ttabnum); //translate subject for (unsigned i = 0; i < strlen(subj); i++) - if (subj[i] < ttabsize) subj[i] = ttable[subj[i]]; + if (subj[i] < ttabsize) subj[i] = ttable[(unsigned)subj[i]]; //get source callsign char *mycall = strdup(call_call(lp_chn_call(lp_channel()))); @@ -881,7 +929,7 @@ if (ed->line[i].editable) { for (unsigned i = 0; i < strlen(s); i++) - if (s[i] < ttabsize) s[i] = ttable[s[i]]; + if (s[i] < ttabsize) s[i] = ttable[(unsigned)s[i]]; fprintf(f, "%s\n", s); } } diff -Nru linpac-0.24/src/applications/mailer/mail_filt.cc linpac-0.25/src/applications/mailer/mail_filt.cc --- linpac-0.24/src/applications/mailer/mail_filt.cc 2015-11-19 23:43:43.000000000 +0000 +++ linpac-0.25/src/applications/mailer/mail_filt.cc 2017-12-11 04:47:34.000000000 +0000 @@ -12,6 +12,7 @@ #include #include #include +#include #include "mail_filt.h" @@ -235,26 +236,24 @@ } //------------------------------------------------------------------------- -#include -void BoardList::init_screen(void *pwin, int height, int width, int wy, int wx) +void BoardList::init_screen(WINDOW *pwin, int height, int width, int wy, int wx) { xsize = width; ysize = height; x = wx; y = wy; - //WINDOW *win = subwin(reinterpret_cast(pwin), ysize, xsize, y, x); - WINDOW *win = reinterpret_cast(pwin); - mwin = win; - keypad(win, true); - meta(win, true); - nodelay(win, true); + //WINDOW *win = subwin(pwin, ysize, xsize, y, x); + mwin = pwin; + keypad(pwin, true); + meta(pwin, true); + nodelay(pwin, true); draw(true); old_focus_window = focus_window; - focus_window = win; + focus_window = pwin; old_focused = focused; focused = this; @@ -263,19 +262,17 @@ void BoardList::draw(bool all) { - WINDOW *win = reinterpret_cast(mwin); - if (all) { - wbkgdset(win, ' ' | COLOR_PAIR(C_TEXT) | A_BOLD); - werase(win); - box(win, ACS_VLINE, ACS_HLINE); - mvwprintw(win, 0, 2, "Select bulletins"); - mvwprintw(win, 1, 4, "Groups"); - mvwprintw(win, 1, COLUMN1+4, "Bulletins"); + wbkgdset(mwin, ' ' | COLOR_PAIR(C_TEXT) | A_BOLD); + werase(mwin); + box(mwin, ACS_VLINE, ACS_HLINE); + mvwprintw(mwin, 0, 2, "Select bulletins"); + mvwprintw(mwin, 1, 4, "Groups"); + mvwprintw(mwin, 1, COLUMN1+4, "Bulletins"); - mvwvline(win, 1, COLUMN1, ACS_VLINE, ysize-2); - mvwvline(win, 1, COLUMN2, ACS_VLINE, ysize-2); + mvwvline(mwin, 1, COLUMN1, ACS_VLINE, ysize-2); + mvwvline(mwin, 1, COLUMN2, ACS_VLINE, ysize-2); } //Draw group names @@ -286,18 +283,18 @@ if (gslct == i+gpos && col == 0) attr = COLOR_PAIR(C_SELECT); else attr = COLOR_PAIR(C_UNSELECT); - wbkgdset(win, ' ' | attr); + wbkgdset(mwin, ' ' | attr); int sl; if (groups[i+gpos].sel) sl = ACS_BULLET; else sl = ' '; - mvwprintw(win, i+2, 2, "%c %-*.*s", sl, COLUMN1-5, COLUMN1-5, groups[i+gpos].name); + mvwprintw(mwin, i+2, 2, "%c %-*.*s", sl, COLUMN1-5, COLUMN1-5, groups[i+gpos].name); } else { - wbkgdset(win, COLOR_PAIR(C_TEXT)); - mvwprintw(win, i+2, 2, "%-*.*s", COLUMN1-3, COLUMN1-3, ""); + wbkgdset(mwin, COLOR_PAIR(C_TEXT)); + mvwprintw(mwin, i+2, 2, "%-*.*s", COLUMN1-3, COLUMN1-3, ""); } //Draw bulletin names @@ -308,21 +305,21 @@ if (slct == i+pos && col == 1) attr = COLOR_PAIR(C_SELECT); else attr = COLOR_PAIR(C_UNSELECT); - wbkgdset(win, ' ' | attr); + wbkgdset(mwin, ' ' | attr); int sl; if (boards[i+pos].sel) sl = ACS_BULLET; else sl = ' '; - mvwprintw(win, i+2, COLUMN1+2, "%c %-*.*s", sl, COLUMN2-COLUMN1-5, COLUMN2-COLUMN1-5, boards[i+pos].name); + mvwprintw(mwin, i+2, COLUMN1+2, "%c %-*.*s", sl, COLUMN2-COLUMN1-5, COLUMN2-COLUMN1-5, boards[i+pos].name); } else { - wbkgdset(win, COLOR_PAIR(C_TEXT)); - mvwprintw(win, i+2, COLUMN1+2, "%-*.*s", COLUMN2-COLUMN1-3, COLUMN2-COLUMN1-3, ""); + wbkgdset(mwin, COLOR_PAIR(C_TEXT)); + mvwprintw(mwin, i+2, COLUMN1+2, "%-*.*s", COLUMN2-COLUMN1-3, COLUMN2-COLUMN1-3, ""); } - wnoutrefresh(win); + wnoutrefresh(mwin); for (int i = 0; i < 5; i++) doupdate(); //must be done many times, don't know why } @@ -331,7 +328,11 @@ if (wait_gname) { wait_gname = false; - if (iline != NULL) delete iline; + if (iline != NULL) + { + delete iline; + iline = NULL; + } if (strlen(ibuffer) > 0) { @@ -356,7 +357,11 @@ if (wait_gdel) { wait_gdel = false; - if (iline != NULL) delete iline; + if (iline != NULL) + { + delete iline; + iline = NULL; + } if (ibuffer[0] == 'Y' || ibuffer[0] == 'y') { @@ -371,6 +376,7 @@ if (ev->type == EV_KEY_PRESS) { if (ev->x == KEY_DOWN) + { if (col == 0) { if (gslct < groups.size()-1) gslct++; @@ -381,8 +387,10 @@ if (slct < boards.size()-1) slct++; if (slct-pos >= ysize-3) pos++; } + } if (ev->x == KEY_UP) + { if (col == 0) { if (gslct > 0) gslct--; @@ -393,6 +401,7 @@ if (slct > 0) slct--; if (slct < pos) pos--; } + } if (ev->x == KEY_NPAGE) for (unsigned j=0; j < (ysize-3); j++) @@ -421,6 +430,7 @@ } if (ev->x == '\t') + { if (col == 1) { col = 0; @@ -431,6 +441,7 @@ col = 1; help(HELP_BOARDS2); } + } //select bulletins in group if (col == 0) diff -Nru linpac-0.24/src/applications/mailer/mail_filt.h linpac-0.25/src/applications/mailer/mail_filt.h --- linpac-0.24/src/applications/mailer/mail_filt.h 2015-11-19 23:43:43.000000000 +0000 +++ linpac-0.25/src/applications/mailer/mail_filt.h 2017-12-11 04:47:34.000000000 +0000 @@ -60,7 +60,7 @@ class BoardList : public screen_obj { private: - void *mwin; //window + WINDOW *mwin; //window unsigned x, y, xsize, ysize; //window position unsigned slct, gslct; //selected bulletin, group unsigned pos, gpos; //scroll position in bulletins, groups @@ -71,7 +71,7 @@ char ibuffer[30]; //input line buffer InputLine *iline; //input line - void *old_focus_window; + WINDOW *old_focus_window; screen_obj *old_focused; public: @@ -80,7 +80,7 @@ BoardList(MessageIndex *ndx, std::vector &, char *mycall); BoardList(std::vector &); - void init_screen(void *pwin, int height, int width, int wy, int wx); + void init_screen(WINDOW *pwin, int height, int width, int wy, int wx); void save_groups(); void load_groups(); diff -Nru linpac-0.24/src/applications/mailer/mail_help.cc linpac-0.25/src/applications/mailer/mail_help.cc --- linpac-0.24/src/applications/mailer/mail_help.cc 2015-11-19 23:43:43.000000000 +0000 +++ linpac-0.25/src/applications/mailer/mail_help.cc 2017-12-11 04:47:34.000000000 +0000 @@ -18,7 +18,7 @@ //========================================================================= // Class HelpWindow //========================================================================= -HelpWindow::HelpWindow(void *pwin, int height, int width, int wy, int wx) +HelpWindow::HelpWindow(WINDOW *pwin, int height, int width, int wy, int wx) { xsize = width; ysize = height; @@ -27,8 +27,8 @@ max_pages = 4; page = 1; - //WINDOW *win = subwin(reinterpret_cast(pwin), ysize, xsize, y, x); - WINDOW *win = reinterpret_cast(pwin); + //WINDOW *win = subwin(pwin, ysize, xsize, y, x); + WINDOW *win = pwin; mwin = win; keypad(win, true); meta(win, true); @@ -54,107 +54,105 @@ void HelpWindow::draw(bool all) { - WINDOW *win = reinterpret_cast(mwin); - if (all) { - wbkgdset(win, ' ' | COLOR_PAIR(C_TEXT) | A_BOLD); - werase(win); - box(win, ACS_VLINE, ACS_HLINE); - mvwprintw(win, 0, 2, "Help"); + wbkgdset(mwin, ' ' | COLOR_PAIR(C_TEXT) | A_BOLD); + werase(mwin); + box(mwin, ACS_VLINE, ACS_HLINE); + mvwprintw(mwin, 0, 2, "Help"); } - wbkgdset(win, ' ' | COLOR_PAIR(C_SELECT) | A_BOLD); - mvwprintw(win, 1, CENTER(18), "LinPac Mailer Help"); + wbkgdset(mwin, ' ' | COLOR_PAIR(C_SELECT) | A_BOLD); + mvwprintw(mwin, 1, CENTER(18), "LinPac Mailer Help"); if (page == 1) { - wbkgdset(win, ' ' | COLOR_PAIR(C_UNSELECT) | A_BOLD); - mvwprintw(win, 4, 2, "Message list window"); - wbkgdset(win, ' ' | COLOR_PAIR(C_TEXT) | A_BOLD); - mvwprintw(win, 5, 2, "Space ... select/unselect current"); - mvwprintw(win, 6, 2, "Enter ... view current message"); - mvwprintw(win, 7, 2, "Ctrl-X .. delete selected messages"); - mvwprintw(win, 8, 2, "F ... select bulletins P ... show/hide private messages"); - mvwprintw(win, 9, 2, "T ... toggle translation D ... download selected messages"); - mvwprintw(win, 10, 2, "C ... compose new message I ... toggle incomming/outgoing"); - mvwprintw(win, 11, 2, "Q ... quit"); - - wbkgdset(win, ' ' | COLOR_PAIR(C_UNSELECT) | A_BOLD); - mvwprintw(win, 14, 2, "Bulletin selection window"); - wbkgdset(win, ' ' | COLOR_PAIR(C_TEXT) | A_BOLD); - mvwprintw(win, 15, 2, "Up, Down, PgUp, PgDn, TAB .... move through the lists"); - mvwprintw(win, 16, 2, "Enter, ESC ................... accept selection"); - mvwprintw(win, 17, 2, "Space ........................ select current bulletin"); - mvwprintw(win, 18, 2, "* ............................ invert bulletin selection"); - mvwprintw(win, 19, 2, "A ............................ new group from selected"); - mvwprintw(win, 20, 2, "D ............................ delete group"); + wbkgdset(mwin, ' ' | COLOR_PAIR(C_UNSELECT) | A_BOLD); + mvwprintw(mwin, 4, 2, "Message list window"); + wbkgdset(mwin, ' ' | COLOR_PAIR(C_TEXT) | A_BOLD); + mvwprintw(mwin, 5, 2, "Space ... select/unselect current"); + mvwprintw(mwin, 6, 2, "Enter ... view current message"); + mvwprintw(mwin, 7, 2, "Ctrl-X .. delete selected messages"); + mvwprintw(mwin, 8, 2, "F ... select bulletins P ... show/hide private messages"); + mvwprintw(mwin, 9, 2, "T ... toggle translation D ... download selected messages"); + mvwprintw(mwin, 10, 2, "C ... compose new message I ... toggle incomming/outgoing"); + mvwprintw(mwin, 11, 2, "Q ... quit"); + + wbkgdset(mwin, ' ' | COLOR_PAIR(C_UNSELECT) | A_BOLD); + mvwprintw(mwin, 14, 2, "Bulletin selection window"); + wbkgdset(mwin, ' ' | COLOR_PAIR(C_TEXT) | A_BOLD); + mvwprintw(mwin, 15, 2, "Up, Down, PgUp, PgDn, TAB .... move through the lists"); + mvwprintw(mwin, 16, 2, "Enter, ESC ................... accept selection"); + mvwprintw(mwin, 17, 2, "Space ........................ select current bulletin"); + mvwprintw(mwin, 18, 2, "* ............................ invert bulletin selection"); + mvwprintw(mwin, 19, 2, "A ............................ new group from selected"); + mvwprintw(mwin, 20, 2, "D ............................ delete group"); } if (page == 2) { - wbkgdset(win, ' ' | COLOR_PAIR(C_UNSELECT) | A_BOLD); - mvwprintw(win, 4, 2, "Message viewer window"); - wbkgdset(win, ' ' | COLOR_PAIR(C_TEXT) | A_BOLD); - mvwprintw(win, 5, 2, "Cursor keys, PgUp, PgDn ... move through the message"); - mvwprintw(win, 6, 2, "W ......................... toggle line wrapping"); - mvwprintw(win, 7, 2, "H ......................... toggle message header"); - mvwprintw(win, 8, 2, "T ......................... toggle character translation"); - mvwprintw(win, 10, 2, "R ......................... reply to this message (personal message)"); - mvwprintw(win, 11, 2, "C ......................... comment this message (bulletin)"); - mvwprintw(win, 12, 2, "F ......................... forward this message to another dest."); - mvwprintw(win, 14, 2, "S ......................... save message to text file"); - mvwprintw(win, 15, 2, "X ......................... export attachment to file"); - mvwprintw(win, 16, 2, "L or ESC .................. back to message list"); + wbkgdset(mwin, ' ' | COLOR_PAIR(C_UNSELECT) | A_BOLD); + mvwprintw(mwin, 4, 2, "Message viewer window"); + wbkgdset(mwin, ' ' | COLOR_PAIR(C_TEXT) | A_BOLD); + mvwprintw(mwin, 5, 2, "Cursor keys, PgUp, PgDn ... move through the message"); + mvwprintw(mwin, 6, 2, "W ......................... toggle line wrapping"); + mvwprintw(mwin, 7, 2, "H ......................... toggle message header"); + mvwprintw(mwin, 8, 2, "T ......................... toggle character translation"); + mvwprintw(mwin, 10, 2, "R ......................... reply to this message (personal message)"); + mvwprintw(mwin, 11, 2, "C ......................... comment this message (bulletin)"); + mvwprintw(mwin, 12, 2, "F ......................... forward this message to another dest."); + mvwprintw(mwin, 14, 2, "S ......................... save message to text file"); + mvwprintw(mwin, 15, 2, "X ......................... export attachment to file"); + mvwprintw(mwin, 16, 2, "L or ESC .................. back to message list"); } if (page == 3) { - wbkgdset(win, ' ' | COLOR_PAIR(C_UNSELECT) | A_BOLD); - mvwprintw(win, 4, 2, "Mail composer"); - wbkgdset(win, ' ' | COLOR_PAIR(C_TEXT) | A_BOLD); - mvwprintw(win, 5, 2, "Cursor keys ...... navigate through text"); - mvwprintw(win, 6, 2, "DEL, Backspace ... delete current/previous charactes"); - mvwprintw(win, 7, 2, "Ctrl-Y ........... delete current line"); - mvwprintw(win, 8, 2, "Ctrl-T ........... insert current time"); - mvwprintw(win, 9, 2, "Ctrl-D ........... insert current date"); - - mvwprintw(win, 11, 2, "Ctrl-A ........... cancel the message"); - mvwprintw(win, 12, 2, "Ctrl-X ........... send the message"); - - mvwprintw(win, 14, 2, "Ctrl-R ........... insert text file"); - mvwprintw(win, 15, 2, "Ctrl-E ........... export message to file"); - mvwprintw(win, 16, 2, "Ctrl-F ........... attach binary file"); + wbkgdset(mwin, ' ' | COLOR_PAIR(C_UNSELECT) | A_BOLD); + mvwprintw(mwin, 4, 2, "Mail composer"); + wbkgdset(mwin, ' ' | COLOR_PAIR(C_TEXT) | A_BOLD); + mvwprintw(mwin, 5, 2, "Cursor keys ...... navigate through text"); + mvwprintw(mwin, 6, 2, "DEL, Backspace ... delete current/previous charactes"); + mvwprintw(mwin, 7, 2, "Ctrl-Y ........... delete current line"); + mvwprintw(mwin, 8, 2, "Ctrl-T ........... insert current time"); + mvwprintw(mwin, 9, 2, "Ctrl-D ........... insert current date"); + + mvwprintw(mwin, 11, 2, "Ctrl-A ........... cancel the message"); + mvwprintw(mwin, 12, 2, "Ctrl-X ........... send the message"); + + mvwprintw(mwin, 14, 2, "Ctrl-R ........... insert text file"); + mvwprintw(mwin, 15, 2, "Ctrl-E ........... export message to file"); + mvwprintw(mwin, 16, 2, "Ctrl-F ........... attach binary file"); } if (page == 4) { - wbkgdset(win, ' ' | COLOR_PAIR(C_TEXT) | A_BOLD); - mvwprintw(win, 4, 2, "Use the :forward command to transfer new messages"); - mvwprintw(win, 5, 2, "to the BBS."); - - mvwprintw(win, 7, 2, "Use the :pack command to remove the messages marked"); - mvwprintw(win, 8, 2, "for delete."); - - mvwprintw(win, 10, 2, "You can switch to terminal mode anytime by pressing"); - mvwprintw(win, 12, 2, "F1 - F8 or F10 key. Then press Alt-"); - mvwprintw(win, 13, 2, "to switch back to the mailer running on some channel."); - - mvwprintw(win, 15, 2, "Message attachments (binary files) are processed after"); - mvwprintw(win, 16, 2, "sending the message by pressing Ctrl-X. Attached files"); - mvwprintw(win, 17, 2, "are converted to 7plus messages using the internal LinPac"); - mvwprintw(win, 18, 2, "command :sendfile. Files are split to blocks of the size"); - mvwprintw(win, 19, 2, "contained in BLOCK7P@0 variable."); + wbkgdset(mwin, ' ' | COLOR_PAIR(C_TEXT) | A_BOLD); + mvwprintw(mwin, 4, 2, "Use the :forward command to transfer new messages"); + mvwprintw(mwin, 5, 2, "to the BBS."); + + mvwprintw(mwin, 7, 2, "Use the :pack command to remove the messages marked"); + mvwprintw(mwin, 8, 2, "for delete."); + + mvwprintw(mwin, 10, 2, "You can switch to terminal mode anytime by pressing"); + mvwprintw(mwin, 12, 2, "F1 - F8 or F10 key. Then press Alt-"); + mvwprintw(mwin, 13, 2, "to switch back to the mailer running on some channel."); + + mvwprintw(mwin, 15, 2, "Message attachments (binary files) are processed after"); + mvwprintw(mwin, 16, 2, "sending the message by pressing Ctrl-X. Attached files"); + mvwprintw(mwin, 17, 2, "are converted to 7plus messages using the internal LinPac"); + mvwprintw(mwin, 18, 2, "command :sendfile. Files are split to blocks of the size"); + mvwprintw(mwin, 19, 2, "contained in BLOCK7P@0 variable."); } if (page == 1) - mvwprintw(win, ysize-2, 2, "PageDown or Space - next page, ESC or L - return"); + mvwprintw(mwin, ysize-2, 2, "PageDown or Space - next page, ESC or L - return"); else if (page == max_pages) - mvwprintw(win, ysize-2, 2, "PageUp - previous page, ESC or L - return"); + mvwprintw(mwin, ysize-2, 2, "PageUp - previous page, ESC or L - return"); else - mvwprintw(win, ysize-2, 2, "PageDown or Space - next page, PageUp - previous page, ESC or L - return"); + mvwprintw(mwin, ysize-2, 2, "PageDown or Space - next page, PageUp - previous page, ESC or L - return"); - wnoutrefresh(win); + wnoutrefresh(mwin); for (int i = 0; i < 5; i++) doupdate(); //must be done many times, don't know why } diff -Nru linpac-0.24/src/applications/mailer/mail_help.h linpac-0.25/src/applications/mailer/mail_help.h --- linpac-0.24/src/applications/mailer/mail_help.h 2015-11-19 23:43:43.000000000 +0000 +++ linpac-0.25/src/applications/mailer/mail_help.h 2017-12-11 04:47:34.000000000 +0000 @@ -14,16 +14,16 @@ class HelpWindow : public screen_obj { private: - void *mwin; + WINDOW *mwin; int x, y, xsize, ysize; int page; int max_pages; - void *old_focus_window; + WINDOW *old_focus_window; screen_obj *old_focused; public: - HelpWindow(void *pwin, int height, int width, int wy, int wx); + HelpWindow(WINDOW *pwin, int height, int width, int wy, int wx); void show(); virtual void handle_event(Event *); virtual void draw(bool all = false); diff -Nru linpac-0.24/src/applications/mailer/mail_input.cc linpac-0.25/src/applications/mailer/mail_input.cc --- linpac-0.24/src/applications/mailer/mail_input.cc 2015-11-19 23:43:43.000000000 +0000 +++ linpac-0.25/src/applications/mailer/mail_input.cc 2017-12-11 04:47:34.000000000 +0000 @@ -23,7 +23,7 @@ //-------------------------------------------------------------------------- // Class InputLine //-------------------------------------------------------------------------- -InputLine::InputLine(void *parent, int wx, int wy, int flen, unsigned textlen, +InputLine::InputLine(WINDOW *parent, int wx, int wy, int flen, unsigned textlen, char const *prompt, char *buffer, int mode) { sprintf(class_name, "InputLine"); @@ -34,7 +34,7 @@ strcpy(buf, ""); - win = subwin((WINDOW *)parent, 1, fieldln, y, x); + win = subwin(parent, 1, fieldln, y, x); scrollok(win, false); draw(true); @@ -68,54 +68,62 @@ focused->draw(true); focused->handle_event(NULL); break; - default: - char ch; - switch (imode) - { - case INPUT_ALL: - if (ev->x > ' ' && !ev->y) - { - ch = ev->x; - if (strlen(buf) <= textln) strncat(buf, &ch, 1); - } - break; - case INPUT_ALNUM: - if (isalnum(ev->x) && !ev->y) - { - ch = ev->x; - if (strlen(buf) <= textln) strncat(buf, &ch, 1); - } - break; - case INPUT_UPC: - if (isalnum(ev->x) && !ev->y) - { - ch = toupper(ev->x); - if (strlen(buf) <= textln) strncat(buf, &ch, 1); - } - break; - case INPUT_NUM: - if (isdigit(ev->x) && !ev->y) - { - ch = ev->x; - if (strlen(buf) <= textln) strncat(buf, &ch, 1); - } - break; - case INPUT_ONECH: - if (isalnum(ev->x) && !ev->y) - { - ch = ev->x; - strncat(buf, &ch, 1); - focus_window = old_focus_window; - focused = old_focused; - delwin(win); - focused->draw(true); - focused->handle_event(NULL); - } - break; - } + default: if (!ev->y) newch(ev->x); } if (focused == this) draw(); } + if (ev->type==EV_KEY_PRESS_MULTI) + { + // Treat this the same as if we received multiple EV_KEY_PRESS events + // where each event is guaranteed to be only a printable character. + char *buffer = (char *)ev->data; + for (unsigned ix = 0; ix < strlen(buffer); ix++) + newch(buffer[ix]); + if (focused == this) draw(); + } +} + +void InputLine::newch(char ch) +{ + switch (imode) + { + case INPUT_ALL: + if (ch > ' ') + { + if (strlen(buf) <= textln) strncat(buf, &ch, 1); + } + break; + case INPUT_ALNUM: + if (isalnum(ch)) + { + if (strlen(buf) <= textln) strncat(buf, &ch, 1); + } + break; + case INPUT_UPC: + if (isalnum(ch)) + { + ch = toupper(ch); + if (strlen(buf) <= textln) strncat(buf, &ch, 1); + } + break; + case INPUT_NUM: + if (isdigit(ch)) + { + if (strlen(buf) <= textln) strncat(buf, &ch, 1); + } + break; + case INPUT_ONECH: + if (isalnum(ch)) + { + strncat(buf, &ch, 1); + focus_window = old_focus_window; + focused = old_focused; + delwin(win); + focused->draw(true); + focused->handle_event(NULL); + } + break; + } } void InputLine::draw(bool all) diff -Nru linpac-0.24/src/applications/mailer/mail_input.h linpac-0.25/src/applications/mailer/mail_input.h --- linpac-0.24/src/applications/mailer/mail_input.h 2015-11-19 23:43:43.000000000 +0000 +++ linpac-0.25/src/applications/mailer/mail_input.h 2017-12-11 04:47:34.000000000 +0000 @@ -35,15 +35,16 @@ char *buf; //input buffer int imode; //input mode - void *old_focus_window; + WINDOW *old_focus_window; screen_obj *old_focused; public: int crx; //cusror position - InputLine(void *parent, int wx, int wy, int flen, unsigned textlen, + InputLine(WINDOW *parent, int wx, int wy, int flen, unsigned textlen, char const *prompt, char *buffer, int mode = INPUT_ALL); void handle_event(Event *ev); + void newch(char ch); void draw(bool all = false); virtual ~InputLine() {}; }; diff -Nru linpac-0.24/src/applications/mailer/mail_list.cc linpac-0.25/src/applications/mailer/mail_list.cc --- linpac-0.24/src/applications/mailer/mail_list.cc 2015-11-19 23:43:43.000000000 +0000 +++ linpac-0.25/src/applications/mailer/mail_list.cc 2017-12-11 04:47:34.000000000 +0000 @@ -16,6 +16,7 @@ #include #include #include +#include #include "mail_list.h" #include "mail_comp.h" #include "mail_help.h" @@ -492,18 +493,17 @@ } //========================================================================== -// Functions using ncurses (conflicting) +// Functions using ncurses //========================================================================== -#include -void Messages::init_screen(void *pwin, int height, int width, int wy, int wx) +void Messages::init_screen(WINDOW *pwin, int height, int width, int wy, int wx) { xsize = width; ysize = height; x = wx; y = wy; - WINDOW *win = subwin(reinterpret_cast(pwin), ysize, xsize, y, x); + WINDOW *win = subwin(pwin, ysize, xsize, y, x); mwin = win; keypad(win, true); meta(win, true); @@ -525,8 +525,6 @@ void Messages::draw_line(int i) { - WINDOW *win = reinterpret_cast(mwin); - if (i+pos < (int)msg.size()) { long attr; @@ -543,7 +541,7 @@ if (ndx->getMessage(index)->isPresent()) attr |= A_BOLD; } - wbkgdset(win, ' ' | attr); + wbkgdset(mwin, ' ' | attr); int sl; if (msg[i+pos].select) sl = ACS_BULLET; @@ -552,10 +550,10 @@ char subj[256]; strncpy(subj, ndx->getMessage(index)->getSubj(), 255); subj[255] = '\0'; for (unsigned j=0; jgetMessage(index)->getNum(), sl, ndx->getMessage(index)->getFlags(), ndx->getMessage(index)->getSize(), @@ -565,7 +563,7 @@ ndx->getMessage(index)->getDate().toStringShort(), xsize-49, xsize-50, subj); if (folder == FOLDER_OUTGOING) - mvwprintw(win, i+2, 2, "%6i%c%2s %-20.20s %-6.6s %6.6s %-*.*s", + mvwprintw(mwin, i+2, 2, "%6i%c%2s %-20.20s %-6.6s %6.6s %-*.*s", ndx->getMessage(index)->getNum(), sl, ndx->getMessage(index)->getFlags(), ndx->getMessage(index)->getDest(), @@ -575,34 +573,32 @@ } else { - wbkgdset(win, COLOR_PAIR(C_TEXT)); - mvwprintw(win, i+2, 2, "%*s", xsize-4, ""); + wbkgdset(mwin, COLOR_PAIR(C_TEXT)); + mvwprintw(mwin, i+2, 2, "%*s", xsize-4, ""); } } void Messages::draw(bool all) { - WINDOW *win = reinterpret_cast(mwin); - if (all) { - wbkgdset(win, ' ' | COLOR_PAIR(C_TEXT) | A_BOLD); - werase(win); - box(win, ACS_VLINE, ACS_HLINE); + wbkgdset(mwin, ' ' | COLOR_PAIR(C_TEXT) | A_BOLD); + werase(mwin); + box(mwin, ACS_VLINE, ACS_HLINE); char sf[32]; - if (folder == FOLDER_INCOMMING) strcpy(sf, "Incomming mail"); + if (folder == FOLDER_INCOMMING) strcpy(sf, "Incoming mail"); if (folder == FOLDER_OUTGOING) strcpy(sf, "Outgoing mail"); - mvwprintw(win, 0, 2, "%s: %s", bbs, sf); - if (state == STATE_WAIT) mvwprintw(win, 0, 25, " (starting download) "); - if (state == STATE_DNLD) mvwprintw(win, 0, 25, " (downloading messages) "); + mvwprintw(mwin, 0, 2, "%s: %s", bbs, sf); + if (state == STATE_WAIT) mvwprintw(mwin, 0, 25, " (starting download) "); + if (state == STATE_DNLD) mvwprintw(mwin, 0, 25, " (downloading messages) "); } for (int i=0; ix) == 'Q') { - //delwin(reinterpret_cast(mwin)); + //delwin(mwin); focus_window = old_focus_window; focused = old_focused; } @@ -849,7 +845,7 @@ else if (toupper(ev->x) == 'H') { if (helper == NULL) - helper = new HelpWindow(reinterpret_cast(mwin), ysize, xsize, y, x); + helper = new HelpWindow(mwin, ysize, xsize, y, x); else helper->show(); } @@ -861,14 +857,12 @@ else if (toupper(ev->x) == 'F') { blister = new BoardList(boards); - blister->init_screen(reinterpret_cast(mwin), - ysize, xsize, y, x); + blister->init_screen(mwin, ysize, xsize, y, x); } else if (ev->x == '\n') { viewer = new TheFile(ndx->getMessage(msg[slct].index)); - viewer->init_screen(reinterpret_cast(mwin), - ysize, xsize, y, x); + viewer->init_screen(mwin, ysize, xsize, y, x); } else if (ev->x != KEY_DOWN && ev->x != KEY_UP) draw(); @@ -909,7 +903,7 @@ //------------------------------------------------------------------------ -void TheFile::init_screen(void *pwin, int height, int width, int wy, int wx) +void TheFile::init_screen(WINDOW *pwin, int height, int width, int wy, int wx) { xsize = width; ysize = height; @@ -920,23 +914,22 @@ char *subj = strdup(msg->getSubj()); for (unsigned j=0; j(pwin), ysize, xsize, y, x); - WINDOW *win = reinterpret_cast(pwin); - mwin = win; - keypad(win, true); - meta(win, true); - nodelay(win, true); + //WINDOW *win = subwin(pwin, ysize, xsize, y, x); + mwin = pwin; + keypad(pwin, true); + meta(pwin, true); + nodelay(pwin, true); - wbkgdset(win, ' ' | COLOR_PAIR(C_MSG) | A_BOLD); - werase(win); - box(win, ACS_VLINE, ACS_HLINE); - mvwprintw(win, 0, 2, "Message %i:%s", msg->getNum(), subj); + wbkgdset(pwin, ' ' | COLOR_PAIR(C_MSG) | A_BOLD); + werase(pwin); + box(pwin, ACS_VLINE, ACS_HLINE); + mvwprintw(pwin, 0, 2, "Message %i:%s", msg->getNum(), subj); draw(); old_focus_window = focus_window; - focus_window = win; + focus_window = pwin; old_focused = focused; focused = this; @@ -946,18 +939,16 @@ void TheFile::draw(bool all) { - WINDOW *win = reinterpret_cast(mwin); - char *subj = strdup(msg->getSubj()); for (unsigned j=0; jgetNum(), subj); + wbkgdset(mwin, ' ' | COLOR_PAIR(C_MSG) | A_BOLD); + werase(mwin); + box(mwin, ACS_VLINE, ACS_HLINE); + mvwprintw(mwin, 0, 2, "Message %i:%s", msg->getNum(), subj); } for (int i=0; ix) == 'R') { - WINDOW *win = (WINDOW *)mwin; - wbkgdset(win, ' ' | COLOR_PAIR(C_ERROR)); - mvwprintw(win, ysize-2, 1, " Include original message in reply ? "); - wmove(win, ysize-2, 38); - wbkgdset(win, ' ' | COLOR_PAIR(C_MSG)); - wrefresh(win); + wbkgdset(mwin, ' ' | COLOR_PAIR(C_ERROR)); + mvwprintw(mwin, ysize-2, 1, " Include original message in reply ? "); + wmove(mwin, ysize-2, 38); + wbkgdset(mwin, ' ' | COLOR_PAIR(C_MSG)); + wrefresh(mwin); wait_reply = true; comment = false; } else if (toupper(ev->x) == 'C') { - WINDOW *win = (WINDOW *)mwin; - wbkgdset(win, ' ' | COLOR_PAIR(C_ERROR)); - mvwprintw(win, ysize-2, 1, " Include original message in comment ? "); - wmove(win, ysize-2, 39); - wbkgdset(win, ' ' | COLOR_PAIR(C_MSG)); - wrefresh(win); + wbkgdset(mwin, ' ' | COLOR_PAIR(C_ERROR)); + mvwprintw(mwin, ysize-2, 1, " Include original message in comment ? "); + wmove(mwin, ysize-2, 39); + wbkgdset(mwin, ' ' | COLOR_PAIR(C_MSG)); + wrefresh(mwin); wait_reply = true; comment = true; } @@ -1187,7 +1176,7 @@ //convert charset char *newl = strdup(line[i]); for (unsigned u=0; ux) == 'S') { wait_sname = true; - WINDOW *win = (WINDOW *)mwin; - iline = new InputLine(win, 2, ysize-1, xsize-2, xsize-16, + iline = new InputLine(mwin, 2, ysize-1, xsize-2, xsize-16, "Save to file:", ibuffer, INPUT_ALL); } else if (toupper(ev->x) == 'X') @@ -1215,8 +1203,7 @@ if (attach > 1) //more than one attachment { wait_xnum = true; - WINDOW *win = (WINDOW *)mwin; - iline = new InputLine(win, 2, ysize-1, xsize-2, 5, + iline = new InputLine(mwin, 2, ysize-1, xsize-2, 5, "Attachment no. to save:", ibuffer, INPUT_NUM); } else if (attach == 1) extract_attach(1); @@ -1235,13 +1222,12 @@ vsprintf(buf, fmt, argptr); va_end(argptr); - WINDOW *win = (WINDOW *)mwin; - wbkgdset(win, ' ' | COLOR_PAIR(C_ERROR)); - mvwprintw(win, ysize-2, 1, " %s ", buf); - wbkgdset(win, ' ' | COLOR_PAIR(ED_TEXT)); + wbkgdset(mwin, ' ' | COLOR_PAIR(C_ERROR)); + mvwprintw(mwin, ysize-2, 1, " %s ", buf); + wbkgdset(mwin, ' ' | COLOR_PAIR(ED_TEXT)); err = true; - //wrefresh(win); - wnoutrefresh(win); + //wrefresh(mwin); + wnoutrefresh(mwin); for (int i = 0; i < 5; i++) doupdate(); //must be done many times, don't know why } diff -Nru linpac-0.24/src/applications/mailer/mail_list.h linpac-0.25/src/applications/mailer/mail_list.h --- linpac-0.24/src/applications/mailer/mail_list.h 2015-11-19 23:43:43.000000000 +0000 +++ linpac-0.25/src/applications/mailer/mail_list.h 2017-12-11 04:47:34.000000000 +0000 @@ -19,7 +19,7 @@ private: Message *msg; //the message - void *mwin; //window + WINDOW *mwin; //window int x, y, xsize, ysize; //screen position //int slct; unsigned pos; //first visible line @@ -35,7 +35,7 @@ char ibuffer[64]; //input line buffer InputLine *iline; //input line - void *old_focus_window; + WINDOW *old_focus_window; screen_obj *old_focused; public: @@ -50,7 +50,7 @@ unsigned max_len(); //the length of longest line bool return_addr(char *result); //try to determine the return address - void init_screen(void *pwin, int height, int width, int wy, int wx); + void init_screen(WINDOW *pwin, int height, int width, int wy, int wx); virtual void handle_event(Event *); virtual void draw(bool all = false); @@ -64,7 +64,7 @@ private: char *bbs; //BBS callsign char *mycall; //user's callsign - void *mwin; //window handle + WINDOW *mwin; //window handle int x, y, xsize, ysize; //window geometry int slct; //current message index int pos; //scroll position @@ -77,7 +77,7 @@ std::vector boards; //list of boards //saved old screen status - void *old_focus_window; + WINDOW *old_focus_window; screen_obj *old_focused; TheFile *viewer; //text viewer @@ -90,7 +90,7 @@ //NOTE: in function arguments 'index' means index of the message // in global list 'ndx', 'num' means message numbers at BBS Messages(char *bbs_name, char *call, bool all = false); - void init_screen(void *pwin, int height, int width, int wy, int wx); + void init_screen(WINDOW *pwin, int height, int width, int wy, int wx); void reload(bool all = false); int count() {return msg.size();} //number of messages diff -Nru linpac-0.24/src/applications/mailer/mail_screen.cc linpac-0.25/src/applications/mailer/mail_screen.cc --- linpac-0.24/src/applications/mailer/mail_screen.cc 2015-11-19 23:43:43.000000000 +0000 +++ linpac-0.25/src/applications/mailer/mail_screen.cc 2017-12-11 04:47:34.000000000 +0000 @@ -1,5 +1,6 @@ /* LinPac Mailer + (c) David Ranch KI6ZHD (linpac@trinnet.net) 2002 - 2016 (c) 1998 - 1999 by Radek Burget OK2JBG (xburge01@stud.fee.vutbr.cz) This program is free software; you can redistribute it and/or @@ -17,7 +18,7 @@ bool act; bool stop; int maxx, maxy; -void *main_window, *focus_window; +WINDOW *main_window, *focus_window; screen_obj *focused = NULL; screen_obj * message_handler[16]; @@ -66,24 +67,21 @@ void redraw() { - WINDOW *win = reinterpret_cast(main_window); - win->_clear = TRUE; - redrawwin(win); - wrefresh(win); + main_window->_clear = TRUE; + redrawwin(main_window); + wrefresh(main_window); /*if (focus_window != NULL) { - WINDOW *win = reinterpret_cast(focus_window); - win->_clear = TRUE; - redrawwin(win); + focus_window->_clear = TRUE; + redrawwin(focus_window); }*/ } void help(char const *s) { - WINDOW *win = reinterpret_cast(main_window); int ct = CENTER(strlen(s))-1; - mvwprintw(win, maxy-1, 1, "%*s%s%*s", ct, "", s, maxx-strlen(s)-ct-1, ""); - wrefresh(win); + mvwprintw(main_window, maxy-1, 1, "%*s%s%*s", ct, "", s, maxx-strlen(s)-ct-1, ""); + wrefresh(main_window); } void load_table(int n) @@ -99,10 +97,10 @@ } } -int safe_wrefresh(void *win) +int safe_wrefresh(WINDOW *win) { //event_handling_off(); - int r = wrefresh((WINDOW *)win); + int r = wrefresh(win); //event_handling_on(); return r; } @@ -115,13 +113,12 @@ void Main_scr::draw(bool all) { - WINDOW *win = reinterpret_cast(main_window); - wbkgdset(win, ' ' | COLOR_PAIR(C_BACK)); - werase(win); - box(win, ACS_VLINE, ACS_HLINE); - mvwaddstr(win, 2, CENTER(26), "LinPac Packet Radio Mailer"); - mvwaddstr(win, 3, CENTER(26), "(c) 1998 - 2001 by OK2JBG"); - wrefresh(win); + wbkgdset(main_window, ' ' | COLOR_PAIR(C_BACK)); + werase(main_window); + box(main_window, ACS_VLINE, ACS_HLINE); + mvwaddstr(main_window, 2, CENTER(26), "LinPac Packet Radio Mailer"); + mvwaddstr(main_window, 3, CENTER(26), "(c) 1998 - 2016 by KI6ZHD"); + wrefresh(main_window); } WINDOW *msgwin; @@ -131,9 +128,8 @@ if (!blocked) { blocked = true; - WINDOW *win = reinterpret_cast(focus_window); int len = strlen(text) + 4; - msgwin = subwin(win, 5, len, 15, CENTER(len)); + msgwin = subwin(focus_window, 5, len, 15, CENTER(len)); wbkgdset(msgwin, ' ' | COLOR_PAIR(C_BACK)); werase(msgwin); box(msgwin, ACS_VLINE, ACS_HLINE); diff -Nru linpac-0.24/src/applications/mailer/mail_screen.h linpac-0.25/src/applications/mailer/mail_screen.h --- linpac-0.24/src/applications/mailer/mail_screen.h 2015-11-19 23:43:43.000000000 +0000 +++ linpac-0.25/src/applications/mailer/mail_screen.h 2017-12-11 04:47:34.000000000 +0000 @@ -41,8 +41,8 @@ extern bool act; //application is visible extern bool stop; //abort received extern int maxx, maxy; //screen sizes -extern void *main_window; //main screen window -extern void *focus_window; //focused window +extern WINDOW *main_window; //main screen window +extern WINDOW *focus_window; //focused window extern char ttable[256]; //actual translation table extern int tabsize; //size of actual table @@ -59,7 +59,7 @@ void help(const char *s); void load_table(int n); -int safe_wrefresh(void *win); +int safe_wrefresh(WINDOW *win); //Generic screen object class class screen_obj diff -Nru linpac-0.24/src/applications/mailer/tevent.h linpac-0.25/src/applications/mailer/tevent.h --- linpac-0.24/src/applications/mailer/tevent.h 2015-11-19 23:43:43.000000000 +0000 +++ linpac-0.25/src/applications/mailer/tevent.h 2017-12-11 04:47:34.000000000 +0000 @@ -13,6 +13,7 @@ #define EV_NONE 0 //no event //User interaction #define EV_KEY_PRESS 1 //key pressed (x=keycode), y=FLAG_MOD_ALT if 'Alt' pressed +#define EV_KEY_PRESS_MULTI 103 //accumulated key presses (printable only) #define EV_BUTTON_PRESS 2 //mouse button pressed (x,y = position) #define EV_BUTTON_RELEASE 3 //mouse button released (x,y = position) #define EV_TEXT_ARGS 204 //cooking arguments for TEXT_RAW, must precede TEXT_RAW diff -Nru linpac-0.24/src/applications/save7pl.cc linpac-0.25/src/applications/save7pl.cc --- linpac-0.24/src/applications/save7pl.cc 2015-11-19 23:43:43.000000000 +0000 +++ linpac-0.25/src/applications/save7pl.cc 2017-12-11 04:47:34.000000000 +0000 @@ -85,7 +85,7 @@ } //Try to decode 7plus file -void try_decode(char *path, char *name, int parts) +int try_decode(char *path, char *name, int parts) { char cmd[LINE_LEN]; int r; @@ -96,6 +96,7 @@ lp_event_handling_on(); /*if (r == 0) printf("save7pl: File succesfully decoded.\r"); else printf(strerror(errno));*/ + return r; } //Recieve the file @@ -201,7 +202,7 @@ message("\rsave7pl: %s saved\r", ppath); } fclose(f); - if (type == TYPE_BIN) try_decode(path, prefix, parts); + if (type == TYPE_BIN) (void)try_decode(path, prefix, parts); } diff -Nru linpac-0.24/src/applications/testapp.c linpac-0.25/src/applications/testapp.c --- linpac-0.24/src/applications/testapp.c 2015-11-19 23:43:43.000000000 +0000 +++ linpac-0.25/src/applications/testapp.c 2017-12-11 04:47:34.000000000 +0000 @@ -1,5 +1,6 @@ /* LinPac Application interface testing program + (c) David Ranch KI6ZHD (linpac@trinnet.net) 2002 - 2016 (c) 1998-2001 by OK2JBG */ #include diff -Nru linpac-0.24/src/applications/yapp.cc linpac-0.25/src/applications/yapp.cc --- linpac-0.24/src/applications/yapp.cc 2015-11-19 23:43:43.000000000 +0000 +++ linpac-0.25/src/applications/yapp.cc 2017-12-11 04:47:34.000000000 +0000 @@ -443,7 +443,7 @@ char path[256], ppath[256], *p; int buflen; int rc; - int timeout, eofrm, eot, times; + int timeout, eofrm, eot; char name[256]; long fsize; long rcvd = 0; @@ -461,7 +461,6 @@ lp_set_event_handler(my_handler); state = STATE_R; eot = 0; - times = 0; lp_disable_screen(); diff -Nru linpac-0.24/src/commands.cc linpac-0.25/src/commands.cc --- linpac-0.24/src/commands.cc 2015-11-19 23:43:43.000000000 +0000 +++ linpac-0.25/src/commands.cc 2017-12-11 04:47:34.000000000 +0000 @@ -1,6 +1,6 @@ /*========================================================================== LinPac: Packet Radio Terminal for Linux - (c) Radek Burget OK2JBG (radkovo@centrum.cz) 1998 - 2002 + (c) Radek Burget OK2JBG (radkovo@centrum.cz) 1998 - 2016 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -11,7 +11,7 @@ Objects for commands executing - Last update 27.11.2002 + Last update 09.09.2016 =========================================================================*/ #include #include @@ -1196,11 +1196,11 @@ { static char s[256]; #ifndef NEW_AX25 - sprintf(s, "\r%s / %s\rVersion %s (Compiled on %s)\r%s\r\r", - PACKAGE, sys_info(), VERSION, __DATE__, VERINFO); + sprintf(s, "\r%s version %s (Compiled on %s)\r%s\rOS: %s\r\r", + PACKAGE, VERSION, __DATE__, VERINFO, sys_info()); #else - sprintf(s, "\r%s / %s\rVersion %s (Compiled on %s) (new AX.25)\r%s\r\r", - PACKAGE, sys_info(), VERSION, __DATE__, VERINFO); + sprintf(s, "\r%s version %s (Compiled on %s) (new AX.25)\r%s\rOS: %s\r\r", + PACKAGE, VERSION, __DATE__, VERINFO, sys_info()); #endif emit(chn, EV_TEXT_COOKED, 0, s); emit(chn, EV_TEXT_FLUSH, FLAG_FLUSH_IMMEDIATE, NULL); diff -Nru linpac-0.24/src/data.cc linpac-0.25/src/data.cc --- linpac-0.24/src/data.cc 2015-11-19 23:43:43.000000000 +0000 +++ linpac-0.25/src/data.cc 2017-12-11 04:47:34.000000000 +0000 @@ -152,7 +152,7 @@ char *pname = strdup(name); var_channel(name, &chn, pname); char *r = env[chn].getSValue(pname); - delete[] pname; + void free(void *pname); return r; } @@ -161,7 +161,7 @@ char *pname = strdup(name); var_channel(name, &chn, pname); env[chn].remove(pname); - delete[] pname; + void free(void *pname); } void clear_var_names(int chn, const char *names) @@ -174,7 +174,7 @@ char *pname = strdup(name); var_channel(name, &chn, pname); env[chn].setSValue(pname, content); - delete[] pname; + void free(void *pname); } void close_env() @@ -344,7 +344,6 @@ bool get_axstat(const char *src, const char *dest, int form) { - int len=0; char buffer[256]; char dama[7]; char dest_addr[256]; //this can contain digipeater callsigns @@ -366,7 +365,7 @@ chstat.sendq = chstat.recvq = 0; if (form == 0) //2.0.x kernels { - len=sscanf(buffer, "%s %s %s %d %d %d %d %d/%d %d/%d %d/%d %d/%d %d/%d %d %d %d %s %d %d", + (void)sscanf(buffer, "%s %s %s %d %d %d %d %d/%d %d/%d %d/%d %d/%d %d/%d %d %d %d %s %d %d", dest_addr, source_addr, chstat.devname, &chstat.state, @@ -385,7 +384,7 @@ } if (form == 1) //2.2.x kernels { - len=sscanf(buffer, "%s %s %s %s %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d", + (void)sscanf(buffer, "%s %s %s %s %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d", dummy, chstat.devname, source_addr, dest_addr, diff -Nru linpac-0.24/src/editor.cc linpac-0.25/src/editor.cc --- linpac-0.24/src/editor.cc 2015-11-19 23:43:43.000000000 +0000 +++ linpac-0.25/src/editor.cc 2017-12-11 04:47:34.000000000 +0000 @@ -177,17 +177,32 @@ } } + if (ev.type==EV_KEY_PRESS_MULTI) + if (act) + { + // Treat this the same as if we received multiple EV_KEY_PRESS events + // where each event is guaranteed to be only a printable character. + char *buffer = (char *)ev.data; + for (unsigned ix = 0; ix < strlen(buffer); ix++) + newch(buffer[ix]); + ctrlp = false; + } + if (act && ev.type == EV_EDIT_INFO) ins_info((char *)ev.data); if (ev.type == EV_STAT_LINE && chnum != 0) + { if (bconfig("swap_edit")) update(x1, y1, x2, ev.x-1); else update(x1, ev.x+1, x2, y2); + } if (ev.type == EV_CHN_LINE && chnum != 0) + { if (!bconfig("swap_edit")) update(x1, y1, x2, ev.x-1); + } if (ev.type == EV_SWAP_EDIT && chnum != 0) { @@ -396,7 +411,7 @@ char *p = s; while (*p) { - if (*p < convcnt) *p = conv[*p]; + if (*p < convcnt) *p = conv[(unsigned)*p]; p++; } } diff -Nru linpac-0.24/src/keyboard.cc linpac-0.25/src/keyboard.cc --- linpac-0.24/src/keyboard.cc 2015-11-19 23:43:43.000000000 +0000 +++ linpac-0.25/src/keyboard.cc 2017-12-11 04:47:34.000000000 +0000 @@ -14,38 +14,38 @@ Last update 21.10.2000 =========================================================================*/ +#include +#include +#include + #include "version.h" #include "event.h" #include "data.h" #include "keyboard.h" -#include -#include - //-------------------------------------------------------------------------- // Class Keyscan //-------------------------------------------------------------------------- -#include Keyscan::Keyscan() { strcpy(class_name, "Keyscan"); keywin = newwin(1, 1, 0, 0); - keypad(reinterpret_cast(keywin), true); - meta(reinterpret_cast(keywin), true); - nodelay(reinterpret_cast(keywin), true); + keypad(keywin, true); + meta(keywin, true); + nodelay(keywin, true); } Keyscan::~Keyscan() { - delwin(reinterpret_cast(keywin)); + delwin(keywin); } void Keyscan::handle_event(const Event &ev) { if (ev.type == EV_NONE) //only when void-loop { - int ch = wgetch(reinterpret_cast(keywin)); + int ch = wgetch(keywin); //int ch = getch(); std::cout.flush(); if (ch != ERR) @@ -55,7 +55,7 @@ if (ch == '\x1B') { re.y = FLAG_MOD_ALT; - ch = wgetch(stdscr); + ch = wgetch(keywin); } else re.y = FLAG_MOD_NONE; re.x = ch; @@ -73,7 +73,29 @@ else if (ch == KEY_F(7)) emit(7, EV_SELECT_CHN, 0, NULL); else if (ch == KEY_F(8)) emit(8, EV_SELECT_CHN, 0, NULL); else if (ch == KEY_F(10)) emit(0, EV_SELECT_CHN, 0, NULL); - else emit(re); + else if (!isprint(ch)) emit(re); + else + { + // Accumulate printable characters into a single event while ncurses + // still has input to give us or until we fill our buffer. + char buffer[LINE_LEN+1]; + int ix = 0; + + buffer[ix++] = ch; + while (isprint(ch = wgetch(keywin)) && ix < LINE_LEN) + buffer[ix++] = ch; + // If we got a non-printable character, put it back for next time. + if (ch != ERR) ungetch(ch); + // Only emit a multi-key event if we have multiple keys. + if (ix > 1) + { + buffer[ix] = '\0'; + re.type = EV_KEY_PRESS_MULTI; + re.x = 0; + re.data = buffer; + } + emit(re); + } } else { diff -Nru linpac-0.24/src/keyboard.h linpac-0.25/src/keyboard.h --- linpac-0.24/src/keyboard.h 2015-11-19 23:43:43.000000000 +0000 +++ linpac-0.25/src/keyboard.h 2017-12-11 04:47:34.000000000 +0000 @@ -20,7 +20,7 @@ class Keyscan : public Object { private: - void *keywin; //(WINDOW * cannot be declared now - ncurses conflicts) + WINDOW *keywin; public: Keyscan(); virtual ~Keyscan(); diff -Nru linpac-0.24/src/linpac.cc linpac-0.25/src/linpac.cc --- linpac-0.24/src/linpac.cc 2015-11-19 23:43:43.000000000 +0000 +++ linpac-0.25/src/linpac.cc 2017-12-11 04:47:34.000000000 +0000 @@ -1,16 +1,17 @@ /*========================================================================== LinPac: Packet Radio Terminal for Linux + (c) David Ranch KI6ZHD (linpac@trinnet.net) 2002 - 2016 (c) Radek Burget OK2JBG (radkovo@centrum.cz) 1998 - 2002 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the license, or (at your option) any later version. - + linpac.cc - + MAIN PROGRAM - + Last update 3.7.2002 =========================================================================*/ #include @@ -404,7 +405,7 @@ //signal(SIGSEGV, sigsegv_handler); setlocale(LC_ALL, ""); #ifndef DAEMON_ONLY_MODE - printf("LinPac version %s (%s) by OK2JBG\n\n", VERSION, __DATE__); + printf("LinPac version %s (%s) by KI6ZHD\n\n", VERSION, __DATE__); #endif //init environment variables @@ -439,13 +440,19 @@ if (!daemon_start(1)) printf("LinPac: cannot become a daemon - aborting\n"); - Message(1, "Alt-X to exit."); + Message(0, "Alt-X to exit."); + + //main loop delay time + struct timespec delay; + delay.tv_sec = 0; + delay.tv_nsec = 10000000L; //start main loop mgr.quit = false; while (mgr.quit == false) { mgr.do_step(); + nanosleep(&delay, NULL); //ignore any interruptions } Error(0, "LinPac going down (quit)"); diff -Nru linpac-0.24/src/sources.cc linpac-0.25/src/sources.cc --- linpac-0.24/src/sources.cc 2015-11-19 23:43:43.000000000 +0000 +++ linpac-0.25/src/sources.cc 2017-12-11 04:47:34.000000000 +0000 @@ -923,10 +923,12 @@ int cnt = write(pip_in[1], data, pcnt); if (cnt != pcnt) + { if (errno == EAGAIN) fprintf(stderr, "ExternCmd: application pid %i not responding\n", pid); else Error(errno, "Error while sending data to application pid %i", pid); + } delete[] data; } @@ -1040,7 +1042,7 @@ bool EventGate::flush_wbuffer(int fd) { - if (wbufsize == 0 && fd == -1) return true; + if (wbufsize == 0 || fd == -1) return true; else { int w; diff -Nru linpac-0.24/src/tevent.h linpac-0.25/src/tevent.h --- linpac-0.24/src/tevent.h 2015-11-19 23:43:43.000000000 +0000 +++ linpac-0.25/src/tevent.h 2017-12-11 04:47:34.000000000 +0000 @@ -13,6 +13,7 @@ #define EV_NONE 0 //no event //User interaction #define EV_KEY_PRESS 1 //key pressed (x=keycode), y=FLAG_MOD_ALT if 'Alt' pressed +#define EV_KEY_PRESS_MULTI 103 //accumulated key presses (printable only) #define EV_BUTTON_PRESS 2 //mouse button pressed (x,y = position) #define EV_BUTTON_RELEASE 3 //mouse button released (x,y = position) #define EV_TEXT_ARGS 204 //cooking arguments for TEXT_RAW, must precede TEXT_RAW diff -Nru linpac-0.24/src/windows.cc linpac-0.25/src/windows.cc --- linpac-0.24/src/windows.cc 2015-11-19 23:43:43.000000000 +0000 +++ linpac-0.25/src/windows.cc 2017-12-11 04:47:34.000000000 +0000 @@ -398,7 +398,7 @@ if (typ < 1 || typ > 4 || !enabled) return; int cp = typ; //try to convert character - if (ch < convcnt) ch = conv[ch]; + if (ch < convcnt) ch = conv[(unsigned)ch]; //interpret character switch (ch) { @@ -608,6 +608,7 @@ if (act) { if (ev.type == EV_KEY_PRESS) + { if (!ctrlp) switch (ev.x) { @@ -624,6 +625,7 @@ case 16: ctrlp = true; break; //Ctrl-P } else ctrlp = false; + } if (ev.type == EV_CONN_REQ) { @@ -762,6 +764,8 @@ enabled = true; scroll = false; sounds = false; + convcnt = 0; + conv = NULL; colorset = false; alt_pos = false; ctrlp = false; @@ -812,6 +816,7 @@ if (act) { if (ev.type == EV_SELECT_CHN) + { if (ev.chn >= 0) { if ((ev.chn == 0 && !alt_pos) || (ev.chn != 0 && alt_pos)) @@ -825,8 +830,10 @@ else redraw(); } else act = false; + } if (ev.type == EV_KEY_PRESS) + { if (!ctrlp) switch (ev.x) { @@ -843,6 +850,7 @@ case 16: ctrlp = true; break; //Ctrl-P } else ctrlp = false; + } } if (ev.type == EV_NONE) @@ -943,8 +951,10 @@ if (!dontshow) { if (header) + { if (!bconfig("mon_bin")) bin = binary(mon_line); else bin = false; + } if (!bin) { @@ -1153,10 +1163,12 @@ wbkgdset(win, ' ' | COLOR_PAIR(CI_NORM) | fgattr(CI_NORM)); waddch(win, '\n'); if (visible < MAX_CHN) + { if (achn <= visible) mvwaddch(win, 0, x2-x1-1, '>' | COLOR_PAIR(CI_NORM) | fgattr(CI_NORM)); else mvwaddch(win, 0, x2-x1-1, '>' | COLOR_PAIR(CI_NORM) | fgattr(CI_NORM) | A_BLINK); + } if (update && act) wrefresh(win); } @@ -1274,7 +1286,7 @@ chstat.sendq, chstat.recvq); } else - wprintw(win, "%54s", "Disconnected"); + wprintw(win, "%54s", "CONNECTED"); else wprintw(win, "%54s", "Disconnected"); } else wprintw(win, "%58s", " ");