Commit b5a5b914 authored by Jason 'Eraserhead' Felice's avatar Jason 'Eraserhead' Felice
Browse files

2000-01-06 Jay 'Eraserhead' Felice <jasonf@nacs.net>

- Carey Evans' suggestions for new xt5250 script portability, security
  incorporated.
- xt5250: Now changes window title to name of host.
- cursesterm.c: Now obeys the information returned from ENQ about what
  type of terminal, and only uses xterm resize escape when on an xterm
  again.
parent a2d4ad7f
2000-01-06 Jay 'Eraserhead' Felice <jasonf@nacs.net>
- Carey Evans' suggestions for new xt5250 script portability, security
incorporated.
- xt5250: Now changes window title to name of host.
- cursesterm.c: Now obeys the information returned from ENQ about what
type of terminal, and only uses xterm resize escape when on an xterm
again.
2000-01-05 Jay 'Eraserhead' Felice <jasonf@nacs.net>
- Extensively modified xt5250 script to prompt for hostname if not given,
automagically use xrdb to load the keyboard mappings. Inspired by Henri
(Thanks!)
......@@ -17,7 +26,7 @@
- Happy Y2K!
- Changed handling of Field+ and Field- in regards to number-only-type
fields.
fields per discussions on list.
- No longer ignores the function key bits in the format table header. This
means that we won't transmit the field data for a function key unless the
AS/400 has requested it.
......@@ -40,7 +49,7 @@
host again.
- Removed some files which are generated, added autogen.sh script to generate
those files when you check out sources from CVS repository.
- Some funky sed-basd magic with config.h/tn5250-config.h resolves issue with
- Some funky sed-based magic with config.h/tn5250-config.h resolves issue with
VERSION and PACKAGE multiply-defined in pacakages which use lib5250.
- Removed tn5250_session_set_terminal, now use tn5250_display_set_terminal.
......
......@@ -6,9 +6,8 @@ bin_SCRIPTS = tn5250-config\
xt5250
pkgdata_DATA = dialogrc\
xt5250.keys
XTerm
# This also includes Win32 sources that aren't in the standard build tree.
EXTRA_DIST = acconfig.h\
tn5250-48x48.xpm\
tn5250-48x48.png\
......@@ -16,5 +15,5 @@ EXTRA_DIST = acconfig.h\
tn5250-62x48.png\
BUGS\
dialogrc\
xt5250.keys
XTerm
......@@ -10,6 +10,13 @@ AC_PROG_CC
AC_PROG_GCC_TRADITIONAL
AM_PROG_LIBTOOL
AC_PATH_PROG(DIALOG,dialog,no)
if test x$DIALOG = xno
then
AC_PATH_PROG(DIALOG,whiptail,no)
fi
AC_SUBST(DIALOG)
dnl **
dnl ** Check for screen interface libraries. There are a few posibilities here:
dnl ** -lncurses, -lcurses, -lslang. -lslang is only checked for if the
......@@ -108,9 +115,8 @@ AC_DEFINE(SOCKET_TYPE,int)
dnl ** Checks for library functions.
AC_FUNC_MEMCMP
AC_CHECK_FUNCS(setlocale)
AC_TYPE_SIGNAL
AC_CHECK_FUNCS(select socket strerror)
AC_CHECK_FUNCS(setlocale select socket strerror resizeterm)
AC_CHECK_SIZEOF(short, 2)
AC_CHECK_SIZEOF(int, 4)
AC_CHECK_SIZEOF(long, 4)
......
......@@ -29,7 +29,7 @@ shadow_color = (BLACK,BLACK,ON)
dialog_color = (GREEN,BLACK,OFF)
# Dialog box title color
title_color = (YELLOW,BLACK,ON)
title_color = (WHITE,BLACK,ON)
# Dialog box border color
border_color = (GREEN,BLACK,ON)
......
......@@ -243,17 +243,17 @@ static void curses_terminal_update(Tn5250Terminal * This, Tn5250Display *display
if (This->data->last_width != tn5250_display_width(display)
|| This->data->last_height != tn5250_display_height(display)) {
clear();
if(1) {
/* if (This->data->is_xterm) { */
if(This->data->is_xterm) {
refresh ();
printf ("\x1b[8;%d;%dt", tn5250_display_height (display)+1,
tn5250_display_width (display));
fflush (stdout);
#ifdef HAVE_RESIZETERM
resizeterm(tn5250_display_height(display)+1, tn5250_display_width(display)+1);
/* Make sure we get a SIGWINCH - We need curses to resize its
* buffer. */
raise (SIGWINCH);
#endif
/* Make sure we get a SIGWINCH - We need curses to resize its
* buffer. */
raise (SIGWINCH);
}
This->data->last_width = tn5250_display_width(display);
This->data->last_height = tn5250_display_height(display);
......@@ -408,7 +408,7 @@ static int curses_terminal_getkey(Tn5250Terminal * This)
case K_CTRL('Q'):
This->data->quit_flag = 1;
return ERR;
return -1;
case K_CTRL('G'): /* C-g <function-key-shortcut> */
if ((key = curses_terminal_get_esc_key(This, 0)) != ERR)
......@@ -447,7 +447,7 @@ static int curses_terminal_getkey(Tn5250Terminal * This)
static void curses_terminal_beep (Tn5250Terminal *This)
{
TN5250_LOG (("beep\n"));
TN5250_LOG (("CURSES: beep\n"));
beep ();
refresh ();
}
......@@ -606,16 +606,17 @@ static int curses_terminal_get_esc_key(Tn5250Terminal * This,
case 'Q':
This->data->quit_flag = 1;
key = ERR;
key = -1;
break;
case ERR:
default:
beep();
key = ERR;
key = -1;
break;
}
if (key == ERR)
if (key == -1)
mvaddstr(24, 64, "???");
else
mvaddch(24, 64, (chtype)display_key);
......
......@@ -170,6 +170,7 @@ static void tn5250_session_handle_keys(Tn5250Session *This)
if ((This->key_queue_tail + 1 == This->key_queue_head) ||
(This->key_queue_head == 0 &&
This->key_queue_tail == TN5250_SESSION_KEY_QUEUE_SIZE - 1)) {
TN5250_LOG (("Beep: Key queue full.\n"));
tn5250_display_beep (This->display);
}
This->key_queue[This->key_queue_tail] = cur_key;
......@@ -685,6 +686,7 @@ static void tn5250_session_write_to_display(Tn5250Session * This)
static void tn5250_session_handle_cc2 (Tn5250Session *This, unsigned char CC2)
{
TN5250_LOG (("Processing CC2 0x%02X.\n", (int)CC2));
if (CC2 & TN5250_SESSION_CTL_MESSAGE_ON)
tn5250_display_indicator_set(This->display, TN5250_DISPLAY_IND_MESSAGE_WAITING);
if ((CC2 & TN5250_SESSION_CTL_MESSAGE_OFF) && !(CC2 & TN5250_SESSION_CTL_MESSAGE_ON))
......@@ -693,13 +695,13 @@ static void tn5250_session_handle_cc2 (Tn5250Session *This, unsigned char CC2)
if ((CC2 & TN5250_SESSION_CTL_CLR_BLINK) != 0 && (CC2 & TN5250_SESSION_CTL_SET_BLINK) == 0) {
/* FIXME: Hand off to terminal */
}
if ((CC2 & TN5250_SESSION_CTL_SET_BLINK) != 0) {
/* FIXME: Hand off to terminal */
}
if ((CC2 & TN5250_SESSION_CTL_ALARM) != 0)
if ((CC2 & TN5250_SESSION_CTL_ALARM) != 0) {
TN5250_LOG (("TN5250_SESSION_CTL_ALARM was set.\n"));
tn5250_display_beep (This->display);
}
if ((CC2 & TN5250_SESSION_CTL_UNLOCK) != 0)
tn5250_display_indicator_clear(This->display, TN5250_DISPLAY_IND_X_SYSTEM);
}
......
......@@ -11,85 +11,102 @@ exec_prefix="@exec_prefix@"
bindir="@bindir@"
datadir="@datadir@"
pkgdatadir="$datadir/tn5250"
if [ -z "$DIALOG" ] ; then DIALOG="@DIALOG@" ; fi
if [ "$1" = "-BOOT" ]
then
shift
#
# Figure out if we've got a host name to connect to, if not, and if we
# can find a copy of `dialog', use it to prompt for the host name.
#
while [ $# -ne 0 ]
do
#
# Figure out if we've got a host name to connect to, if not, and if we
# can find a copy of `dialog', use it to prompt for the host name.
#
get_host () {
XT5250_HOST=""
while [ $# -ne 0 ] ; do
case "$1" in
-h|--help)
exec "$bindir/tn5250";;
-V|--version)
exec "$bindir/tn5250 -V";;
-m|-s|-t|-y)
args="$args $1 $2"
shift
;;
-*)
args="$args $1"
;;
*)
host="$1"
if [ -z "$XT5250_HOST" ] ; then XT5250_HOST="$1" ; fi
;;
esac
shift
done
}
if [ "$1" = "-BOOT" ] ; then
shift
#
# If the host wasn't provided, prompt for it.
#
if [ "$host" = "" ]
then
if which dialog >/dev/null 2>&1
then
if [ -z "$XT5250_HOST" ] ; then
if [ "$DIALOG" != "no" ] ; then
#
# We have a copy of `dialog', so use it.
#
if [ -f "$pkgdatadir/dialogrc" ]
then
export DIALOGRC="$pkgdatadir/dialogrc"
if [ -f "$pkgdatadir/dialogrc" ] ; then
DIALOGRC="$pkgdatadir/dialogrc"
export DIALOGRC
fi
while [ "$host" = "" ]
do
dialog --backtitle "xt5250" --title "Connect to Host" \
while [ -z "$XT5250_HOST" ] ; do
exec 3>&1
XT5250_HOST="`$DIALOG --backtitle "xt5250" --title "Connect to Host" \
--inputbox "Enter the name or IP address of the host to connect to:" \
7 60 2>/tmp/xt5250.$$ || {
rm -f /tmp/xt5250.$$
exit 1
}
host="`cat /tmp/xt5250.$$`"
rm -f /tmp/xt5250.$$
7 60 2>&1 1>&3`"
ret=$?
exec 3>&-
if [ $ret -ne 0 ] ; then exit 1 ; fi
#
# Set the window title (if we can)
#
# Only GNU echo supports -e/-n flags, so use printf if available. If
# neither works, we just silently fail without setting the window title.
#
if command -v printf >/dev/null 2>&1 ; then
printf '\033]2;xt5250 - '"$XT5250_HOST"'\07'
else
echo -e '\033]2;xt5250 - '"$XT5250_HOST"'\07'
fi
done
else
#
# We don't have a copy of `dialog', so we must use the
# shell's `read' function. Oh, well.
#
while [ "$host" = "" ]
do
while [ -z "$XT5250_HOST" ] ; do
echo "Enter name of host to connect to (Ctrl+C to cancel):"
read host
read XT5250_HOST
done
fi
else
XT5250_HOST=""
fi
exec "$bindir/tn5250" $args "$host"
if [ -z "$XT5250_HOST" ] ; then
exec "$bindir/tn5250" "$@"
else
exec "$bindir/tn5250" "$@" "$XT5250_HOST"
fi
# If the exec fails:
echo "$(basename $0): Can't exec $bindir/tn5250." >&2
echo "${0##*/}: Can't exec $bindir/tn5250." >&2
exit 1
fi
#
# Load the required X resources.
#
if [ -f "$pkgdatadir/xt5250.keys" ]
then
xrdb "$pkgdatadir/xt5250.keys"
fi
#
# Start the xterm, and run us again so we can setup inside the xterm.
#
exec xterm -name "xt5250" -bg black -fg white -tn xterm-5250 -e "$0" -BOOT "$@"
get_host "$@"
XUSERFILESEARCHPATH="$pkgdatadir/%N"
export XUSERFILESEARCHPATH XT5250_HOST
exec xterm -name "xt5250" -bg black -fg white -T "xt5250 - $XT5250_HOST" \
-tn xterm-5250 -e "$0" -BOOT "$@"
# If the exec fails:
echo "${0##*/}: Can't exec xterm." >&2
exit 1
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment