aboutsummaryrefslogtreecommitdiff
path: root/driver-ti.c
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2014-09-28 03:51:45 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2014-09-28 03:59:12 +0200
commit36bc6cd0952b2eddc17e7da803d85decf96d32cc (patch)
tree23488c213f53db83346d3eaf71cb78d74c42eff0 /driver-ti.c
parentcac1f8373bb16aae02ffa80acf8640385bf94591 (diff)
downloadtermo-36bc6cd0952b2eddc17e7da803d85decf96d32cc.tar.gz
termo-36bc6cd0952b2eddc17e7da803d85decf96d32cc.tar.xz
termo-36bc6cd0952b2eddc17e7da803d85decf96d32cc.zip
Move to iconv
That is the major change in this commit. Also Ctrl-modified keys now should work in URxvt, which was surprisingly trivial to achieve. Coming up next: - making sure the tests still work - introducing CMake
Diffstat (limited to 'driver-ti.c')
-rw-r--r--driver-ti.c29
1 files changed, 11 insertions, 18 deletions
diff --git a/driver-ti.c b/driver-ti.c
index bb7ef6e..ed0e9df 100644
--- a/driver-ti.c
+++ b/driver-ti.c
@@ -106,8 +106,7 @@ lookup_next (trie_node_t *n, unsigned char b)
{
case TYPE_KEY:
case TYPE_MOUSE:
- // FIXME
- fprintf (stderr, "ABORT: lookup_next within a TYPE_KEY node\n");
+ fprintf (stderr, "fatal: lookup_next within a TYPE_KEY node\n");
abort ();
case TYPE_ARRAY:
{
@@ -117,8 +116,7 @@ lookup_next (trie_node_t *n, unsigned char b)
return nar->arr[b - nar->min];
}
}
-
- return NULL; // Never reached but keeps compiler happy
+ return NULL; // Never reached but keeps compiler happy
}
static void
@@ -186,8 +184,8 @@ load_terminfo (termkey_ti_t *ti, const char *term)
#else
int err;
- /* Have to cast away the const. But it's OK - we know terminfo won't really
- * modify term */
+ /* Have to cast away the const. But it's OK - we know terminfo won't
+ * really modify term */
if (setupterm ((char *) term, 1, &err) != OK)
return 0;
#endif
@@ -295,11 +293,10 @@ new_driver (termkey_t *tk, const char *term)
return ti;
abort_free_trie:
- free_trie(ti->root);
+ free_trie (ti->root);
abort_free_ti:
- free(ti);
-
+ free (ti);
return NULL;
}
@@ -487,7 +484,6 @@ funcname2keysym (const char *funcname,
if (funcname[0] == 'f' && isdigit (funcname[1]))
{
*typep = TERMKEY_TYPE_FUNCTION;
- // FIXME
*symp = atoi (funcname + 1);
return 1;
}
@@ -502,7 +498,8 @@ funcname2keysym (const char *funcname,
}
#ifdef DEBUG
- fprintf (stderr, "TODO: Need to convert funcname %s to a type/sym\n", funcname);
+ fprintf (stderr, "TODO: Need to convert funcname"
+ " %s to a type/sym\n", funcname);
#endif
return 0;
@@ -546,8 +543,8 @@ insert_seq (termkey_ti_t *ti, const char *seq, trie_node_t *node)
trie_node_array_t *nar = (trie_node_array_t *) p;
if (b < nar->min || b > nar->max)
{
- // FIXME
- fprintf (stderr, "ASSERT FAIL: Trie insert at 0x%02x is outside of extent bounds (0x%02x..0x%02x)\n",
+ fprintf (stderr, "fatal: trie insert at 0x%02x is outside of"
+ " extent bounds (0x%02x..0x%02x)\n",
b, nar->min, nar->max);
abort ();
}
@@ -557,8 +554,7 @@ insert_seq (termkey_ti_t *ti, const char *seq, trie_node_t *node)
}
case TYPE_KEY:
case TYPE_MOUSE:
- // FIXME
- fprintf (stderr, "ASSERT FAIL: Tried to insert child node in TYPE_KEY\n");
+ fprintf (stderr, "fatal: tried to insert child node in TYPE_KEY\n");
abort ();
}
@@ -570,12 +566,9 @@ insert_seq (termkey_ti_t *ti, const char *seq, trie_node_t *node)
termkey_driver_t termkey_driver_ti =
{
.name = "terminfo",
-
.new_driver = new_driver,
.free_driver = free_driver,
-
.start_driver = start_driver,
.stop_driver = stop_driver,
-
.peekkey = peekkey,
};