diff --git a/putty.h b/putty.h index 6132327f..f51ce449 100644 --- a/putty.h +++ b/putty.h @@ -286,6 +286,11 @@ struct unicode_data { #define LGTYP_PACKETS 3 /* logmode: SSH data packets */ #define LGTYP_SSHRAW 4 /* logmode: SSH raw data */ +/* Platform-generic function to set up a struct unicode_data. This is + * only likely to be useful to test programs; real clients will want + * to use the more flexible per-platform setup functions. */ +void init_ucs_generic(Conf *conf, struct unicode_data *ucsdata); + /* * Enumeration of 'special commands' that can be sent during a * session, separately from the byte stream of ordinary session data. diff --git a/test/fuzzterm.c b/test/fuzzterm.c index ae838651..291ded6c 100644 --- a/test/fuzzterm.c +++ b/test/fuzzterm.c @@ -21,9 +21,7 @@ int main(int argc, char **argv) conf = conf_new(); do_defaults(NULL, conf); - init_ucs(&ucsdata, conf_get_str(conf, CONF_line_codepage), - conf_get_bool(conf, CONF_utf8_override), - CS_NONE, conf_get_int(conf, CONF_vtmode)); + init_ucs_generic(conf, &ucsdata); term = term_init(conf, &ucsdata, &termwin); term_size(term, 24, 80, 10000); diff --git a/unix/unicode.c b/unix/unicode.c index a98c8d3b..7be64a53 100644 --- a/unix/unicode.c +++ b/unix/unicode.c @@ -243,6 +243,13 @@ bool init_ucs(struct unicode_data *ucsdata, char *linecharset, return ret; } +void init_ucs_generic(Conf *conf, struct unicode_data *ucsdata) +{ + init_ucs(ucsdata, conf_get_str(conf, CONF_line_codepage), + conf_get_bool(conf, CONF_utf8_override), + CS_NONE, conf_get_int(conf, CONF_vtmode)); +} + const char *cp_name(int codepage) { if (codepage == CS_NONE) diff --git a/windows/unicode.c b/windows/unicode.c index 4b18ef56..26ffcb6f 100644 --- a/windows/unicode.c +++ b/windows/unicode.c @@ -689,6 +689,11 @@ void init_ucs(Conf *conf, struct unicode_data *ucsdata) } } +void init_ucs_generic(Conf *conf, struct unicode_data *ucsdata) +{ + init_ucs(conf, ucsdata); +} + static void link_font(WCHAR *line_tbl, WCHAR *font_tbl, WCHAR attr) { int font_index, line_index, i;