diff options
Diffstat (limited to 'tsv/tsv.ha')
| -rw-r--r-- | tsv/tsv.ha | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/tsv/tsv.ha b/tsv/tsv.ha deleted file mode 100644 index 85015a1..0000000 --- a/tsv/tsv.ha +++ /dev/null @@ -1,22 +0,0 @@ -use io; -use strings; -use fmt; - -export type error = !(str | io::error); - -export fn writerecord(w: io::handle, record: []str) (void | error) = { - let sep = ""; - for (const field .. record) { - const pfield = strings::replace(field, "\t", ""); - defer free(pfield); - fmt::fprintf(w, "{}{}", sep, pfield)!; - sep = "\t"; - }; - fmt::fprintln(w)!; -}; - -export fn writerecords(w: io::handle, records: [][]str) (void | error) = { - for (const record .. records) { - writerecord(w, record)?; - }; -}; |
