+static int
+compare_keys(const void *a, const void *b)
+{
+ const KEYNAMES *p = (const KEYNAMES *) a;
+ const KEYNAMES *q = (const KEYNAMES *) b;
+ int result = (int) (p->type - q->type);
+ int pn, qn;
+ if (result == 0) {
+ if (p->type == ktFunction &&
+ sscanf(p->name, "kf%d", &pn) == 1 &&
+ sscanf(q->name, "kf%d", &qn) == 1) {
+ result = (pn - qn);
+ } else {
+ result = strcmp(p->name, q->name);
+ }
+ }
+ return result;
+}
+
+static void
+draw_line(int width)
+{
+ int j;
+ if (!t_opt) {
+ for (j = 0; j < width; ++j) {
+ printf("-");
+ }
+ printf("\n");
+ }
+}
+