+Fri Jun 2 11:45:23 1995 Keith Vetter (keithv@fusion.com)
+
+ * makefile: cleaned up and made consistent with telnet's makefile.
+
Tue May 30 17:28:04 1995 Keith Vetter (keithv@fusion.com)
* kpasswd.c: new file for k5 password changing.
# Works for both k4 and k5 releases.
#
NAME = cns
-OBJS = cns.obj tktlist.obj kpasswd.obj
+OBJS = $(NAME).obj tktlist.obj
##### Options
DEBUG = 1
KLIB = $(LIBDIR)\kerberos.lib
WLIB = $(LIBDIR)\winsock.lib
INCLUDES = /I$(BUILDTOP)\include
+XOBJS =
!endif
!if $(KVERSION) == 5
KLIB = $(LIBDIR)\libkrb5.lib
WLIB = $(LIBDIR)\winsock.lib
INCLUDES = /I$(BUILDTOP)\include /I$(BUILDTOP)\include\krb5
+XOBJS = kpasswd.obj
!endif
##### C Compiler
CC = cl
-CFLAGS_RELEASE = /f- /nologo /W3 /AL /GAs /G2 /Zp /O2 /DNDEBUG=1
-CFLAGS_DEBUG = /f /nologo /W3 /AL /GAs /G2 /Zp /O2 /Od /Zi
+CFLAGS_RELEASE = /nologo /W3 /AL /GAs /G2 /Zp /O2 /DNDEBUG=1
+CFLAGS_DEBUG = /nologo /W3 /AL /GAs /G2 /Zp /O2 /Od /Zi
!if $(DEBUG)
CFLAGS = $(CFLAGS_DEBUG) $(INCLUDES) /D$(KRB)=1
!else
all:: makefile $(NAME).exe
-$(NAME).exe: $*.def $*.res $(OBJS) $(LIBS)
- $(LINK) $(LFLAGS) $(OBJS), $@, $*.map, $(LIBS) $(SYSLIBS), $*.def
+$(NAME).exe: $*.def $*.res $(OBJS) $(XOBJS) $(LIBS)
+ $(LINK) $(LFLAGS) $(OBJS) $(XOBJS), $@, $*.map, \
+ $(LIBS) $(SYSLIBS), $*.def
$(RC) $(RFLAGS) /k $*.res $@
-$(OBJS) cns.res: cns.h tktlist.h
-
install:
- copy cns.exe ..\floppy
+ copy $(NAME).exe ..\floppy
clean::
- if exist *.exe del *.exe
- if exist ..\floppy\cns.exe del ..\floppy\cns.exe
if exist *.obj del *.obj
+ if exist *.exe del *.exe
if exist *.res del *.res
if exist *.map del *.map
if exist *.pdb del *.pdb
if exist *.err del *.err
+ if exist ..\floppy\$(NAME).exe del ..\floppy\$(NAME).exe
+
+$(OBJS) $(NAME).res: $(NAME).h tktlist.h
+$(NAME).res: clock00.ico clock05.ico clock10.ico clock15.ico clock20.ico \
+ clock25.ico clock30.ico clock35.ico clock40.ico clock45.ico \
+ clock50.ico clock55.ico clock60.ico clockexp.ico clocktkt.ico \
+ cns.ico
+Fri Jun 2 10:51:31 1995 Keith Vetter (keithv@fusion.com)
+
+ Added cursor keys (in two modes) and ctrl-space:
+ * emul.c: enabled calls to ScreenSetOption to change keyboard modes.
+ * intern.c: enabled ScreenSetOption but in a limited fashion.
+ * screen.c: cursor keys now get sent to the host machine.
+ * screen.h: Added prototype for ScreenSetOption and a new message
+ type WM_MYCURSORKEY for handling the cursor keys.
+ * telnet.c: handles WM_MYCURSORKEY and ctrl-space, plus a bug
+ fix on cancelling from the menu on the opening dialog.
+ * makefile: cleaned up and made consistent with the cns makefile.
+
Thu May 25 12:52:50 1995 Keith Vetter (keithv@fusion.com)
* auth.c, intern.c, negotiat.c, screen.c, screen.h, telnet.c,
break;
case 'h': /* set mode (SM) */
-// ScreenSetOption(pScr,1);
+ ScreenSetOption(pScr,1);
escflg = 0;
break;
break;
case 'l': /* reset mode (RM) */
-// ScreenSetOption(pScr,0);
+ ScreenSetOption(pScr,0);
escflg = 0;
break;
SCREEN *pScr,
int toggle)
{
+ if (pScr->parms[0] == -2 && pScr->parms[1] == 1)
+ pScr->DECCKM = toggle;
- switch(pScr->parms[0]) {
+ #if 0
+ switch(pScr->parms[0]) {
- case -2:
- switch(pScr->parms[1]) {
+ case -2: // Set on the '?' char
+ switch(pScr->parms[1]) {
- case 1: /* set/reset cursor key mode */
- pScr->DECCKM = toggle;
- break;
-
- #ifdef NOT_SUPPORTED
- case 2: /* set/reset ANSI/vt52 mode */
+ case 1: /* set/reset cursor key mode */
+ pScr->DECCKM = toggle;
break;
- #endif
-
- case 3: /* set/reset column mode */
- pScr->x = pScr->y = 0; /* Clear the screen, mama! */
- ScreenEraseScreen(pScr);
- #if 0 /* removed for variable screen size */
- if (toggle) /* 132 column mode */
- pScr->width = pScr->allwidth;
- else
- pScr->width = 79;
+
+ #ifdef NOT_SUPPORTED
+ case 2: /* set/reset ANSI/vt52 mode */
+ break;
#endif
- break;
- #ifdef NOT_SUPPORTED
- case 4: /* set/reset scrolling mode */
- case 5: /* set/reset screen mode */
- case 6: /* set/rest origin mode */
- pScr->DECORG = toggle;
+ case 3: /* set/reset column mode */
+ pScr->x = pScr->y = 0; /* Clear the screen, mama! */
+ ScreenEraseScreen(pScr);
+ #if 0 /* removed for variable screen size */
+ if (toggle) /* 132 column mode */
+ pScr->width = pScr->allwidth;
+ else
+ pScr->width = 79;
+ #endif
break;
- #endif
- case 7: /* set/reset wrap mode */
- pScr->DECAWM = toggle;
-// set_vtwrap(pScrn, fpScr->DECAWM); /* QAK - 7/27/90: added because resetting the virtual screen's wrapping flag doesn't reset telnet window's wrapping */
- break;
+ #ifdef NOT_SUPPORTED
+ case 4: /* set/reset scrolling mode */
+ case 5: /* set/reset screen mode */
+ case 6: /* set/rest origin mode */
+ pScr->DECORG = toggle;
+ break;
+ #endif
- #ifdef NOT_SUPPORTED
- case 8: /* set/reset autorepeat mode */
- case 9: /* set/reset interlace mode */
+ case 7: /* set/reset wrap mode */
+ pScr->DECAWM = toggle;
+// set_vtwrap(pScrn, fpScr->DECAWM); /* QAK - 7/27/90: added because resetting the virtual screen's wrapping flag doesn't reset telnet window's wrapping */
break;
- #endif
- default:
+ #ifdef NOT_SUPPORTED
+ case 8: /* set/reset autorepeat mode */
+ case 9: /* set/reset interlace mode */
+ break;
+ #endif
+
+ default:
+ break;
+ } /* end switch */
break;
- } /* end switch */
- break;
- case 4:
- pScr->IRM=toggle;
- break;
+ case 4:
+ pScr->IRM=toggle;
+ break;
- default:
- break;
+ default:
+ break;
- } /* end switch */
+ } /* end switch */
+ #endif
} /* ScreenSetOption */
} /* ScreenDraw */
-#ifdef _DEBUG
+#if ! defined(NDEBUG)
BOOL CheckScreen(
SCREEN *pScr)
# makefile: Constructs the kerborized telnet client
# Works for both k4 and k5 releases.
#
-NAME = telnet
-OBJS = telnet.obj negotiat.obj auth.obj edit.obj emul.obj \
- font.obj intern.obj screen.obj
+NAME = telnet
+OBJS = $(NAME).obj negotiat.obj auth.obj edit.obj emul.obj \
+ font.obj intern.obj screen.obj
##### Options
-DEBUG = 1
+DEBUG = 1
!IF ! defined(KVERSION)
KVERSION = 5
!endif
!endif
##### C Compiler
-CC = cl
-CFLAGS_RELEASE = /nologo /W3 /AL /GAs /Gx /O1 /DNDEBUG
-CFLAGS_DEBUG = /nologo /W3 /AL /GAs /Gx /G2 /Zi /Od /D_DEBUG /Fd"TELNET.PDB"
+CC = cl
+CFLAGS_RELEASE = /nologo /W3 /AL /GAs /G2 /Zp /O2 /DNDEBUG=1
+CFLAGS_DEBUG = /nologo /W3 /AL /GAs /G2 /Zp /O2 /Od /Zi
!if $(DEBUG)
-CFLAGS = $(CFLAGS_DEBUG) $(INCLUDES) /D$(KRB)=1
+CFLAGS = $(CFLAGS_DEBUG) $(INCLUDES) /D$(KRB)=1
!else
-CFLAGS = $(CFLAGS_RELEASE) $(INCLUDES) /D$(KRB)=1
+CFLAGS = $(CFLAGS_RELEASE) $(INCLUDES) /D$(KRB)=1
!endif
##### RC Compiler
-RC = rc
-RFLAGS_RELEASE = /nologo
-RFLAGS_DEBUG = /nologo /D_DEBUG
+RC = rc
+RFLAGS_RELEASE = /nologo /DNDEBUG
+RFLAGS_DEBUG = /nologo
!if $(DEBUG)
-RFLAGS = $(RFLAGS_DEBUG) $(INCLUDES)
+RFLAGS = $(RFLAGS_DEBUG) $(INCLUDES)
!else
-RFLAGS = $(RFLAGS_RELEASE) $(INCLUDES)
+RFLAGS = $(RFLAGS_RELEASE) $(INCLUDES)
!endif
##### Linker
-LINK = link
-LIBS = $(KLIB) $(WLIB)
-SYSLIBS = libw llibcew commdlg
+LINK = link
+LIBS = $(KLIB) $(WLIB)
+SYSLIBS = libw llibcew commdlg
!if $(DEBUG)
-LFLAGS = /co /nol /nod /packc:61440 /stack:32768 /align:16 /onerror:noexe
+LFLAGS = /co /nologo /nod /packc:61440 /stack:32768 /align:16 /onerror:noexe
!else
-LFLAGS = /nol /nod /packc:61440 /stack:32768 /align:16 /onerror:noexe
+LFLAGS = /nologo /nod /packc:61440 /stack:32768 /align:16 /onerror:noexe
!endif
-all: makefile $(NAME).exe
+all:: makefile $(NAME).exe
$(NAME).exe: $*.def $*.res $(OBJS) $(XOBJS) $(LIBS)
$(LINK) $(LFLAGS) $(OBJS) $(XOBJS), $@, $*.map, \
$(RC) $(RFLAGS) /k $*.res $@
install:
- copy telnet.exe ..\floppy
+ copy $(NAME).exe ..\floppy
-clean:
+clean::
if exist *.obj del *.obj
if exist *.exe del *.exe
if exist *.res del *.res
if exist *.map del *.map
if exist *.pdb del *.pdb
if exist *.err del *.err
- if exist ..\floppy\telnet.exe del ..\floppy\telnet.exe
+ if exist ..\floppy\$(NAME).exe del ..\floppy\$(NAME).exe
telnet.obj: telnet.h dialog.h screen.h struct.h wt-proto.h ini.h
static HINSTANCE hInst;
static char szScreenClass[] = "ScreenWClass";
static char szScreenMenu[] = "ScreenMenu";
+static char cursor_key[8][4] = { // Send for cursor keys
+ "\x1B[D", "\x1B[A", "\x1B[C", "\x1B[B", // Normal mode
+ "\x1BOD", "\x1BOA", "\x1BOC", "\x1BOB", // Numpad on mode
+};
void ScreenInit(
HINSTANCE hInstance)
MessageBox(NULL, strTmp, "Kerberos", MB_OK);
break;
- #ifdef _DEBUG
+ #if ! defined(NDEBUG)
case IDM_DEBUG:
CheckScreen(pScr);
break;
else if (GetKeyState(VK_CONTROL) < 0)
PostMessage(hWnd, WM_COMMAND, IDM_COPY, NULL);
break;
- }
- if (wParam < VK_PRIOR || wParam > VK_DOWN)
- break;
-
- switch (wParam) {
-
- case VK_PRIOR: /* Page up */
- SendMessage(hWnd, WM_VSCROLL, SB_PAGEUP, NULL);
- break;
-
- case VK_NEXT: /* Page down */
- SendMessage(hWnd, WM_VSCROLL, SB_PAGEDOWN, NULL);
- break;
-
- case VK_UP: /* Line up */
- SendMessage(hWnd, WM_VSCROLL, SB_LINEUP, NULL);
+ }
+ /*
+ ** Check for cursor keys. With control pressed, we treat as
+ ** keyboard equivalents to scrolling. Otherwise, we send
+ ** a WM_MYCURSORKEY message with the appropriate string
+ ** to be sent. Sending the actual string allows the upper
+ ** level to be ignorant of keyboard modes, etc.
+ */
+ if (wParam < VK_PRIOR || wParam > VK_DOWN) // Is it a cursor key?
break;
- case VK_DOWN: /* Line down */
- SendMessage(hWnd, WM_VSCROLL, SB_LINEDOWN, NULL);
- break;
+ if (GetKeyState (VK_CONTROL) >= 0) { // No control key
+ if (wParam >= VK_LEFT && wParam <= VK_DOWN) {
+ pScr = (SCREEN *) GetWindowLong(hWnd, SCREEN_HANDLE);
+ assert (pScr != NULL);
+ wParam = wParam - VK_LEFT + (pScr->DECCKM ? 4 : 0);
+ SendMessage (pScr->hwndTel, WM_MYCURSORKEY,
+ strlen(cursor_key[wParam]),
+ (LPARAM) (char FAR *) cursor_key[wParam]);
+ }
+ } else { // Control is down
+ switch (wParam) {
+ case VK_PRIOR: /* Page up */
+ SendMessage(hWnd, WM_VSCROLL, SB_PAGEUP, NULL);
+ break;
+ case VK_NEXT: /* Page down */
+ SendMessage(hWnd, WM_VSCROLL, SB_PAGEDOWN, NULL);
+ break;
+ case VK_UP: /* Line up */
+ SendMessage(hWnd, WM_VSCROLL, SB_LINEUP, NULL);
+ break;
+ case VK_DOWN: /* Line down */
+ SendMessage(hWnd, WM_VSCROLL, SB_LINEDOWN, NULL);
+ break;
+ }
}
-
UpdateWindow(hWnd);
break;
#define WM_MYSCREENSIZE (WM_USER+6)
#define WM_NETWORKEVENT (WM_USER+7)
#define WM_HOSTNAMEFOUND (WM_USER+8)
+#define WM_MYCURSORKEY (WM_USER+9)
#define FRAME_HEIGHT ((2* GetSystemMetrics(SM_CYFRAME))+GetSystemMetrics(SM_CYCAPTION)+GetSystemMetrics(SM_CYMENU)+3)
#define FRAME_WIDTH (2*GetSystemMetrics(SM_CXFRAME)+GetSystemMetrics(SM_CXVSCROLL))
void ScreenApClear(
SCREEN *pScr);
+ void ScreenSetOption(
+ SCREEN *pScr,
+ int toggle);
+
int ScreenInsChar(
SCREEN *pScr,
int x);
int n,
int s);
- #ifdef _DEBUG
+ #if ! defined(NDEBUG)
BOOL CheckScreen(
SCREEN *pScr);
#endif
wParam = con->backspace;
else if (wParam == 0x7f)
wParam = con->ctrl_backspace;
+ else if (wParam == VK_SPACE && GetKeyState(VK_CONTROL) < 0)
+ wParam = 0;
TelnetSend(con->ks, (char *) &wParam, 1, NULL);
break;
+ case WM_MYCURSORKEY:
+ /* Acts as a send through: buffer is lParam and length in wParam */
+ if (!con)
+ break;
+ TelnetSend (con->ks, (char *) lParam, wParam, NULL);
+ break;
+
case WM_MYSYSCHAR:
if (!con)
break;
case WM_COMMAND:
switch (wParam) {
case TEL_CANCEL:
+ case IDCANCEL: // From the menu
EndDialog(hDlg, FALSE);
break;
BEGIN
MENUITEM "&Copy Cltr+Ins",IDM_COPY
MENUITEM "&Paste Shift+Ins", IDM_PASTE
- #ifdef _DEBUG
+ #if ! defined(NDEBUG)
MENUITEM "&Debug", IDM_DEBUG
#endif
END