blob: 833d9d257492548b91bdc114e1b02cc02adef225 [file] [log] [blame]
rscaa738612004-03-01 19:36:29 +00001#ifndef _UTFH_
2#define _UTFH_ 1
3#ifdef __cplusplus
4extern "C" {
5#endif
6
7typedef unsigned short Rune; /* 16 bits */
8
9enum
10{
11 UTFmax = 3, /* maximum bytes per rune */
12 Runesync = 0x80, /* cannot represent part of a UTF sequence (<) */
13 Runeself = 0x80, /* rune and UTF sequences are the same (<) */
14 Runeerror = 0x80, /* decoding error in UTF */
15};
16
17/*
18 * rune routines
19 */
20extern int runetochar(char*, Rune*);
21extern int chartorune(Rune*, char*);
22extern int runelen(long);
23extern int runenlen(Rune*, int);
24extern int fullrune(char*, int);
25extern int utflen(char*);
26extern int utfnlen(char*, long);
27extern char* utfrune(char*, long);
28extern char* utfrrune(char*, long);
29extern char* utfutf(char*, char*);
30extern char* utfecpy(char*, char*, char*);
31
32extern Rune* runestrcat(Rune*, Rune*);
33extern Rune* runestrchr(Rune*, Rune);
34extern int runestrcmp(Rune*, Rune*);
35extern Rune* runestrcpy(Rune*, Rune*);
36extern Rune* runestrncpy(Rune*, Rune*, long);
37extern Rune* runestrecpy(Rune*, Rune*, Rune*);
38extern Rune* runestrdup(Rune*);
39extern Rune* runestrncat(Rune*, Rune*, long);
40extern int runestrncmp(Rune*, Rune*, long);
41extern Rune* runestrrchr(Rune*, Rune);
42extern long runestrlen(Rune*);
43extern Rune* runestrstr(Rune*, Rune*);
44
45extern Rune tolowerrune(Rune);
46extern Rune totitlerune(Rune);
47extern Rune toupperrune(Rune);
48extern int isalpharune(Rune);
49extern int islowerrune(Rune);
50extern int isspacerune(Rune);
51extern int istitlerune(Rune);
52extern int isupperrune(Rune);
53
54#ifdef cplusplus
55}
56#endif
57#endif