sl@0
|
1 |
/*
|
sl@0
|
2 |
*******************************************************************************
|
sl@0
|
3 |
*
|
sl@0
|
4 |
* Copyright (C) 1999-2004, International Business Machines
|
sl@0
|
5 |
* Corporation and others. All Rights Reserved.
|
sl@0
|
6 |
*
|
sl@0
|
7 |
*******************************************************************************
|
sl@0
|
8 |
* file name: uinvchar.h
|
sl@0
|
9 |
* encoding: US-ASCII
|
sl@0
|
10 |
* tab size: 8 (not used)
|
sl@0
|
11 |
* indentation:2
|
sl@0
|
12 |
*
|
sl@0
|
13 |
* created on: 2004sep14
|
sl@0
|
14 |
* created by: Markus W. Scherer
|
sl@0
|
15 |
*
|
sl@0
|
16 |
* Definitions for handling invariant characters, moved here from putil.c
|
sl@0
|
17 |
* for better modularization.
|
sl@0
|
18 |
*/
|
sl@0
|
19 |
|
sl@0
|
20 |
#ifndef __UINVCHAR_H__
|
sl@0
|
21 |
#define __UINVCHAR_H__
|
sl@0
|
22 |
|
sl@0
|
23 |
#include "unicode/utypes.h"
|
sl@0
|
24 |
|
sl@0
|
25 |
/**
|
sl@0
|
26 |
* Check if a char string only contains invariant characters.
|
sl@0
|
27 |
* See utypes.h for details.
|
sl@0
|
28 |
*
|
sl@0
|
29 |
* @param s Input string pointer.
|
sl@0
|
30 |
* @param length Length of the string, can be -1 if NUL-terminated.
|
sl@0
|
31 |
* @return TRUE if s contains only invariant characters.
|
sl@0
|
32 |
*
|
sl@0
|
33 |
* @internal (ICU 2.8)
|
sl@0
|
34 |
*/
|
sl@0
|
35 |
U_INTERNAL UBool U_EXPORT2
|
sl@0
|
36 |
uprv_isInvariantString(const char *s, int32_t length);
|
sl@0
|
37 |
|
sl@0
|
38 |
/**
|
sl@0
|
39 |
* Check if a Unicode string only contains invariant characters.
|
sl@0
|
40 |
* See utypes.h for details.
|
sl@0
|
41 |
*
|
sl@0
|
42 |
* @param s Input string pointer.
|
sl@0
|
43 |
* @param length Length of the string, can be -1 if NUL-terminated.
|
sl@0
|
44 |
* @return TRUE if s contains only invariant characters.
|
sl@0
|
45 |
*
|
sl@0
|
46 |
* @internal (ICU 2.8)
|
sl@0
|
47 |
*/
|
sl@0
|
48 |
U_INTERNAL UBool U_EXPORT2
|
sl@0
|
49 |
uprv_isInvariantUString(const UChar *s, int32_t length);
|
sl@0
|
50 |
|
sl@0
|
51 |
/**
|
sl@0
|
52 |
* \def U_UPPER_ORDINAL
|
sl@0
|
53 |
* Get the ordinal number of an uppercase invariant character
|
sl@0
|
54 |
* @internal
|
sl@0
|
55 |
*/
|
sl@0
|
56 |
#if U_CHARSET_FAMILY==U_ASCII_FAMILY
|
sl@0
|
57 |
# define U_UPPER_ORDINAL(x) ((x)-'A')
|
sl@0
|
58 |
#elif U_CHARSET_FAMILY==U_EBCDIC_FAMILY
|
sl@0
|
59 |
# define U_UPPER_ORDINAL(x) (((x) < 'J') ? ((x)-'A') : \
|
sl@0
|
60 |
(((x) < 'S') ? ((x)-'J'+9) : \
|
sl@0
|
61 |
((x)-'S'+18)))
|
sl@0
|
62 |
#else
|
sl@0
|
63 |
# error Unknown charset family!
|
sl@0
|
64 |
#endif
|
sl@0
|
65 |
|
sl@0
|
66 |
#endif
|