* * < 0: crlf mode is disabled
*
* Be careful with the order of the definitons because st searchs in
- * this table sequencially, so any XK_ANY_MOD must be in the last
+ * this table sequentially, so any XK_ANY_MOD must be in the last
* position for a key.
*/
/*
- * If you want something else but the function keys of X11 (0xFF00 - 0xFFFF)
- * mapped below, add them to this array.
+ * If you want keys other than the X11 function keys (0xFD00 - 0xFFFF)
+ * to be mapped below, add them to this array.
*/
static KeySym mappedkeys[] = { -1 };
static ssize_t xwrite(int, char *, size_t);
static void *xmalloc(size_t);
static void *xrealloc(void *, size_t);
-static void *xcalloc(size_t, size_t);
static void (*handler[LASTEvent])(XEvent *) = {
[KeyPress] = kpress,
return p;
}
-void *
-xcalloc(size_t nmemb, size_t size) {
- void *p = calloc(nmemb, size);
-
- if(!p)
- die("Out of memory\n");
-
- return p;
-}
-
int
utf8decode(char *s, long *u) {
uchar c;
void
tnew(int col, int row) {
- memset(&term, 0, sizeof(Term));
+ term = (Term){ .c = { .attr = { .fg = defaultfg, .bg = defaultbg } } };
tresize(col, row);
term.numlock = 1;
/* allocate any new rows */
for(/* i == minrow */; i < row; i++) {
term.dirty[i] = 1;
- term.line[i] = xcalloc(col, sizeof(Glyph));
- term.alt [i] = xcalloc(col, sizeof(Glyph));
+ term.line[i] = xmalloc(col * sizeof(Glyph));
+ term.alt[i] = xmalloc(col * sizeof(Glyph));
}
if(col > term.col) {
bp = term.tabs + term.col;