5 #define PUTTY_DO_GLOBALS
9 int main(int argc, char **argv)
15 struct unicode_data ucsdata;
18 do_defaults(NULL, conf);
19 init_ucs(&ucsdata, conf_get_str(conf, CONF_line_codepage),
20 conf_get_int(conf, CONF_utf8_override),
21 CS_NONE, conf_get_int(conf, CONF_vtmode));
23 term = term_init(conf, &ucsdata, NULL);
24 term_size(term, 24, 80, 10000);
26 /* Tell american fuzzy lop that this is a good place to fork. */
27 #ifdef __AFL_HAVE_MANUAL_CONTROL
30 while (!feof(stdin)) {
31 len = fread(blk, 1, sizeof(blk), stdin);
32 term_data(term, 0, blk, len);
37 int from_backend(void *frontend, int is_stderr, const char *data, int len)
40 /* functions required by terminal.c */
42 void request_resize(void *frontend, int x, int y) { }
43 void do_text(Context a, int b, int c, wchar_t * d, int e, unsigned long f, int g) { }
44 void do_cursor(Context a, int b, int c, wchar_t * d, int e, unsigned long f, int g) { }
45 int char_width(Context ctx, int uc) { return 1; }
46 void set_title(void *frontend, char *t) { }
47 void set_icon(void *frontend, char *t) { }
48 void set_sbar(void *frontend, int a, int b, int c) { }
50 void ldisc_send(void *handle, const char *buf, int len, int interactive) {}
51 void ldisc_echoedit_update(void *handle) {}
52 Context get_ctx(void *frontend) { return NULL; }
53 void free_ctx(Context ctx) { }
54 void palette_set(void *frontend, int a, int b, int c, int d) { }
55 void palette_reset(void *frontend) { }
56 void write_clip(void *frontend, wchar_t *a, int *b, int c, int d) { }
57 void get_clip(void *frontend, wchar_t **w, int *i) { }
58 void set_raw_mouse_mode(void *frontend, int m) { }
59 void request_paste(void *frontend) { }
60 void do_beep(void *frontend, int a) { }
61 void sys_cursor(void *frontend, int x, int y) { }
62 void fatalbox(const char *fmt, ...) { exit(0); }
63 void modalfatalbox(const char *fmt, ...) { exit(0); }
64 void nonfatal(const char *fmt, ...) { }
66 void set_iconic(void *frontend, int iconic) { }
67 void move_window(void *frontend, int x, int y) { }
68 void set_zorder(void *frontend, int top) { }
69 void refresh_window(void *frontend) { }
70 void set_zoomed(void *frontend, int zoomed) { }
71 int is_iconic(void *frontend) { return 0; }
72 void get_window_pos(void *frontend, int *x, int *y) { *x = 0; *y = 0; }
73 void get_window_pixels(void *frontend, int *x, int *y) { *x = 0; *y = 0; }
74 char *get_window_title(void *frontend, int icon) { return "moo"; }
76 /* needed by timing.c */
77 void timer_change_notify(unsigned long next) { }
79 /* needed by config.c and sercfg.c */
81 void dlg_radiobutton_set(union control *ctrl, void *dlg, int whichbutton) { }
82 int dlg_radiobutton_get(union control *ctrl, void *dlg) { return 0; }
83 void dlg_checkbox_set(union control *ctrl, void *dlg, int checked) { }
84 int dlg_checkbox_get(union control *ctrl, void *dlg) { return 0; }
85 void dlg_editbox_set(union control *ctrl, void *dlg, char const *text) { }
86 char *dlg_editbox_get(union control *ctrl, void *dlg) { return dupstr("moo"); }
87 void dlg_listbox_clear(union control *ctrl, void *dlg) { }
88 void dlg_listbox_del(union control *ctrl, void *dlg, int index) { }
89 void dlg_listbox_add(union control *ctrl, void *dlg, char const *text) { }
90 void dlg_listbox_addwithid(union control *ctrl, void *dlg,
91 char const *text, int id) { }
92 int dlg_listbox_getid(union control *ctrl, void *dlg, int index) { return 0; }
93 int dlg_listbox_index(union control *ctrl, void *dlg) { return -1; }
94 int dlg_listbox_issel(union control *ctrl, void *dlg, int index) { return 0; }
95 void dlg_listbox_select(union control *ctrl, void *dlg, int index) { }
96 void dlg_text_set(union control *ctrl, void *dlg, char const *text) { }
97 void dlg_filesel_set(union control *ctrl, void *dlg, Filename *fn) { }
98 Filename *dlg_filesel_get(union control *ctrl, void *dlg) { return NULL; }
99 void dlg_fontsel_set(union control *ctrl, void *dlg, FontSpec *fn) { }
100 FontSpec *dlg_fontsel_get(union control *ctrl, void *dlg) { return NULL; }
101 void dlg_update_start(union control *ctrl, void *dlg) { }
102 void dlg_update_done(union control *ctrl, void *dlg) { }
103 void dlg_set_focus(union control *ctrl, void *dlg) { }
104 void dlg_label_change(union control *ctrl, void *dlg, char const *text) { }
105 union control *dlg_last_focused(union control *ctrl, void *dlg) { return NULL; }
106 void dlg_beep(void *dlg) { }
107 void dlg_error_msg(void *dlg, const char *msg) { }
108 void dlg_end(void *dlg, int value) { }
109 void dlg_coloursel_start(union control *ctrl, void *dlg,
110 int r, int g, int b) { }
111 int dlg_coloursel_results(union control *ctrl, void *dlg,
112 int *r, int *g, int *b) { return 0; }
113 void dlg_refresh(union control *ctrl, void *dlg) { }
116 void logevent(void *frontend, const char *msg) { }
117 int askappend(void *frontend, Filename *filename,
118 void (*callback)(void *ctx, int result), void *ctx) { return 0; }
120 const char *const appname = "FuZZterm";
121 const int ngsslibs = 0;
122 const char *const gsslibnames[0] = { };
123 const struct keyvalwhere gsslibkeywords[0] = { };
126 * Default settings that are specific to Unix plink.
128 char *platform_default_s(const char *name)
130 if (!strcmp(name, "TermType"))
131 return dupstr(getenv("TERM"));
132 if (!strcmp(name, "SerialLine"))
133 return dupstr("/dev/ttyS0");
137 int platform_default_i(const char *name, int def)
142 FontSpec *platform_default_fontspec(const char *name)
144 return fontspec_new("");
147 Filename *platform_default_filename(const char *name)
149 if (!strcmp(name, "LogFileName"))
150 return filename_from_str("putty.log");
152 return filename_from_str("");
155 char *x_get_default(const char *key)
157 return NULL; /* this is a stub */