rtxUnicode.h File Reference

This is an open source header file derived from the libxml2 project. More...

#include <stdio.h>
#include "rtxsrc/rtxContext.h"

Go to the source code of this file.


Defines

#define OS_IS_CHAR(c)
#define OS_IS_BLANK(c)   (((c) == 0x20) || ((c) == 0x09) || ((c) == 0xA) || ((c) == 0x0D))
#define OS_IS_BASECHAR(c)   rtxUCSIsBaseChar(c)
#define OS_IS_DIGIT(c)   rtxUCSIsDigit(c)
#define OS_IS_COMBINING(c)   rtxUCSIsCombining(c)
#define OS_IS_EXTENDER(c)   rtxUCSIsExtender(c)
#define OS_IS_IDEOGRAPHIC(c)   rtxUCSIsIdeographic(c)
#define OS_IS_LETTER(c)   (IS_BASECHAR(c) || IS_IDEOGRAPHIC(c))
#define OS_IS_PUBIDCHAR(c)   xmlIsPubidChar(c)

Functions

EXTERNRT long rtxUCSToUTF8 (OSCTXT *pctxt, const OSUNICHAR *inbuf, size_t inlen, OSOCTET *outbuf, size_t outbufsiz)
 This function converts a Unicode string into a UTF-8 string.
EXTERNRT const OSUTF8CHAR * rtxUCSToDynUTF8 (OSCTXT *pctxt, const OSUNICHAR *inbuf)
 This function converts a null-terminated Unicode string into a UTF-8 string.
EXTERNRT OSBOOL rtxUCSIsChar (OS32BITCHAR c)
 rtxUCSIsChar:
EXTERNRT OSBOOL rtxUCSIsBlank (OS32BITCHAR c)
 rtxUCSIsBlank:
EXTERNRT OSBOOL rtxUCSIsBaseChar (OS32BITCHAR c)
 rtxUCSIsBaseChar:
EXTERNRT OSBOOL rtxUCSIsDigit (OS32BITCHAR c)
 rtxUCSIsDigit:
EXTERNRT OSBOOL rtxUCSIsCombining (OS32BITCHAR c)
 rtxUCSIsCombining:
EXTERNRT OSBOOL rtxUCSIsExtender (OS32BITCHAR c)
 rtxUCSIsExtender:
EXTERNRT OSBOOL rtxUCSIsIdeographic (OS32BITCHAR c)
 rtxUCSIsIdeographic:
EXTERNRT OSBOOL rtxUCSIsLetter (OS32BITCHAR c)
 rtxUCSIsLetter:
EXTERNRT OSBOOL rtxUCSIsPubidChar (OS32BITCHAR c)
 rtxUCSIsPubidChar:

Detailed Description

This is an open source header file derived from the libxml2 project.

It defines UNICODE data types and macros. See the header file for further details.

Definition in file rtxUnicode.h.


Function Documentation

EXTERNRT OSBOOL rtxUCSIsBaseChar ( OS32BITCHAR  c  ) 

rtxUCSIsBaseChar:

Parameters:
c,: an unicode character (int)
Check whether the character is allowed by the production [85] BaseChar ::= ... long list see REC ...

Returns 0 if not, non-zero otherwise

EXTERNRT OSBOOL rtxUCSIsBlank ( OS32BITCHAR  c  ) 

rtxUCSIsBlank:

Parameters:
c,: a UNICODE character (int)
Check whether the character is allowed by the production [3] S ::= (#x20 | #x9 | #xD | #xA)+ Also available as a macro IS_BLANK()

Returns 0 if not, non-zero otherwise

EXTERNRT OSBOOL rtxUCSIsChar ( OS32BITCHAR  c  ) 

rtxUCSIsChar:

Parameters:
c,: an unicode character (int)
Check whether the character is allowed by the production [2] Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF] any Unicode character, excluding the surrogate blocks, FFFE, and FFFF. Also available as a macro IS_CHAR()

Returns 0 if not, non-zero otherwise

EXTERNRT OSBOOL rtxUCSIsCombining ( OS32BITCHAR  c  ) 

rtxUCSIsCombining:

Parameters:
c,: an unicode character (int)
Check whether the character is allowed by the production [87] CombiningChar ::= ... long list see REC ...

Returns 0 if not, non-zero otherwise

EXTERNRT OSBOOL rtxUCSIsDigit ( OS32BITCHAR  c  ) 

rtxUCSIsDigit:

Parameters:
c,: an unicode character (int)
Check whether the character is allowed by the production [88] Digit ::= ... long list see REC ...

Returns 0 if not, non-zero otherwise

EXTERNRT OSBOOL rtxUCSIsExtender ( OS32BITCHAR  c  ) 

rtxUCSIsExtender:

Parameters:
c,: an unicode character (int)
Check whether the character is allowed by the production [89] Extender ::= #x00B7 | #x02D0 | #x02D1 | #x0387 | #x0640 | #x0E46 | #x0EC6 | #x3005 | [#x3031-#x3035] | [#x309D-#x309E] | [#x30FC-#x30FE]

Returns 0 if not, non-zero otherwise

EXTERNRT OSBOOL rtxUCSIsIdeographic ( OS32BITCHAR  c  ) 

rtxUCSIsIdeographic:

Parameters:
c,: an unicode character (int)
Check whether the character is allowed by the production [86] Ideographic ::= [#x4E00-#x9FA5] | #x3007 | [#x3021-#x3029]

Returns 0 if not, non-zero otherwise

EXTERNRT OSBOOL rtxUCSIsLetter ( OS32BITCHAR  c  ) 

rtxUCSIsLetter:

Parameters:
c,: an unicode character (int)
Check whether the character is allowed by the production [84] Letter ::= BaseChar | Ideographic

Returns 0 if not, non-zero otherwise

EXTERNRT OSBOOL rtxUCSIsPubidChar ( OS32BITCHAR  c  ) 

rtxUCSIsPubidChar:

Parameters:
c,: an unicode character (int)
Check whether the character is allowed by the production [13] PubidChar ::= #x20 | #xD | #xA | [a-zA-Z0-9] | [-'()+,./:=?;!*#@$_%]

Returns 0 if not, non-zero otherwise

EXTERNRT const OSUTF8CHAR* rtxUCSToDynUTF8 ( OSCTXT pctxt,
const OSUNICHAR *  inbuf 
)

This function converts a null-terminated Unicode string into a UTF-8 string.

Memory is allocated for the output string using the built-in memory management functions.

Parameters:
pctxt Pointer to context structure.
inbuf Null-terminated Unicode string to convert.
Returns:
Converted UTF-8 character string.

EXTERNRT long rtxUCSToUTF8 ( OSCTXT pctxt,
const OSUNICHAR *  inbuf,
size_t  inlen,
OSOCTET *  outbuf,
size_t  outbufsiz 
)

This function converts a Unicode string into a UTF-8 string.

A buffer large enough to hold the converted UTF-8 characters must be provided. A buffer providing 4 bytes-per-character should be large enough to hold the largest possible UTF-8 conversion. The output UTF-8 string is null-terminated.

Parameters:
pctxt Pointer to context structure.
inbuf Unicode string to convert. Does not need to be null-terminated.
inlen Number of characters in inbuf.
outbuf Buffer to hold converted string.
outbufsiz Size of output buffer.
Returns:
Total number of bytes in converted string or a negative status code if error.