]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
fuzzterm: add some output to allow this to be used for testing.
authorBen Harris <bjh21@bjh21.me.uk>
Sat, 24 Oct 2015 16:56:38 +0000 (17:56 +0100)
committerBen Harris <bjh21@bjh21.me.uk>
Wed, 28 Oct 2015 22:08:59 +0000 (22:08 +0000)
Not very much, but it might be useful for testing that changes don't
unexpectedly break things.

fuzzterm.c

index a4755d8f30633ecebed5a46d2691b22887655508..22cda8080dfcf5a569fbd23b2a2cd7b382b2bc33 100644 (file)
@@ -31,6 +31,7 @@ int main(int argc, char **argv)
                len = fread(blk, 1, sizeof(blk), stdin);
                term_data(term, 0, blk, len);
        }
+       term_update(term);
        return 0;
 }
 
@@ -40,8 +41,16 @@ int from_backend(void *frontend, int is_stderr, const char *data, int len)
 /* 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)
+{
+    printf("TEXT[attr=%08lx,lattr=%02x]@(%d,%d): %d\n", attr, lattr, x, y, len);
+}
+void do_cursor(Context ctx, int x, int y, wchar_t * text, int len,
+            unsigned long attr, int lattr)
+{
+    printf("CURS[attr=%08lx,lattr=%02x]@(%d,%d): %d\n", attr, lattr, x, y, len);
+}
 int char_width(Context ctx, int uc) { return 1; }
 void set_title(void *frontend, char *t) { }
 void set_icon(void *frontend, char *t) { }
@@ -49,7 +58,11 @@ void set_sbar(void *frontend, int a, int b, int c) { }
 
 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) { }