~mdw
/
sgt
/
halibut
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Revamp of the Halibut error handling mechanism.
[sgt/halibut]
/
psdata.c
diff --git
a/psdata.c
b/psdata.c
index
7160587
..
8a01641
100644
(file)
--- a/
psdata.c
+++ b/
psdata.c
@@
-1125,15
+1125,22
@@
char const **extraglyphs = NULL;
glyph nextglyph = lenof(ps_glyphs_alphabetic);
tree234 *extrabyname = NULL;
glyph nextglyph = lenof(ps_glyphs_alphabetic);
tree234 *extrabyname = NULL;
+char const *glyph_extern(glyph glyph) {
+ if (glyph == NOGLYPH) return ".notdef";
+ if (glyph < lenof(ps_glyphs_alphabetic))
+ return ps_glyphs_alphabetic[glyph];
+ else
+ return extraglyphs[glyph - lenof(ps_glyphs_alphabetic)];
+}
+
static int glyphcmp(void *a, void *b) {
glyph ga = *(glyph *)a, gb = *(glyph *)b;
static int glyphcmp(void *a, void *b) {
glyph ga = *(glyph *)a, gb = *(glyph *)b;
- return strcmp(extraglyphs[ga - lenof(ps_glyphs_alphabetic)],
- extraglyphs[gb - lenof(ps_glyphs_alphabetic)]);
+ return strcmp(glyph_extern(ga), glyph_extern(gb));
}
static int glyphcmp_search(void *a, void *b) {
glyph gb = *(glyph *)b;
}
static int glyphcmp_search(void *a, void *b) {
glyph gb = *(glyph *)b;
- return strcmp(a,
extraglyphs[gb - lenof(ps_glyphs_alphabetic)]
);
+ return strcmp(a,
glyph_extern(gb)
);
}
glyph glyph_intern(char const *glyphname) {
}
glyph glyph_intern(char const *glyphname) {
@@
-1170,14
+1177,6
@@
glyph glyph_intern(char const *glyphname) {
return k;
}
return k;
}
-char const *glyph_extern(glyph glyph) {
- if (glyph == NOGLYPH) return ".notdef";
- if (glyph < lenof(ps_glyphs_alphabetic))
- return ps_glyphs_alphabetic[glyph];
- else
- return extraglyphs[glyph - lenof(ps_glyphs_alphabetic)];
-}
-
/* ----------------------------------------------------------------------
* Mapping between PS character names (/aacute, /zcaron etc) and
* Unicode code points.
/* ----------------------------------------------------------------------
* Mapping between PS character names (/aacute, /zcaron etc) and
* Unicode code points.