diff --git a/gen/scriptmap.go b/gen/scriptmap.go index 488b8b3..a4a85c6 100644 --- a/gen/scriptmap.go +++ b/gen/scriptmap.go @@ -86,7 +86,7 @@ func writeMap(d *scriptdata, m []*scriptmap, filename string) error { w.WriteString(header) w.WriteString( - "#include \"convert.h\"\n" + + "#include \"src/convert.h\"\n" + "int GetCharmap(int script, int region) {\n" + "switch (script) {\n") for _, s := range m { diff --git a/src/BUILD.bazel b/src/BUILD.bazel index ead3393..d1a620e 100644 --- a/src/BUILD.bazel +++ b/src/BUILD.bazel @@ -31,6 +31,8 @@ genrule( cc_library( name = "convert", srcs = [ + "charmap.c", + "convert.h", "defs.h", "toolbox.c", ], diff --git a/src/convert.h b/src/convert.h new file mode 100644 index 0000000..b5ada64 --- /dev/null +++ b/src/convert.h @@ -0,0 +1,9 @@ +#ifndef convert_h +#define convert_h +/* convert.h - character set conversion routines. */ + +/* Get the character map used for the given Mac OS script and region codes. + Return -1 if no known character map exists. */ +int GetCharmap(int script, int region); + +#endif