static void tsetchar(char*);
static void tsetscroll(int, int);
static void tswapscreen(void);
static void tsetchar(char*);
static void tsetscroll(int, int);
static void tswapscreen(void);
term.row = row, term.col = col;
term.line = malloc(term.row * sizeof(Line));
term.alt = malloc(term.row * sizeof(Line));
term.row = row, term.col = col;
term.line = malloc(term.row * sizeof(Line));
term.alt = malloc(term.row * sizeof(Line));
for(row = 0; row < term.row; row++) {
term.line[row] = malloc(term.col * sizeof(Glyph));
term.alt [row] = malloc(term.col * sizeof(Glyph));
for(row = 0; row < term.row; row++) {
term.line[row] = malloc(term.col * sizeof(Glyph));
term.alt [row] = malloc(term.col * sizeof(Glyph));
term.line[term.c.y][term.c.x] = term.c.attr;
memcpy(term.line[term.c.y][term.c.x].c, c, UTF_SIZ);
term.line[term.c.y][term.c.x].state |= GLYPH_SET;
term.line[term.c.y][term.c.x] = term.c.attr;
memcpy(term.line[term.c.y][term.c.x].c, c, UTF_SIZ);
term.line[term.c.y][term.c.x].state |= GLYPH_SET;
LIMIT(y1, 0, term.row-1);
LIMIT(y2, 0, term.row-1);
LIMIT(y1, 0, term.row-1);
LIMIT(y2, 0, term.row-1);
if(src >= term.col) {
tclearregion(term.c.x, term.c.y, term.col-1, term.c.y);
if(src >= term.col) {
tclearregion(term.c.x, term.c.y, term.col-1, term.c.y);
if(dst >= term.col) {
tclearregion(term.c.x, term.c.y, term.col-1, term.c.y);
return;
if(dst >= term.col) {
tclearregion(term.c.x, term.c.y, term.col-1, term.c.y);
return;
/* resize to new height */
term.line = realloc(term.line, row * sizeof(Line));
term.alt = realloc(term.alt, row * sizeof(Line));
/* resize to new height */
term.line = realloc(term.line, row * sizeof(Line));
term.alt = realloc(term.alt, row * sizeof(Line));
/* resize each row to new width, zero-pad if needed */
for(i = 0; i < minrow; i++) {
/* resize each row to new width, zero-pad if needed */
for(i = 0; i < minrow; i++) {
term.line[i] = realloc(term.line[i], col * sizeof(Glyph));
term.alt[i] = realloc(term.alt[i], col * sizeof(Glyph));
for(x = mincol; x < col; x++) {
term.line[i] = realloc(term.line[i], col * sizeof(Glyph));
term.alt[i] = realloc(term.alt[i], col * sizeof(Glyph));
for(x = mincol; x < col; x++) {
term.line[i] = calloc(col, sizeof(Glyph));
term.alt [i] = calloc(col, sizeof(Glyph));
}
term.line[i] = calloc(col, sizeof(Glyph));
term.alt [i] = calloc(col, sizeof(Glyph));
}
tmoveto(term.c.x, term.c.y);
/* reset scrolling region */
tsetscroll(0, row-1);
tmoveto(term.c.x, term.c.y);
/* reset scrolling region */
tsetscroll(0, row-1);
if(sel.bx != -1 && *(new.c) && selected(x, y))
new.mode ^= ATTR_REVERSE;
if(ib > 0 && (!(new.state & GLYPH_SET) || ATTRCMP(base, new) ||
if(sel.bx != -1 && *(new.c) && selected(x, y))
new.mode ^= ATTR_REVERSE;
if(ib > 0 && (!(new.state & GLYPH_SET) || ATTRCMP(base, new) ||
xdraws(buf, base, ox, y, ic, ib);
ic = ib = 0;
}
xdraws(buf, base, ox, y, ic, ib);
ic = ib = 0;
}