#define PUTTY_REG_POS "Software\\SimonTatham\\PuTTY"
-/*
- * Global variables. Most modules declare these `extern', but
- * window.c will do `#define PUTTY_DO_GLOBALS' before including this
- * module, and so will get them properly defined.
- */
-#ifdef PUTTY_DO_GLOBALS
-#define GLOBAL
-#else
-#define GLOBAL extern
+#ifdef macintosh
+#define OPTIMISE_SCROLL
+#endif
+
+#ifdef macintosh
+#include <MacTypes.h>
+#include <Palettes.h>
+typedef UInt32 DWORD;
+struct mac_session;
+#endif /* macintosh */
+
+#ifndef TRUE
+#define TRUE 1
+#endif
+#ifndef FALSE
+#define FALSE 0
#endif
#define ATTR_ACTCURS 0x80000000UL /* active cursor (block) */
#define ATTR_MASK 0xFFFFFF00UL
#define CHAR_MASK 0x000000FFUL
+#ifdef macintosh
+struct mac_session;
+typedef struct mac_session *Context;
+#else /* not macintosh */
typedef HDC Context;
+#endif /* not macintosh */
+
#define SEL_NL { 13, 10 }
+/*
+ * Global variables. Most modules declare these `extern', but
+ * window.c will do `#define PUTTY_DO_GLOBALS' before including this
+ * module, and so will get them properly defined.
+ */
+#ifdef PUTTY_DO_GLOBALS
+#define GLOBAL
+#else
+#define GLOBAL extern
+#endif
+
GLOBAL int rows, cols, savelines;
GLOBAL int font_width, font_height;
} VT_Mode;
typedef struct {
+#ifdef macintosh
+ char *(*init) (char *host, int port, char **realhost);
+ int (*msg)(void);
+#else /* not macintosh */
char *(*init) (HWND hwnd, char *host, int port, char **realhost);
int (*msg) (WPARAM wParam, LPARAM lParam);
+#endif /* not macintosh */
void (*send) (char *buf, int len);
void (*size) (void);
void (*special) (Telnet_Special code);
int port;
enum { PROT_TELNET, PROT_SSH } protocol;
int close_on_exit;
+ /* SSH options */
+ int nopty;
/* Telnet options */
char termtype[32];
char termspeed[32];
- char environ[1024]; /* VAR\tvalue\0VAR\tvalue\0\0 */
+ char environmt[1024]; /* VAR\tvalue\0VAR\tvalue\0\0 */
char username[32];
int rfc_environ;
/* Keyboard options */
int savelines;
int dec_om;
int wrap_mode;
+ int lfhascr;
int win_name_always;
int width, height;
char font[64];
/* Colour options */
int try_palette;
int bold_colour;
+#ifdef macintosh
+ PaletteHandle colours;
+#else /* not macintosh */
unsigned char colours[22][3];
+#endif /* not macintosh */
/* Selection options */
+#ifndef macintosh
int mouse_is_xterm;
+#endif
short wordness[256];
} Config;
GLOBAL Config cfg;
+typedef struct {
+ /* Display state */
+ int rows, cols, savelines;
+ int font_width, font_height;
+ int has_focus;
+ /* Buffers */
+ unsigned char inbuf[INBUF_SIZE];
+ int inbuf_head, inbuf_reap;
+ unsigned char outbuf[OUTBUF_SIZE];
+ int outbuf_head, outbuf_reap;
+ /* Emulator state */
+ int app_cursor_keys, app_keypad_keys;
+ /* Backend */
+ Backend *back;
+ /* Config that created this session */
+ Config cfg;
+} Session;
+
+
/*
* Exports from window.c.
*/
void write_clip (void *, int);
void get_clip (void **, int *);
void optimised_move (int, int, int);
-void fatalbox (char *, ...);
+void do_scroll(int, int, int);
+void fatalbox (const char *, ...);
void beep (void);
#define OPTIMISE_IS_SCROLL 1
void noise_ultralight(DWORD data);
void random_save_seed(void);
+#ifndef macintosh
/*
* Exports from windlg.c.
*/
void shownegot (HWND);
void showabout (HWND);
void verify_ssh_host_key(char *host, struct RSAKey *key);
+#endif
/*
* Exports from terminal.c.
void *saferealloc(void *, size_t);
void safefree(void *);
+/*
+ * Exports from testback.c
+ */
+
+extern Backend null_backend;
+extern Backend loop_backend;
+
+/*
+ * Exports from version.c.
+ */
+extern char ver[];
+
/*
* A debug system.
*/