Peter Schellenbach's patch: re-implement the PuTTY cryptographic
[u/mdw/putty] / putty.h
diff --git a/putty.h b/putty.h
index e5744ea..1029de3 100644 (file)
--- a/putty.h
+++ b/putty.h
@@ -28,6 +28,7 @@ GLOBAL HINSTANCE putty_inst;
 #define ATTR_BOLD    0x00000100UL
 #define ATTR_UNDER   0x00000200UL
 #define ATTR_REVERSE 0x00000400UL
+#define ATTR_BLINK   0x00000800UL
 #define ATTR_FGMASK  0x0000F000UL
 #define ATTR_BGMASK  0x000F0000UL
 #define ATTR_FGSHIFT 12
@@ -62,11 +63,30 @@ GLOBAL int has_focus;
 
 GLOBAL int app_cursor_keys, app_keypad_keys;
 
-#define WM_NETEVENT  (WM_USER + 1)
+GLOBAL int seen_key_event;
+GLOBAL int seen_disp_event;
+
+GLOBAL int session_closed;
+
+typedef enum {
+    US_NONE = 0, US_KEY = 1, US_DISP = 2, US_BOTH = 3
+} Unscroll_Trigger;
+
+GLOBAL Unscroll_Trigger unscroll_event;
+
+GLOBAL char *logfile;
+
+/*
+ * I've just looked in the windows standard headr files for WM_USER, there
+ * are hundreds of flags defined using the form WM_USER+123 so I've 
+ * renumbered this NETEVENT value and the two in window.c
+ */
+#define WM_XUSER     (WM_USER + 0x2000)
+#define WM_NETEVENT  (WM_XUSER + 5)
 
 typedef enum {
     TS_AYT, TS_BRK, TS_SYNCH, TS_EC, TS_EL, TS_GA, TS_NOP, TS_ABORT,
-    TS_AO, TS_IP, TS_SUSP, TS_EOR, TS_EOF
+    TS_AO, TS_IP, TS_SUSP, TS_EOR, TS_EOF, TS_LECHO, TS_RECHO
 } Telnet_Special;
 
 typedef enum {
@@ -91,6 +111,18 @@ typedef struct {
 
 GLOBAL Backend *back;
 
+GLOBAL struct backend_list {
+    int protocol;
+    char *name;
+    Backend *backend;
+} backends[];
+
+typedef struct {
+    void (*send) (char *buf, int len);
+} Ldisc;
+
+GLOBAL Ldisc *ldisc;
+
 typedef struct {
     /* Basic options */
     char host[512];
@@ -117,6 +149,8 @@ typedef struct {
     int nethack_keypad;
     int alt_f4;                               /* is it special? */
     int alt_space;                    /* is it special? */
+    int ldisc_term;
+    int blink_cur;
     /* Terminal options */
     int savelines;
     int dec_om;
@@ -138,6 +172,7 @@ typedef struct {
     short wordness[256];
     /* russian language translation */
     int xlat_enablekoiwin;
+    int xlat_88592w1250;
     int xlat_capslockcyr;
 } Config;
 
@@ -156,10 +191,12 @@ GLOBAL Config cfg;
 GLOBAL int default_protocol;
 GLOBAL int default_port;
 
+struct RSAKey;                        /* be a little careful of scope */
+
 /*
  * Exports from window.c.
  */
-void request_resize (int, int);
+void request_resize (int, int, int);
 void do_text (Context, int, int, char *, int, unsigned long);
 void set_title (char *);
 void set_icon (char *);
@@ -192,7 +229,7 @@ void do_defaults (char *);
 void logevent (char *);
 void showeventlog (HWND);
 void showabout (HWND);
-void verify_ssh_host_key(char *host, struct RSAKey *key);
+void verify_ssh_host_key(char *host, char *keystr);
 void get_sesslist(int allocate);
 
 GLOBAL int nsessions;
@@ -213,12 +250,13 @@ void term_mouse (Mouse_Button, Mouse_Action, int, int);
 void term_deselect (void);
 void term_update (void);
 void term_invalidate(void);
+void term_blink(int set_cursor);
 
 /*
  * Exports from raw.c.
  */
 
-Backend raw_backend;
+extern Backend raw_backend;
 
 /*
  * Exports from telnet.c.
@@ -233,6 +271,12 @@ extern Backend telnet_backend;
 extern Backend ssh_backend;
 
 /*
+ * Exports from ldisc.c.
+ */
+
+extern Ldisc ldisc_term, ldisc_simple;
+
+/*
  * Exports from sshrand.c.
  */
 
@@ -280,6 +324,14 @@ unsigned char xlat_tty2scr(unsigned char c);
 unsigned char xlat_latkbd2win(unsigned char c);
 
 /*
+ * Exports from mscrypto.c
+ */
+#ifdef MSCRYPTOAPI
+int crypto_startup();
+void crypto_wrapup();
+#endif
+
+/*
  * A debug system.
  */
 #ifdef DEBUG