static void send_char(unsigned int x, unsigned int y, uint32_t c) { char buf[7]; int bw = utf8_unicode_to_char(buf, c); buf[bw] = '\0'; if (x-1 != lastx || y != lasty) fprintf(out, funcs[T_MOVE_CURSOR], y+1, x+1); /* TODO: get rid of fprintf */ lastx = x; lasty = y; fputs(buf, out); }
static void send_char(unsigned int x, unsigned int y, uint32_t c) { char buf[7]; int bw = utf8_unicode_to_char(buf, c); buf[bw] = '\0'; if (x-1 != lastx || y != lasty) write_cursor(x, y); lastx = x; lasty = y; if(!c) buf[0] = ' '; // replace 0 with whitespace memstream_puts(&write_buffer, buf); }