summaryrefslogtreecommitdiff
path: root/src/lib9
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib9')
-rw-r--r--src/lib9/argv0.c35
-rw-r--r--src/lib9/flag.c307
-rw-r--r--src/lib9/fmt/test.c2
-rw-r--r--src/lib9/getuser.c43
-rw-r--r--src/lib9/getwd.c3
-rw-r--r--src/lib9/goos.c12
-rw-r--r--src/lib9/main.c20
-rw-r--r--src/lib9/utf/Makefile4
-rw-r--r--src/lib9/utf/rune.c21
-rw-r--r--src/lib9/utf/runetype.c2
-rw-r--r--src/lib9/utf/runetypebody-6.2.0.h (renamed from src/lib9/utf/runetypebody-6.0.0.h)122
-rw-r--r--src/lib9/windows.c12
12 files changed, 466 insertions, 117 deletions
diff --git a/src/lib9/argv0.c b/src/lib9/argv0.c
deleted file mode 100644
index 623985122..000000000
--- a/src/lib9/argv0.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
-Plan 9 from User Space src/lib9/argv0.c
-http://code.swtch.com/plan9port/src/tip/src/lib9/argv0.c
-
-Copyright 2001-2007 Russ Cox. All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
-*/
-
-#include <u.h>
-#include <libc.h>
-
-char *argv0;
-
-/*
- * Mac OS can't deal with files that only declare data.
- * ARGBEGIN mentions this function so that this file gets pulled in.
- */
-void __fixargv0(void) { }
diff --git a/src/lib9/flag.c b/src/lib9/flag.c
new file mode 100644
index 000000000..7c79c1a6d
--- /dev/null
+++ b/src/lib9/flag.c
@@ -0,0 +1,307 @@
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+#include <u.h>
+#include <libc.h>
+
+// Flag hash.
+typedef struct Flag Flag;
+
+struct Flag
+{
+ char *name;
+ int namelen;
+ char *desc;
+ int iscount;
+ void (*set)(char*, void*);
+ void (*set2)(char*, char*, void*);
+ void *arg;
+ Flag *next;
+ Flag *allnext;
+};
+
+static Flag *curflag;
+
+static Flag *fhash[512];
+static Flag *first, *last;
+
+char *argv0;
+
+/*
+ * Mac OS can't deal with files that only declare data.
+ * ARGBEGIN mentions this function so that this file gets pulled in.
+ */
+void __fixargv0(void) { }
+
+// FNV-1 hash. http://isthe.com/chongo/tech/comp/fnv/
+static uint32
+fnv(char *p, int n)
+{
+ uint32 h;
+
+ h = 2166136261U;
+ while(n-- > 0)
+ h = (h*16777619) ^ (uchar)*p++;
+ return h;
+}
+
+static Flag*
+lookflag(char *name, int namelen, int creat)
+{
+ uint32 h;
+ Flag *f;
+
+ h = fnv(name, namelen) & (nelem(fhash)-1);
+ for(f=fhash[h]; f; f=f->next) {
+ if(f->namelen == namelen && memcmp(f->name, name, namelen) == 0) {
+ if(creat)
+ sysfatal("multiple definitions of flag -%s", name);
+ return f;
+ }
+ }
+
+ if(!creat)
+ return nil;
+
+ f = malloc(sizeof *f);
+ if(f == nil)
+ sysfatal("out of memory");
+ memset(f, 0, sizeof *f);
+ f->name = name;
+ f->namelen = namelen;
+ f->next = fhash[h];
+ if(first == nil)
+ first = f;
+ else
+ last->allnext = f;
+ last = f;
+ fhash[h] = f;
+ return f;
+}
+
+static void
+count(char *arg, void *p)
+{
+ int *ip;
+
+ ip = p;
+ if(arg != nil)
+ *ip = atoi(arg);
+ else
+ (*ip)++;
+}
+
+void
+flagcount(char *name, char *desc, int *p)
+{
+ Flag *f;
+
+ f = lookflag(name, strlen(name), 1);
+ f->desc = desc;
+ f->iscount = 1;
+ f->set = count;
+ f->arg = p;
+}
+
+static void
+atollwhex(char *s, void *p)
+{
+ char *t;
+
+ *(int64*)p = strtoll(s, &t, 0);
+ if(*s == '\0' || *t != '\0')
+ sysfatal("invalid numeric argument -%s=%s", curflag->name, s);
+}
+
+void
+flagint64(char *name, char *desc, int64 *p)
+{
+ Flag *f;
+
+ f = lookflag(name, strlen(name), 1);
+ f->desc = desc;
+ f->set = atollwhex;
+ f->arg = p;
+}
+
+static void
+atolwhex(char *s, void *p)
+{
+ char *t;
+
+ *(int32*)p = strtol(s, &t, 0);
+ if(*s == '\0' || *t != '\0')
+ sysfatal("invalid numeric argument -%s=%s", curflag->name, s);
+}
+
+void
+flagint32(char *name, char *desc, int32 *p)
+{
+ Flag *f;
+
+ f = lookflag(name, strlen(name), 1);
+ f->desc = desc;
+ f->set = atolwhex;
+ f->arg = p;
+}
+
+static void
+string(char *s, void *p)
+{
+ *(char**)p = s;
+}
+
+void
+flagstr(char *name, char *desc, char **p)
+{
+
+ Flag *f;
+
+ f = lookflag(name, strlen(name), 1);
+ f->desc = desc;
+ f->set = string;
+ f->arg = p;
+}
+
+static void
+fn0(char *s, void *p)
+{
+ USED(s);
+ ((void(*)(void))p)();
+}
+
+void
+flagfn0(char *name, char *desc, void (*fn)(void))
+{
+ Flag *f;
+
+ f = lookflag(name, strlen(name), 1);
+ f->desc = desc;
+ f->set = fn0;
+ f->arg = fn;
+ f->iscount = 1;
+}
+
+static void
+fn1(char *s, void *p)
+{
+ ((void(*)(char*))p)(s);
+}
+
+void
+flagfn1(char *name, char *desc, void (*fn)(char*))
+{
+ Flag *f;
+
+ f = lookflag(name, strlen(name), 1);
+ f->desc = desc;
+ f->set = fn1;
+ f->arg = fn;
+}
+
+static void
+fn2(char *s, char *t, void *p)
+{
+ ((void(*)(char*, char*))p)(s, t);
+}
+
+void
+flagfn2(char *name, char *desc, void (*fn)(char*, char*))
+{
+ Flag *f;
+
+ f = lookflag(name, strlen(name), 1);
+ f->desc = desc;
+ f->set2 = fn2;
+ f->arg = fn;
+}
+
+void
+flagparse(int *argcp, char ***argvp, void (*usage)(void))
+{
+ int argc;
+ char **argv, *p, *q;
+ char *name;
+ int namelen;
+ Flag *f;
+
+ argc = *argcp;
+ argv = *argvp;
+
+ argv0 = argv[0];
+ argc--;
+ argv++;
+
+ while(argc > 0) {
+ p = *argv;
+ // stop before non-flag or -
+ if(*p != '-' || p[1] == '\0')
+ break;
+ argc--;
+ argv++;
+ // stop after --
+ if(p[1] == '-' && p[2] == '\0') {
+ break;
+ }
+
+ // turn --foo into -foo
+ if(p[1] == '-' && p[2] != '-')
+ p++;
+
+ // allow -flag=arg if present
+ name = p+1;
+ q = strchr(name, '=');
+ if(q != nil)
+ namelen = q++ - name;
+ else
+ namelen = strlen(name);
+ f = lookflag(name, namelen, 0);
+ if(f == nil) {
+ if(strcmp(p, "-h") == 0 || strcmp(p, "-help") == 0 || strcmp(p, "-?") == 0)
+ usage();
+ sysfatal("unknown flag %s", p);
+ }
+ curflag = f;
+
+ // otherwise consume next argument if non-boolean
+ if(!f->iscount && q == nil) {
+ if(argc-- == 0)
+ sysfatal("missing argument to flag %s", p);
+ q = *argv++;
+ }
+
+ // and another if we need two
+ if(f->set2 != nil) {
+ if(argc-- == 0)
+ sysfatal("missing second argument to flag %s", p);
+ f->set2(q, *argv++, f->arg);
+ continue;
+ }
+
+ f->set(q, f->arg);
+ }
+
+ *argcp = argc;
+ *argvp = argv;
+}
+
+void
+flagprint(int fd)
+{
+ Flag *f;
+ char *p, *q;
+
+ for(f=first; f; f=f->allnext) {
+ p = f->desc;
+ if(p == nil || *p == '\0') // undocumented flag
+ continue;
+ q = strstr(p, ": ");
+ if(q)
+ fprint(fd, " -%s %.*s\n \t%s\n", f->name, utfnlen(p, q-p), p, q+2);
+ else if(f->namelen > 1)
+ fprint(fd, " -%s\n \t%s\n", f->name, p);
+ else
+ fprint(fd, " -%s\t%s\n", f->name, p);
+ }
+}
diff --git a/src/lib9/fmt/test.c b/src/lib9/fmt/test.c
index 1710c5e48..d82ff78ba 100644
--- a/src/lib9/fmt/test.c
+++ b/src/lib9/fmt/test.c
@@ -1,3 +1,5 @@
+// +build ignore
+
/*
* The authors of this software are Rob Pike and Ken Thompson,
* with contributions from Mike Burrows and Sean Dorward.
diff --git a/src/lib9/getuser.c b/src/lib9/getuser.c
deleted file mode 100644
index d611f4467..000000000
--- a/src/lib9/getuser.c
+++ /dev/null
@@ -1,43 +0,0 @@
-// +build !windows
-
-/*
-Plan 9 from User Space src/lib9/getuser.c
-http://code.swtch.com/plan9port/src/tip/src/lib9/getuser.c
-
-Copyright 2001-2007 Russ Cox. All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
-*/
-
-#include <u.h>
-#include <pwd.h>
-#include <libc.h>
-
-char*
-getuser(void)
-{
- static char user[64];
- struct passwd *pw;
-
- pw = getpwuid(getuid());
- if(pw == nil)
- return "none";
- strecpy(user, user+sizeof user, pw->pw_name);
- return user;
-}
diff --git a/src/lib9/getwd.c b/src/lib9/getwd.c
index 3c8cafb3a..566d3f647 100644
--- a/src/lib9/getwd.c
+++ b/src/lib9/getwd.c
@@ -26,10 +26,9 @@ THE SOFTWARE.
#include <u.h>
#include <errno.h>
#include <sys/stat.h>
+#define NOPLAN9DEFINES
#include <libc.h>
-#undef getwd
-
char*
p9getwd(char *s, int ns)
{
diff --git a/src/lib9/goos.c b/src/lib9/goos.c
index f3ee1110a..3b0027111 100644
--- a/src/lib9/goos.c
+++ b/src/lib9/goos.c
@@ -39,3 +39,15 @@ getgoversion(void)
{
return GOVERSION;
}
+
+char*
+getgoarm(void)
+{
+ return defgetenv("GOARM", GOARM);
+}
+
+char*
+getgo386(void)
+{
+ return defgetenv("GO386", GO386);
+}
diff --git a/src/lib9/main.c b/src/lib9/main.c
index 45f86c7ec..816494af0 100644
--- a/src/lib9/main.c
+++ b/src/lib9/main.c
@@ -27,11 +27,31 @@ THE SOFTWARE.
#define NOPLAN9DEFINES
#include <libc.h>
+#ifdef WIN32
+#include <windows.h>
+
+static void
+crashhandler(int sig)
+{
+ USED(sig);
+ fprint(2, "%s: internal fatal error.\n", argv0);
+ exit(1);
+}
+#endif
+
extern void p9main(int, char**);
int
main(int argc, char **argv)
{
+#ifdef WIN32
+ signal(SIGSEGV, crashhandler);
+ signal(SIGBUS, crashhandler);
+ // don't display the crash dialog
+ DWORD mode = SetErrorMode(SEM_NOGPFAULTERRORBOX);
+ SetErrorMode(mode | SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX | SEM_NOOPENFILEERRORBOX);
+ argv0 = argv[0];
+#endif
p9main(argc, argv);
exits("main");
return 99;
diff --git a/src/lib9/utf/Makefile b/src/lib9/utf/Makefile
index bbb2da6a9..5c9cdf051 100644
--- a/src/lib9/utf/Makefile
+++ b/src/lib9/utf/Makefile
@@ -15,13 +15,13 @@ UnicodeData-%.txt:
mkrunetype: mkrunetype.c
cc -I../../../include -o mkrunetype -L$(GOROOT)/pkg/obj/$(GOOS)_$(GOARCH)/ mkrunetype.c -l9
-runetypebody-%.c: mkrunetype UnicodeData-%.txt
+runetypebody-%.h: mkrunetype UnicodeData-%.txt
mkrunetype -p UnicodeData-$*.txt >_$@
mv _$@ $@
CLEANFILES+=UnicodeData.txt
-UNICODE_VERSION=6.0.0
+UNICODE_VERSION=6.2.0
test: mkrunetype UnicodeData-$(UNICODE_VERSION).txt
mkrunetype -c UnicodeData-$(UNICODE_VERSION).txt
diff --git a/src/lib9/utf/rune.c b/src/lib9/utf/rune.c
index cf98bab15..818771cfd 100644
--- a/src/lib9/utf/rune.c
+++ b/src/lib9/utf/rune.c
@@ -36,12 +36,14 @@ enum
Rune1 = (1<<(Bit1+0*Bitx))-1, /* 0000 0000 0111 1111 */
Rune2 = (1<<(Bit2+1*Bitx))-1, /* 0000 0111 1111 1111 */
Rune3 = (1<<(Bit3+2*Bitx))-1, /* 1111 1111 1111 1111 */
- Rune4 = (1<<(Bit4+3*Bitx))-1,
- /* 0001 1111 1111 1111 1111 1111 */
+ Rune4 = (1<<(Bit4+3*Bitx))-1, /* 0001 1111 1111 1111 1111 1111 */
Maskx = (1<<Bitx)-1, /* 0011 1111 */
Testx = Maskx ^ 0xFF, /* 1100 0000 */
+ SurrogateMin = 0xD800,
+ SurrogateMax = 0xDFFF,
+
Bad = Runeerror,
};
@@ -122,6 +124,8 @@ charntorune(Rune *rune, const char *str, int length)
l = ((((c << Bitx) | c1) << Bitx) | c2) & Rune3;
if(l <= Rune2)
goto bad;
+ if (SurrogateMin <= l && l <= SurrogateMax)
+ goto bad;
*rune = l;
return 3;
}
@@ -138,7 +142,7 @@ charntorune(Rune *rune, const char *str, int length)
goto bad;
if (c < T5) {
l = ((((((c << Bitx) | c1) << Bitx) | c2) << Bitx) | c3) & Rune4;
- if (l <= Rune3)
+ if (l <= Rune3 || l > Runemax)
goto bad;
*rune = l;
return 4;
@@ -208,6 +212,8 @@ chartorune(Rune *rune, const char *str)
l = ((((c << Bitx) | c1) << Bitx) | c2) & Rune3;
if(l <= Rune2)
goto bad;
+ if (SurrogateMin <= l && l <= SurrogateMax)
+ goto bad;
*rune = l;
return 3;
}
@@ -221,7 +227,7 @@ chartorune(Rune *rune, const char *str)
goto bad;
if (c < T5) {
l = ((((((c << Bitx) | c1) << Bitx) | c2) << Bitx) | c3) & Rune4;
- if (l <= Rune3)
+ if (l <= Rune3 || l > Runemax)
goto bad;
*rune = l;
return 4;
@@ -241,7 +247,8 @@ bad:
}
int
-isvalidcharntorune(const char* str, int length, Rune* rune, int* consumed) {
+isvalidcharntorune(const char* str, int length, Rune* rune, int* consumed)
+{
*consumed = charntorune(rune, str, length);
return *rune != Runeerror || *consumed == 3;
}
@@ -273,13 +280,15 @@ runetochar(char *str, const Rune *rune)
}
/*
- * If the Rune is out of range, convert it to the error rune.
+ * If the Rune is out of range or a surrogate half, convert it to the error rune.
* Do this test here because the error rune encodes to three bytes.
* Doing it earlier would duplicate work, since an out of range
* Rune wouldn't have fit in one or two bytes.
*/
if (c > Runemax)
c = Runeerror;
+ if (SurrogateMin <= c && c <= SurrogateMax)
+ c = Runeerror;
/*
* three character sequence
diff --git a/src/lib9/utf/runetype.c b/src/lib9/utf/runetype.c
index 51729fb01..b3634965f 100644
--- a/src/lib9/utf/runetype.c
+++ b/src/lib9/utf/runetype.c
@@ -35,4 +35,4 @@ rbsearch(Rune c, Rune *t, int n, int ne)
return 0;
}
-#include "runetypebody-6.0.0.h"
+#include "runetypebody-6.2.0.h"
diff --git a/src/lib9/utf/runetypebody-6.0.0.h b/src/lib9/utf/runetypebody-6.2.0.h
index 47c0faf73..a603af0df 100644
--- a/src/lib9/utf/runetypebody-6.0.0.h
+++ b/src/lib9/utf/runetypebody-6.2.0.h
@@ -1,4 +1,4 @@
-/* generated automatically by mkrunetype.c from UnicodeData-6.0.0.txt */
+/* generated automatically by mkrunetype.c from UnicodeData-6.2.0.txt */
static Rune __isspacer[] = {
0x0009, 0x000d,
@@ -64,6 +64,10 @@ static Rune __isdigitr[] = {
0xff10, 0xff19,
0x104a0, 0x104a9,
0x11066, 0x1106f,
+ 0x110f0, 0x110f9,
+ 0x11136, 0x1113f,
+ 0x111d0, 0x111d9,
+ 0x116c0, 0x116c9,
0x1d7ce, 0x1d7ff,
};
@@ -110,6 +114,7 @@ static Rune __isalphar[] = {
0x07f4, 0x07f5,
0x0800, 0x0815,
0x0840, 0x0858,
+ 0x08a2, 0x08ac,
0x0904, 0x0939,
0x0958, 0x0961,
0x0971, 0x0977,
@@ -189,7 +194,7 @@ static Rune __isalphar[] = {
0x0ead, 0x0eb0,
0x0eb2, 0x0eb3,
0x0ec0, 0x0ec4,
- 0x0edc, 0x0edd,
+ 0x0edc, 0x0edf,
0x0f40, 0x0f47,
0x0f49, 0x0f6c,
0x0f88, 0x0f8c,
@@ -201,7 +206,7 @@ static Rune __isalphar[] = {
0x1075, 0x1081,
0x10a0, 0x10c5,
0x10d0, 0x10fa,
- 0x1100, 0x1248,
+ 0x10fc, 0x1248,
0x124a, 0x124d,
0x1250, 0x1256,
0x125a, 0x125d,
@@ -242,12 +247,13 @@ static Rune __isalphar[] = {
0x1b45, 0x1b4b,
0x1b83, 0x1ba0,
0x1bae, 0x1baf,
- 0x1bc0, 0x1be5,
+ 0x1bba, 0x1be5,
0x1c00, 0x1c23,
0x1c4d, 0x1c4f,
0x1c5a, 0x1c7d,
0x1ce9, 0x1cec,
0x1cee, 0x1cf1,
+ 0x1cf5, 0x1cf6,
0x1d00, 0x1dbf,
0x1e00, 0x1f15,
0x1f18, 0x1f1d,
@@ -276,8 +282,9 @@ static Rune __isalphar[] = {
0x2c30, 0x2c5e,
0x2c60, 0x2ce4,
0x2ceb, 0x2cee,
+ 0x2cf2, 0x2cf3,
0x2d00, 0x2d25,
- 0x2d30, 0x2d65,
+ 0x2d30, 0x2d67,
0x2d80, 0x2d96,
0x2da0, 0x2da6,
0x2da8, 0x2dae,
@@ -299,7 +306,7 @@ static Rune __isalphar[] = {
0x31a0, 0x31ba,
0x31f0, 0x31ff,
0x3400, 0x4db5,
- 0x4e00, 0x9fcb,
+ 0x4e00, 0x9fcc,
0xa000, 0xa48c,
0xa4d0, 0xa4fd,
0xa500, 0xa60c,
@@ -311,9 +318,9 @@ static Rune __isalphar[] = {
0xa717, 0xa71f,
0xa722, 0xa788,
0xa78b, 0xa78e,
- 0xa790, 0xa791,
- 0xa7a0, 0xa7a9,
- 0xa7fa, 0xa801,
+ 0xa790, 0xa793,
+ 0xa7a0, 0xa7aa,
+ 0xa7f8, 0xa801,
0xa803, 0xa805,
0xa807, 0xa80a,
0xa80c, 0xa822,
@@ -332,6 +339,8 @@ static Rune __isalphar[] = {
0xaab5, 0xaab6,
0xaab9, 0xaabd,
0xaadb, 0xaadd,
+ 0xaae0, 0xaaea,
+ 0xaaf2, 0xaaf4,
0xab01, 0xab06,
0xab09, 0xab0e,
0xab11, 0xab16,
@@ -341,8 +350,7 @@ static Rune __isalphar[] = {
0xac00, 0xd7a3,
0xd7b0, 0xd7c6,
0xd7cb, 0xd7fb,
- 0xf900, 0xfa2d,
- 0xfa30, 0xfa6d,
+ 0xf900, 0xfa6d,
0xfa70, 0xfad9,
0xfb00, 0xfb06,
0xfb13, 0xfb17,
@@ -387,6 +395,8 @@ static Rune __isalphar[] = {
0x1083f, 0x10855,
0x10900, 0x10915,
0x10920, 0x10939,
+ 0x10980, 0x109b7,
+ 0x109be, 0x109bf,
0x10a10, 0x10a13,
0x10a15, 0x10a17,
0x10a19, 0x10a33,
@@ -397,9 +407,16 @@ static Rune __isalphar[] = {
0x10c00, 0x10c48,
0x11003, 0x11037,
0x11083, 0x110af,
+ 0x110d0, 0x110e8,
+ 0x11103, 0x11126,
+ 0x11183, 0x111b2,
+ 0x111c1, 0x111c4,
+ 0x11680, 0x116aa,
0x12000, 0x1236e,
0x13000, 0x1342e,
0x16800, 0x16a38,
+ 0x16f00, 0x16f44,
+ 0x16f93, 0x16f9f,
0x1b000, 0x1b001,
0x1d400, 0x1d454,
0x1d456, 0x1d49c,
@@ -428,6 +445,23 @@ static Rune __isalphar[] = {
0x1d78a, 0x1d7a8,
0x1d7aa, 0x1d7c2,
0x1d7c4, 0x1d7cb,
+ 0x1ee00, 0x1ee03,
+ 0x1ee05, 0x1ee1f,
+ 0x1ee21, 0x1ee22,
+ 0x1ee29, 0x1ee32,
+ 0x1ee34, 0x1ee37,
+ 0x1ee4d, 0x1ee4f,
+ 0x1ee51, 0x1ee52,
+ 0x1ee61, 0x1ee62,
+ 0x1ee67, 0x1ee6a,
+ 0x1ee6c, 0x1ee72,
+ 0x1ee74, 0x1ee77,
+ 0x1ee79, 0x1ee7c,
+ 0x1ee80, 0x1ee89,
+ 0x1ee8b, 0x1ee9b,
+ 0x1eea1, 0x1eea3,
+ 0x1eea5, 0x1eea9,
+ 0x1eeab, 0x1eebb,
0x20000, 0x2a6d6,
0x2a700, 0x2b734,
0x2b740, 0x2b81d,
@@ -451,6 +485,7 @@ static Rune __isalphas[] = {
0x081a,
0x0824,
0x0828,
+ 0x08a0,
0x093d,
0x0950,
0x09b2,
@@ -481,7 +516,8 @@ static Rune __isalphas[] = {
0x103f,
0x1061,
0x108e,
- 0x10fc,
+ 0x10c7,
+ 0x10cd,
0x1258,
0x12c0,
0x17d7,
@@ -501,6 +537,8 @@ static Rune __isalphas[] = {
0x2126,
0x2128,
0x214e,
+ 0x2d27,
+ 0x2d2d,
0x2d6f,
0x2e2f,
0xa8fb,
@@ -514,9 +552,26 @@ static Rune __isalphas[] = {
0x10808,
0x1083c,
0x10a00,
+ 0x16f50,
0x1d4a2,
0x1d4bb,
0x1d546,
+ 0x1ee24,
+ 0x1ee27,
+ 0x1ee39,
+ 0x1ee3b,
+ 0x1ee42,
+ 0x1ee47,
+ 0x1ee49,
+ 0x1ee4b,
+ 0x1ee54,
+ 0x1ee57,
+ 0x1ee59,
+ 0x1ee5b,
+ 0x1ee5d,
+ 0x1ee5f,
+ 0x1ee64,
+ 0x1ee7e,
};
int
@@ -652,7 +707,8 @@ static Rune __isupperp[] = {
0xa779, 0xa77b,
0xa780, 0xa786,
0xa78b, 0xa78d,
- 0xa7a0, 0xa7a8,
+ 0xa790, 0xa792,
+ 0xa7a0, 0xa7aa,
};
static Rune __isuppers[] = {
@@ -673,6 +729,8 @@ static Rune __isuppers[] = {
0x03cf,
0x03f4,
0x03f7,
+ 0x10c7,
+ 0x10cd,
0x2102,
0x2107,
0x2115,
@@ -681,7 +739,7 @@ static Rune __isuppers[] = {
0x2c60,
0x2c72,
0x2c75,
- 0xa790,
+ 0x2cf2,
0x1d49c,
0x1d4a2,
0x1d546,
@@ -733,7 +791,7 @@ static Rune __islowerr[] = {
0x04ce, 0x04cf,
0x0561, 0x0587,
0x1d00, 0x1d2b,
- 0x1d62, 0x1d77,
+ 0x1d6b, 0x1d77,
0x1d79, 0x1d9a,
0x1e95, 0x1e9d,
0x1eff, 0x1f07,
@@ -764,7 +822,7 @@ static Rune __islowerr[] = {
0x2c30, 0x2c5e,
0x2c65, 0x2c66,
0x2c73, 0x2c74,
- 0x2c76, 0x2c7c,
+ 0x2c76, 0x2c7b,
0x2ce3, 0x2ce4,
0x2d00, 0x2d25,
0xa72f, 0xa731,
@@ -832,13 +890,12 @@ static Rune __islowerp[] = {
0xa77a, 0xa77c,
0xa77f, 0xa787,
0xa78c, 0xa78e,
+ 0xa791, 0xa793,
0xa7a1, 0xa7a9,
};
static Rune __islowers[] = {
- 0x00aa,
0x00b5,
- 0x00ba,
0x0188,
0x0192,
0x0195,
@@ -864,7 +921,9 @@ static Rune __islowers[] = {
0x2184,
0x2c61,
0x2c71,
- 0xa791,
+ 0x2cf3,
+ 0x2d27,
+ 0x2d2d,
0xa7fa,
0x1d4bb,
0x1d7cb,
@@ -973,7 +1032,8 @@ static Rune __istitlep[] = {
0xa779, 0xa77b,
0xa780, 0xa786,
0xa78b, 0xa78d,
- 0xa7a0, 0xa7a8,
+ 0xa790, 0xa792,
+ 0xa7a0, 0xa7aa,
};
static Rune __istitles[] = {
@@ -990,12 +1050,14 @@ static Rune __istitles[] = {
0x038c,
0x03cf,
0x03f7,
+ 0x10c7,
+ 0x10cd,
0x2132,
0x2183,
0x2c60,
0x2c72,
0x2c75,
- 0xa790,
+ 0x2cf2,
};
int
@@ -1088,6 +1150,7 @@ static Rune __toupperp[] = {
0xa733, 0xa76f, 1048575,
0xa77a, 0xa77c, 1048575,
0xa77f, 0xa787, 1048575,
+ 0xa791, 0xa793, 1048575,
0xa7a1, 0xa7a9, 1048575,
};
@@ -1132,6 +1195,7 @@ static Rune __touppers[] = {
0x0260, 1048371,
0x0263, 1048369,
0x0265, 1090856,
+ 0x0266, 1090884,
0x0268, 1048367,
0x0269, 1048365,
0x026b, 1059319,
@@ -1178,8 +1242,10 @@ static Rune __touppers[] = {
0x2c66, 1037784,
0x2c73, 1048575,
0x2c76, 1048575,
+ 0x2cf3, 1048575,
+ 0x2d27, 1041312,
+ 0x2d2d, 1041312,
0xa78c, 1048575,
- 0xa791, 1048575,
};
Rune
@@ -1271,6 +1337,7 @@ static Rune __tolowerp[] = {
0xa732, 0xa76e, 1048577,
0xa779, 0xa77b, 1048577,
0xa780, 0xa786, 1048577,
+ 0xa790, 0xa792, 1048577,
0xa7a0, 0xa7a8, 1048577,
};
@@ -1337,6 +1404,8 @@ static Rune __tolowers[] = {
0x03fa, 1048577,
0x04c0, 1048591,
0x04c1, 1048577,
+ 0x10c7, 1055840,
+ 0x10cd, 1055840,
0x1e9e, 1040961,
0x1fbc, 1048567,
0x1fcc, 1048567,
@@ -1357,11 +1426,12 @@ static Rune __tolowers[] = {
0x2c70, 1037794,
0x2c72, 1048577,
0x2c75, 1048577,
+ 0x2cf2, 1048577,
0xa77d, 1013244,
0xa77e, 1048577,
0xa78b, 1048577,
0xa78d, 1006296,
- 0xa790, 1048577,
+ 0xa7aa, 1006268,
};
Rune
@@ -1455,6 +1525,7 @@ static Rune __totitlep[] = {
0xa733, 0xa76f, 1048575,
0xa77a, 0xa77c, 1048575,
0xa77f, 0xa787, 1048575,
+ 0xa791, 0xa793, 1048575,
0xa7a1, 0xa7a9, 1048575,
};
@@ -1496,6 +1567,7 @@ static Rune __totitles[] = {
0x0260, 1048371,
0x0263, 1048369,
0x0265, 1090856,
+ 0x0266, 1090884,
0x0268, 1048367,
0x0269, 1048365,
0x026b, 1059319,
@@ -1542,8 +1614,10 @@ static Rune __totitles[] = {
0x2c66, 1037784,
0x2c73, 1048575,
0x2c76, 1048575,
+ 0x2cf3, 1048575,
+ 0x2d27, 1041312,
+ 0x2d2d, 1041312,
0xa78c, 1048575,
- 0xa791, 1048575,
};
Rune
diff --git a/src/lib9/windows.c b/src/lib9/windows.c
index 90753bb8d..d8ee402a2 100644
--- a/src/lib9/windows.c
+++ b/src/lib9/windows.c
@@ -5,22 +5,26 @@
#include <u.h>
#include <libc.h>
-int fork()
+int
+fork(void)
{
return -1;
}
-int p9rfork(int flags)
+int
+p9rfork(int flags)
{
return -1;
}
-Waitmsg *p9wait()
+Waitmsg*
+p9wait(void)
{
return 0;
}
-int p9waitpid()
+int
+p9waitpid(void)
{
return -1;
}