term = term_init(conf, &ucsdata, NULL);
term_size(term, 24, 80, 10000);
term->ldisc = NULL;
+ /* Tell american fuzzy lop that this is a good place to fork. */
+#ifdef __AFL_HAVE_MANUAL_CONTROL
+ __AFL_INIT();
+#endif
while (!feof(stdin)) {
len = fread(blk, 1, sizeof(blk), stdin);
term_data(term, 0, blk, len);
}
+ term_update(term);
return 0;
}
/* functions required by terminal.c */
void request_resize(void *frontend, int x, int y) { }
-void do_text(Context a, int b, int c, wchar_t * d, int e, unsigned long f, int g) { }
-void do_cursor(Context a, int b, int c, wchar_t * d, int e, unsigned long f, int g) { }
+void do_text(Context ctx, int x, int y, wchar_t * text, int len,
+ unsigned long attr, int lattr)
+{
+ int i;
+
+ printf("TEXT[attr=%08lx,lattr=%02x]@(%d,%d):", attr, lattr, x, y);
+ for (i = 0; i < len; i++) {
+ printf(" %x", (unsigned)text[i]);
+ }
+ printf("\n");
+}
+void do_cursor(Context ctx, int x, int y, wchar_t * text, int len,
+ unsigned long attr, int lattr)
+{
+ int i;
+
+ printf("CURS[attr=%08lx,lattr=%02x]@(%d,%d):", attr, lattr, x, y);
+ for (i = 0; i < len; i++) {
+ printf(" %x", (unsigned)text[i]);
+ }
+ printf("\n");
+}
int char_width(Context ctx, int uc) { return 1; }
void set_title(void *frontend, char *t) { }
void set_icon(void *frontend, char *t) { }
void ldisc_send(void *handle, const char *buf, int len, int interactive) {}
void ldisc_echoedit_update(void *handle) {}
-Context get_ctx(void *frontend) { return NULL; }
+Context get_ctx(void *frontend) {
+ static char x;
+
+ return &x;
+}
void free_ctx(Context ctx) { }
void palette_set(void *frontend, int a, int b, int c, int d) { }
void palette_reset(void *frontend) { }
void get_window_pos(void *frontend, int *x, int *y) { *x = 0; *y = 0; }
void get_window_pixels(void *frontend, int *x, int *y) { *x = 0; *y = 0; }
char *get_window_title(void *frontend, int icon) { return "moo"; }
+int frontend_is_utf8(void *frontend) { return TRUE; }
/* needed by timing.c */
void timer_change_notify(unsigned long next) { }