aboutsummaryrefslogtreecommitdiff
path: root/src/base/utf/vendor/mkrunewidth.c
diff options
context:
space:
mode:
authorNicholas Noll <nbnoll@eml.cc>2021-12-05 15:17:44 -0800
committerNicholas Noll <nbnoll@eml.cc>2021-12-05 15:17:44 -0800
commitb48327d357e0818d1a6ae2a064cfa7d1567e1242 (patch)
tree4677f228a9846937a7ec71c72a1ab63ab69d68ab /src/base/utf/vendor/mkrunewidth.c
parentc200dd832789afa298ba45e0b9efdec96c0e92cc (diff)
feat(huge): huge refactor (in progress).
Commented out libc includes to uncover all explicit dependencies. A large fraction has now been ported over (no testing). I did not port over the command line tools, such as the rc shell. These will be done independently - as of now I just want the library to stand independent. Compilation currently fails due to the lack of math functions.
Diffstat (limited to 'src/base/utf/vendor/mkrunewidth.c')
-rw-r--r--src/base/utf/vendor/mkrunewidth.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/base/utf/vendor/mkrunewidth.c b/src/base/utf/vendor/mkrunewidth.c
index c911b66..7025744 100644
--- a/src/base/utf/vendor/mkrunewidth.c
+++ b/src/base/utf/vendor/mkrunewidth.c
@@ -38,7 +38,7 @@ parse_category(char *path)
char *prop, field[NumFields][FieldLen];
if(io·open(path, sys·ORead, &utf8))
- panicf("can't open %s\n", path);
+ fatal("can't open %s\n", path);
// NOTE: we don't check for comments here
ec = -1;
@@ -111,7 +111,7 @@ parse_eawidths(char *path)
char field[2][FieldLen];
if(io·open(path, sys·ORead, &utf8))
- panicf("can't open %s\n", path);
+ fatal("can't open %s\n", path);
while((at=parse(&utf8, arrlen(field), field)) != ParseEOF){
if(at == ParseSkip)
@@ -129,7 +129,7 @@ parse_eawidths(char *path)
case 'F': w = 2; break;
default:
- panicf("malformed east asian width class: %s\n", field[1]);
+ fatal("malformed east asian width class: %s\n", field[1]);
}
coderange(field[0], &l, &r);
@@ -153,7 +153,7 @@ parse_emoji(char *path)
char *s, field[2][FieldLen];
if(io·open(path, sys·ORead, &utf8))
- panicf("can't open %s\n", path);
+ fatal("can't open %s\n", path);
while((at=parse(&utf8, arrlen(field), field)) != ParseEOF){
if(at == ParseSkip)
@@ -198,17 +198,17 @@ maketable(char *label, char *table, int pairs, int onlyranges)
/* ranges */
if(snprintf(ident[Irange], arrlen(ident[Irange]), "%s_range", label) == arrlen(ident[Irange]))
- panicf("out of identifier space\n");
+ fatal("out of identifier space\n");
r = putrange(ident[Irange], table, onlyranges);
if(!onlyranges && pairs){
if(snprintf(ident[Ipair], arrlen(ident[Ipair]), "%s_pair", label) == arrlen(ident[Ipair]))
- panicf("out of identifier space\n");
+ fatal("out of identifier space\n");
p = putpair(ident[Ipair], table);
}
if(!onlyranges){
if(snprintf(ident[Isingle], arrlen(ident[Isingle]), "%s_single", label) == arrlen(ident[Isingle]))
- panicf("out of identifier space\n");
+ fatal("out of identifier space\n");
s = putsingle(ident[Isingle], table);
}
@@ -253,12 +253,11 @@ maketable(char *label, char *table, int pairs, int onlyranges)
// -----------------------------------------------------------------------
// main point of entry
-static
-void
+static void
usage(void)
{
fprintf(stderr, "usage: mkrunewidth <UnicodeData.txt> <EastAsianWidth.txt> <EmojiData.txt>\n");
- exit(1);
+ rt·exit(1);
}
#define SETW0(c) \
@@ -301,7 +300,7 @@ main(int argc, char *argv[])
/* simple checking */
for(c=0; c<NumRunes; c++){
if(table.width[0][c] + table.width[1][c] + table.width[2][c] > 1)
- panicf("improper table state");
+ fatal("improper table state");
}
putsearch();