version 1.14, 2002/06/25 14:24:53 |
version 1.15, 2002/07/01 18:01:40 |
|
|
static int first_run = 1; |
static int first_run = 1; |
VIDEO *vp; |
VIDEO *vp; |
|
|
if (newrow < 1 || newcol < 1) { |
if (newrow < 1 || newcol < 1) |
return -1; |
return (FALSE); |
} |
|
|
|
rowchanged = (newrow != nrow); |
rowchanged = (newrow != nrow); |
colchanged = (newcol != ncol); |
colchanged = (newcol != ncol); |
|
|
void *tmp; \ |
void *tmp; \ |
if ((tmp = realloc((a), (n))) == NULL) { \ |
if ((tmp = realloc((a), (n))) == NULL) { \ |
panic("out of memory in display code"); \ |
panic("out of memory in display code"); \ |
} \ |
} \ |
(a) = tmp; \ |
(a) = tmp; \ |
} while (0) |
} while (0) |
|
|
/* No update needed */ |
/* No update needed */ |
if (!first_run && !force && !rowchanged && !colchanged) { |
if (!first_run && !force && !rowchanged && !colchanged) { |
return 0; |
return (TRUE); |
} |
} |
|
|
if (first_run) { |
if (first_run) { |
|
|
/* |
/* |
* Zero-out the entries we just allocated |
* Zero-out the entries we just allocated |
*/ |
*/ |
for (i = vidstart; i < 2 * (newrow - 1); i++) { |
for (i = vidstart; i < 2 * (newrow - 1); i++) |
memset(&video[i], 0, sizeof(VIDEO)); |
memset(&video[i], 0, sizeof(VIDEO)); |
} |
|
|
|
/* |
/* |
* Reinitialize vscreen and pscreen arrays completely. |
* Reinitialize vscreen and pscreen arrays completely. |
|
|
} |
} |
} |
} |
if (rowchanged || colchanged || first_run) { |
if (rowchanged || colchanged || first_run) { |
for (i = 0; i < 2 * (newrow - 1); i++) { |
for (i = 0; i < 2 * (newrow - 1); i++) |
TRYREALLOC(video[i].v_text, newcol * sizeof(char)); |
TRYREALLOC(video[i].v_text, newcol * sizeof(char)); |
} |
|
TRYREALLOC(blanks.v_text, newcol * sizeof(char)); |
TRYREALLOC(blanks.v_text, newcol * sizeof(char)); |
} |
} |
|
|
|
|
ttcol = ncol; |
ttcol = ncol; |
|
|
first_run = 0; |
first_run = 0; |
return 0; |
return (TRUE); |
} |
} |
|
|
#undef TRYREALLOC |
#undef TRYREALLOC |