From 37da2899f40661e3e9631e497da8dc59b971cbd0 Mon Sep 17 00:00:00 2001 From: "Charles.Forsyth" Date: Fri, 22 Dec 2006 17:07:39 +0000 Subject: 20060303a --- emu/port/latin1.c | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 emu/port/latin1.c (limited to 'emu/port/latin1.c') diff --git a/emu/port/latin1.c b/emu/port/latin1.c new file mode 100644 index 00000000..9e8abf43 --- /dev/null +++ b/emu/port/latin1.c @@ -0,0 +1,83 @@ +#include "dat.h" + +/* + * The code makes two assumptions: strlen(ld) is 1 or 2; latintab[i].ld can be a + * prefix of latintab[j].ld only when j=5) + return unicode(k); + else + return -5; + for(l=latintab; l->ld!=0; l++) + if(k[0] == l->ld[0]){ + if(n == 1) + return -2; + if(l->ld[1] == 0) + c = k[1]; + else if(l->ld[1] != k[1]) + continue; + else if(n == 2) + return -3; + else + c = k[2]; + for(p=l->si; *p!=0; p++) + if(*p == c) { + Rune r; + int i = p - l->si; + p = l->so; + for(; i >= 0; i--) + p += chartorune(&r, p); + return r; + } + return -1; + } + return -1; +} -- cgit v1.2.3