4 #define PUTTY_REG_POS "Software\\SimonTatham\\PuTTY"
7 * Global variables. Most modules declare these `extern', but
8 * window.c will do `#define PUTTY_DO_GLOBALS' before including this
9 * module, and so will get them properly defined.
11 #ifdef PUTTY_DO_GLOBALS
17 #define ATTR_ACTCURS 0x80000000UL /* active cursor (block) */
18 #define ATTR_PASCURS 0x40000000UL /* passive cursor (box) */
19 #define ATTR_INVALID 0x20000000UL
20 #define ATTR_WRAPPED 0x10000000UL
22 #define ATTR_ASCII 0x00000000UL /* normal ASCII charset ESC ( B */
23 #define ATTR_GBCHR 0x00100000UL /* UK variant charset ESC ( A */
24 #define ATTR_LINEDRW 0x00200000UL /* line drawing charset ESC ( 0 */
26 #define ATTR_BOLD 0x00000100UL
27 #define ATTR_UNDER 0x00000200UL
28 #define ATTR_REVERSE 0x00000400UL
29 #define ATTR_FGMASK 0x0000F000UL
30 #define ATTR_BGMASK 0x000F0000UL
31 #define ATTR_FGSHIFT 12
32 #define ATTR_BGSHIFT 16
34 #define ATTR_DEFAULT 0x00098000UL
35 #define ATTR_DEFFG 0x00008000UL
36 #define ATTR_DEFBG 0x00090000UL
37 #define ATTR_CUR_XOR 0x000BA000UL
38 #define ERASE_CHAR (ATTR_DEFAULT | ' ')
39 #define ATTR_MASK 0xFFFFFF00UL
40 #define CHAR_MASK 0x000000FFUL
43 #define SEL_NL { 13, 10 }
45 GLOBAL int rows, cols, savelines;
47 GLOBAL int font_width, font_height;
49 #define INBUF_SIZE 2048
50 #define INBUF_MASK (INBUF_SIZE-1)
51 GLOBAL unsigned char inbuf[INBUF_SIZE];
52 GLOBAL int inbuf_head, inbuf_reap;
54 #define OUTBUF_SIZE 2048
55 #define OUTBUF_MASK (OUTBUF_SIZE-1)
56 GLOBAL unsigned char outbuf[OUTBUF_SIZE];
57 GLOBAL int outbuf_head, outbuf_reap;
61 GLOBAL int app_cursor_keys, app_keypad_keys;
63 #define WM_NETEVENT (WM_USER + 1)
66 TS_AYT, TS_BRK, TS_SYNCH, TS_EC, TS_EL, TS_GA, TS_NOP, TS_ABORT,
67 TS_AO, TS_IP, TS_SUSP, TS_EOR, TS_EOF
71 MB_NOTHING, MB_SELECT, MB_EXTEND, MB_PASTE
75 MA_NOTHING, MA_CLICK, MA_2CLK, MA_3CLK, MA_DRAG, MA_RELEASE
79 VT_XWINDOWS, VT_OEMANSI, VT_OEMONLY, VT_POORMAN
83 char *(*init) (HWND hwnd, char *host, int port, char **realhost);
84 int (*msg) (WPARAM wParam, LPARAM lParam);
85 void (*send) (char *buf, int len);
87 void (*special) (Telnet_Special code);
96 enum { PROT_TELNET, PROT_SSH } protocol;
100 enum { CIPHER_3DES, CIPHER_BLOWFISH } cipher;
104 char environmt[1024]; /* VAR\tvalue\0VAR\tvalue\0\0 */
107 /* Keyboard options */
113 /* Terminal options */
127 unsigned char colours[22][3];
128 /* Selection options */
136 * Exports from window.c.
138 void request_resize (int, int);
139 void do_text (Context, int, int, char *, int, unsigned long);
140 void set_title (char *);
141 void set_icon (char *);
142 void set_sbar (int, int, int);
143 Context get_ctx(void);
144 void free_ctx (Context);
145 void palette_set (int, int, int, int);
146 void palette_reset (void);
147 void write_clip (void *, int);
148 void get_clip (void **, int *);
149 void optimised_move (int, int, int);
150 void fatalbox (char *, ...);
152 #define OPTIMISE_IS_SCROLL 1
155 * Exports from noise.c.
157 void noise_get_heavy(void (*func) (void *, int));
158 void noise_get_light(void (*func) (void *, int));
159 void noise_ultralight(DWORD data);
160 void random_save_seed(void);
163 * Exports from windlg.c.
165 int do_config (void);
166 int do_reconfig (HWND);
167 void do_defaults (char *);
168 void lognegot (char *);
169 void shownegot (HWND);
170 void showabout (HWND);
171 void verify_ssh_host_key(char *host, struct RSAKey *key);
174 * Exports from terminal.c.
177 void term_init (void);
178 void term_size (int, int, int);
179 void term_out (void);
180 void term_paint (Context, int, int, int, int);
181 void term_scroll (int, int);
182 void term_pwron (void);
183 void term_clrsb (void);
184 void term_mouse (Mouse_Button, Mouse_Action, int, int);
185 void term_deselect (void);
186 void term_update (void);
187 void term_invalidate(void);
190 * Exports from telnet.c.
193 extern Backend telnet_backend;
196 * Exports from ssh.c.
199 extern Backend ssh_backend;
202 * Exports from sshrand.c.
205 void random_add_noise(void *noise, int length);
206 void random_init(void);
207 int random_byte(void);
208 void random_get_savedata(void **data, int *len);
211 * Exports from misc.c.
214 /* #define MALLOC_LOG do this if you suspect putty of leaking memory */
216 #define smalloc(z) (mlog(__FILE__,__LINE__), safemalloc(z))
217 #define srealloc(y,z) (mlog(__FILE__,__LINE__), saferealloc(y,z))
218 #define sfree(z) (mlog(__FILE__,__LINE__), safefree(z))
219 void mlog(char *, int);
221 #define smalloc safemalloc
222 #define srealloc saferealloc
223 #define sfree safefree
226 void *safemalloc(size_t);
227 void *saferealloc(void *, size_t);
228 void safefree(void *);
231 * Exports from version.c.
240 #define debug(x) (dprintf x)
241 static void dprintf(char *fmt, ...) {
245 static int gotconsole = 0;
253 vsprintf(buf, fmt, ap);
254 WriteFile (GetStdHandle(STD_OUTPUT_HANDLE), buf, strlen(buf), &dw, NULL);