Blame


1 f7012583 2003-11-25 devnull #ifndef _UTF_H_
2 f7012583 2003-11-25 devnull #define _UTF_H_ 1
3 f7012583 2003-11-25 devnull #if defined(__cplusplus)
4 f7012583 2003-11-25 devnull extern "C" {
5 f7012583 2003-11-25 devnull #endif
6 b2cfc4e2 2003-09-30 devnull
7 0cadb430 2009-09-11 russcox typedef unsigned int Rune; /* 32 bits */
8 b2cfc4e2 2003-09-30 devnull
9 b2cfc4e2 2003-09-30 devnull enum
10 b2cfc4e2 2003-09-30 devnull {
11 0cadb430 2009-09-11 russcox UTFmax = 4, /* maximum bytes per rune */
12 b2cfc4e2 2003-09-30 devnull Runesync = 0x80, /* cannot represent part of a UTF sequence (<) */
13 b2cfc4e2 2003-09-30 devnull Runeself = 0x80, /* rune and UTF sequences are the same (<) */
14 0cadb430 2009-09-11 russcox Runeerror = 0xFFFD, /* decoding error in UTF */
15 0cadb430 2009-09-11 russcox Runemax = 0x10FFFF /* maximum rune value */
16 b2cfc4e2 2003-09-30 devnull };
17 b2cfc4e2 2003-09-30 devnull
18 8bbb2f64 2004-12-25 devnull /* Edit .+1,/^$/ | cfn $PLAN9/src/lib9/utf/?*.c | grep -v static |grep -v __ */
19 8bbb2f64 2004-12-25 devnull int chartorune(Rune *rune, char *str);
20 8bbb2f64 2004-12-25 devnull int fullrune(char *str, int n);
21 8bbb2f64 2004-12-25 devnull int isalpharune(Rune c);
22 8bbb2f64 2004-12-25 devnull int islowerrune(Rune c);
23 8bbb2f64 2004-12-25 devnull int isspacerune(Rune c);
24 8bbb2f64 2004-12-25 devnull int istitlerune(Rune c);
25 8bbb2f64 2004-12-25 devnull int isupperrune(Rune c);
26 8bbb2f64 2004-12-25 devnull int runelen(long c);
27 8bbb2f64 2004-12-25 devnull int runenlen(Rune *r, int nrune);
28 8bbb2f64 2004-12-25 devnull Rune* runestrcat(Rune *s1, Rune *s2);
29 8bbb2f64 2004-12-25 devnull Rune* runestrchr(Rune *s, Rune c);
30 8bbb2f64 2004-12-25 devnull int runestrcmp(Rune *s1, Rune *s2);
31 8bbb2f64 2004-12-25 devnull Rune* runestrcpy(Rune *s1, Rune *s2);
32 8bbb2f64 2004-12-25 devnull Rune* runestrdup(Rune *s) ;
33 8bbb2f64 2004-12-25 devnull Rune* runestrecpy(Rune *s1, Rune *es1, Rune *s2);
34 8bbb2f64 2004-12-25 devnull long runestrlen(Rune *s);
35 8bbb2f64 2004-12-25 devnull Rune* runestrncat(Rune *s1, Rune *s2, long n);
36 8bbb2f64 2004-12-25 devnull int runestrncmp(Rune *s1, Rune *s2, long n);
37 8bbb2f64 2004-12-25 devnull Rune* runestrncpy(Rune *s1, Rune *s2, long n);
38 8bbb2f64 2004-12-25 devnull Rune* runestrrchr(Rune *s, Rune c);
39 8bbb2f64 2004-12-25 devnull Rune* runestrstr(Rune *s1, Rune *s2);
40 8bbb2f64 2004-12-25 devnull int runetochar(char *str, Rune *rune);
41 8bbb2f64 2004-12-25 devnull Rune tolowerrune(Rune c);
42 8bbb2f64 2004-12-25 devnull Rune totitlerune(Rune c);
43 8bbb2f64 2004-12-25 devnull Rune toupperrune(Rune c);
44 8bbb2f64 2004-12-25 devnull char* utfecpy(char *to, char *e, char *from);
45 8bbb2f64 2004-12-25 devnull int utflen(char *s);
46 8bbb2f64 2004-12-25 devnull int utfnlen(char *s, long m);
47 8bbb2f64 2004-12-25 devnull char* utfrrune(char *s, long c);
48 8bbb2f64 2004-12-25 devnull char* utfrune(char *s, long c);
49 8bbb2f64 2004-12-25 devnull char* utfutf(char *s1, char *s2);
50 b2cfc4e2 2003-09-30 devnull
51 f7012583 2003-11-25 devnull #if defined(__cplusplus)
52 f7012583 2003-11-25 devnull }
53 b2cfc4e2 2003-09-30 devnull #endif
54 f7012583 2003-11-25 devnull #endif