sl@0: /*
sl@0: *******************************************************************************
sl@0: *
sl@0: *   Copyright (C) 1999-2004, International Business Machines
sl@0: *   Corporation and others.  All Rights Reserved.
sl@0: *
sl@0: *******************************************************************************
sl@0: *   file name:  uinvchar.h
sl@0: *   encoding:   US-ASCII
sl@0: *   tab size:   8 (not used)
sl@0: *   indentation:2
sl@0: *
sl@0: *   created on: 2004sep14
sl@0: *   created by: Markus W. Scherer
sl@0: *
sl@0: *   Definitions for handling invariant characters, moved here from putil.c
sl@0: *   for better modularization.
sl@0: */
sl@0: 
sl@0: #ifndef __UINVCHAR_H__
sl@0: #define __UINVCHAR_H__
sl@0: 
sl@0: #include "unicode/utypes.h"
sl@0: 
sl@0: /**
sl@0:  * Check if a char string only contains invariant characters.
sl@0:  * See utypes.h for details.
sl@0:  *
sl@0:  * @param s Input string pointer.
sl@0:  * @param length Length of the string, can be -1 if NUL-terminated.
sl@0:  * @return TRUE if s contains only invariant characters.
sl@0:  *
sl@0:  * @internal (ICU 2.8)
sl@0:  */
sl@0: U_INTERNAL UBool U_EXPORT2
sl@0: uprv_isInvariantString(const char *s, int32_t length);
sl@0: 
sl@0: /**
sl@0:  * Check if a Unicode string only contains invariant characters.
sl@0:  * See utypes.h for details.
sl@0:  *
sl@0:  * @param s Input string pointer.
sl@0:  * @param length Length of the string, can be -1 if NUL-terminated.
sl@0:  * @return TRUE if s contains only invariant characters.
sl@0:  *
sl@0:  * @internal (ICU 2.8)
sl@0:  */
sl@0: U_INTERNAL UBool U_EXPORT2
sl@0: uprv_isInvariantUString(const UChar *s, int32_t length);
sl@0: 
sl@0: /**
sl@0:  * \def U_UPPER_ORDINAL
sl@0:  * Get the ordinal number of an uppercase invariant character
sl@0:  * @internal
sl@0:  */
sl@0: #if U_CHARSET_FAMILY==U_ASCII_FAMILY
sl@0: #   define U_UPPER_ORDINAL(x) ((x)-'A')
sl@0: #elif U_CHARSET_FAMILY==U_EBCDIC_FAMILY
sl@0: #   define U_UPPER_ORDINAL(x) (((x) < 'J') ? ((x)-'A') : \
sl@0:                               (((x) < 'S') ? ((x)-'J'+9) : \
sl@0:                                ((x)-'S'+18)))
sl@0: #else
sl@0: #   error Unknown charset family!
sl@0: #endif
sl@0: 
sl@0: #endif