syncfiles/gen/filenames.go
Dietrich Epp c96bb9cd0a Implement extended ASCII converter engine
This adds support for the simplest 8-bit character encodings, which are
compatible with ASCII.
2022-03-23 01:26:25 -04:00

27 lines
487 B
Go

package main
import "strconv"
func writeFilenames(charmaps []string, filename string) error {
s, err := createCSource(filename)
if err != nil {
return err
}
w := s.writer
w.WriteString(header)
w.WriteString(
"#include \"src/test.h\"\n" +
"const char *const kCharsetFilename[] = {\n")
for _, fn := range charmaps {
if fn != "" {
w.WriteByte('\t')
w.WriteString(strconv.Quote(fn))
w.WriteString(",\n")
}
}
w.WriteString("\tNULL\n};\n")
return s.flush()
}