#include #include #include #include /* See also /sys/src/cmd/aux/mklatinkbd.c */ /* Definition from /sys/src/9/port/latin1.c */ /* * The code makes two assumptions: strlen(ld) is 1 or 2; latintab[i].ld can be a * prefix of latintab[j].ld only when j= 1) name = argv[0]; else name = "latin2js"; Bprint(&out, "/* Generated by %s. */\n", name); Bprint(&out, "var Composetab = {\n"); for(l = latintab; l->ld; ++l){ Bprint(&out, "\t\""); cprint(&out, l->ld); Bprint(&out, "\": {from:\""); cprint(&out, l->si); Bprint(&out, "\", to:\""); Bprint(&out, "%S", l->so); Bprint(&out, "\"},\n"); } Bprint(&out, "};\n"); exits(""); }