X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/c1b55581a60251ae30a1e86578d2967711e0342d..b7a189f38294c745ae4ea6efb55891c8196e275b:/putty.h diff --git a/putty.h b/putty.h index 3d971aee..89531254 100644 --- a/putty.h +++ b/putty.h @@ -2,6 +2,7 @@ #define PUTTY_PUTTY_H #include /* for FILENAME_MAX */ +#include /* for wchar_t */ /* * Global variables. Most modules declare these `extern', but @@ -92,15 +93,14 @@ typedef struct terminal_tag Terminal; #define ATTR_CUR_AND (~(ATTR_BOLD|ATTR_REVERSE|ATTR_BLINK|ATTR_COLOURS)) #define ATTR_CUR_XOR 0x00BA0000UL -GLOBAL int session_closed; - -GLOBAL int nsessions; -GLOBAL char **sessions; +struct sesslist { + int nsessions; + char **sessions; + char *buffer; /* so memory can be freed later */ +}; -GLOBAL int utf; GLOBAL int dbcs_screenfont; GLOBAL int font_codepage; -GLOBAL int kbd_codepage; GLOBAL int line_codepage; GLOBAL wchar_t unitab_scoacs[256]; GLOBAL wchar_t unitab_line[256]; @@ -214,6 +214,8 @@ struct config_tag { int tcp_nodelay; /* Proxy options */ char proxy_exclude_list[512]; + enum { PROXYDNS_NO, PROXYDNS_AUTO, PROXYDNS_YES } proxy_dns; + int even_proxy_localhost; enum { PROXY_NONE, PROXY_HTTP, PROXY_SOCKS, PROXY_TELNET } proxy_type; char proxy_host[512]; int proxy_port; @@ -303,7 +305,7 @@ struct config_tag { int blinktext; int win_name_always; int width, height; - char font[64]; + char font[256]; int fontisbold; int fontheight; int fontcharset; @@ -375,16 +377,27 @@ struct config_tag { * being run, _either_ because no remote command has been provided * _or_ because the application is GUI and can't run non- * interactively. + * + * These flags describe the type of _application_ - they wouldn't + * vary between individual sessions - and so it's OK to have this + * variable be GLOBAL. */ #define FLAG_VERBOSE 0x0001 #define FLAG_STDERR 0x0002 #define FLAG_INTERACTIVE 0x0004 GLOBAL int flags; -GLOBAL Config cfg; +/* + * Likewise, these two variables are set up when the application + * initialises, and inform all default-settings accesses after + * that. + */ GLOBAL int default_protocol; GLOBAL int default_port; +/* This variable, OTOH, needs to be made non-global ASAP. FIXME. */ +GLOBAL Config cfg; + struct RSAKey; /* be a little careful of scope */ /* @@ -393,7 +406,10 @@ struct RSAKey; /* be a little careful of scope */ void request_resize(void *frontend, int, int); void do_text(Context, int, int, char *, int, unsigned long, int); void do_cursor(Context, int, int, char *, int, unsigned long, int); -int CharWidth(Context ctx, int uc); +int char_width(Context ctx, int uc); +#ifdef OPTIMISE_SCROLL +void do_scroll(void *, int, int, int); +#endif void set_title(void *frontend, char *); void set_icon(void *frontend, char *); void set_sbar(void *frontend, int, int, int); @@ -445,7 +461,7 @@ void random_destroy_seed(void); */ void save_settings(char *section, int do_host, Config * cfg); void load_settings(char *section, int do_host, Config * cfg); -void get_sesslist(int allocate); +void get_sesslist(struct sesslist *, int allocate); void do_defaults(char *, Config *); void registry_cleanup(void); @@ -453,7 +469,7 @@ void registry_cleanup(void); * Exports from terminal.c. */ -Terminal *term_init(void *frontend); +Terminal *term_init(Config *, void *); void term_size(Terminal *, int, int, int); void term_out(Terminal *); void term_paint(Terminal *, Context, int, int, int, int, int); @@ -492,6 +508,13 @@ void log_packet(void *logctx, int direction, int type, char *texttype, void *data, int len); /* + * Exports from testback.c + */ + +extern Backend null_backend; +extern Backend loop_backend; + +/* * Exports from raw.c. */ @@ -523,7 +546,7 @@ extern Backend ssh_backend; /* * Exports from ldisc.c. */ -void *ldisc_create(Terminal *, Backend *, void *, void *); +void *ldisc_create(Config *, Terminal *, Backend *, void *, void *); void ldisc_send(void *handle, char *buf, int len, int interactive); /*