aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRuss Cox <russcox@gmail.com>2009-09-11 17:03:06 -0400
committerRuss Cox <russcox@gmail.com>2009-09-11 17:03:06 -0400
commit0cadb4301d18724e7513d7489cb5bebd262c82f1 (patch)
tree48209a4083885288eaa09178d4017769897107b3 /include
parent4dbf255619efac4f0a00e4216d6c999128910df2 (diff)
downloadplan9port-0cadb4301d18724e7513d7489cb5bebd262c82f1.tar.gz
plan9port-0cadb4301d18724e7513d7489cb5bebd262c82f1.tar.bz2
plan9port-0cadb4301d18724e7513d7489cb5bebd262c82f1.zip
convert to 4-byte UTF-8 and 32-bit Rune
http://codereview.appspot.com/116075
Diffstat (limited to 'include')
-rw-r--r--include/fmt.h2
-rw-r--r--include/utf.h7
2 files changed, 5 insertions, 4 deletions
diff --git a/include/fmt.h b/include/fmt.h
index 480ccad5..795e83e8 100644
--- a/include/fmt.h
+++ b/include/fmt.h
@@ -30,7 +30,7 @@ struct Fmt{
void *farg; /* to make flush a closure */
int nfmt; /* num chars formatted so far */
va_list args; /* args passed to dofmt */
- int r; /* % format Rune */
+ Rune r; /* % format Rune */
int width;
int prec;
unsigned long flags;
diff --git a/include/utf.h b/include/utf.h
index eb5ea42a..44052f41 100644
--- a/include/utf.h
+++ b/include/utf.h
@@ -4,14 +4,15 @@
extern "C" {
#endif
-typedef unsigned short Rune; /* 16 bits */
+typedef unsigned int Rune; /* 32 bits */
enum
{
- UTFmax = 3, /* maximum bytes per rune */
+ UTFmax = 4, /* maximum bytes per rune */
Runesync = 0x80, /* cannot represent part of a UTF sequence (<) */
Runeself = 0x80, /* rune and UTF sequences are the same (<) */
- Runeerror = 0xFFFD /* decoding error in UTF */
+ Runeerror = 0xFFFD, /* decoding error in UTF */
+ Runemax = 0x10FFFF /* maximum rune value */
};
/* Edit .+1,/^$/ | cfn $PLAN9/src/lib9/utf/?*.c | grep -v static |grep -v __ */