}
}
}
+
+void
+dump_keymap(struct keymap *kmap, FILE *fd, char table_shape, char numeric)
+{
+ dump_keymaps(kmap, fd);
+ dump_keys(kmap, fd, table_shape, numeric);
+ dump_funcs(kmap, fd);
+ dump_diacs(kmap, fd);
+}
void keymap_free(struct keymap *kmap);
int parse_keymap(struct keymap *kmap, lkfile_t *f);
+int get_keymap(struct keymap *kmap, int console);
int get_keys(struct keymap *kmap, int console);
int get_funcs(struct keymap *kmap, int console);
+int get_diacrs(struct keymap *kmap, int console);
int loadkeys(struct keymap *kmap, int fd, int kbd_mode);
int dump_bkeymap(struct keymap *kmap);
int dump_ctable(struct keymap *kmap, FILE *fd);
+void dump_keymap(struct keymap *kmap, FILE *fd, char table_shape, char numeric);
void dump_keymaps(struct keymap *kmap, FILE *fd);
void dump_funcs(struct keymap *kmap, FILE *fd);
void dump_diacs(struct keymap *kmap, FILE *fd);
int addkey(struct keymap *kmap, int k_index, int k_table, int keycode);
int addfunc(struct keymap *kmap, struct kbsentry kbs);
+int compose(struct keymap *kmap, unsigned int diacr, unsigned int base, unsigned int res);
#endif /* LK_KEYMAP_PRIVATE_H */
return 0;
}
+
+int
+get_diacrs(struct keymap *kmap, int fd)
+{
+#ifdef KDGKBDIACRUC
+ int request = KDGKBDIACRUC;
+ struct kbdiacrsuc kd;
+ struct kbdiacruc *ar = kd.kbdiacruc;
+#else
+ int request = KDGKBDIACR;
+ struct kbdiacrs kd;
+ struct kbdiacr *ar = kd.kbdiacr;
+#endif
+ int i;
+
+ if (ioctl(fd, request, (unsigned long) &kd)) {
+ log_error(kmap, _("KDGKBDIACR(UC): %s: Unable to get accent table"),
+ strerror(errno));
+ return -1;
+ }
+
+ for (i = 0; i < kd.kb_cnt; i++) {
+ if (compose(kmap, (ar+i)->diacr, (ar+i)->base, (ar+i)->result) < 0)
+ return -1;
+ }
+
+ return 0;
+}
+
+int
+get_keymap(struct keymap *kmap, int fd)
+{
+ if (get_keys(kmap, fd) < 0 ||
+ get_funcs(kmap, fd) < 0 ||
+ get_diacrs(kmap, fd) < 0)
+ return -1;
+ return 0;
+}
return 0;
}
-static int
-compose(struct keymap *kmap, int diacr, int base, int res)
+int
+compose(struct keymap *kmap, unsigned int diacr, unsigned int base, unsigned int res)
{
accent_entry *ptr;
int direction;