Main Page | Namespace List | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

unicode.c File Reference


Detailed Description

Manipulate Unicode (jchar)[] character strings.

There are three character string types in this program: null-terminated (rchar) strings ala 'C' language, UTF-8 (CONSTANT_Utf8_info) strings, and Unicode (jchar)[] strings.

Unicode (jchar) character utilities that do not involve UTF8.

ALL referenced to type (jchar) involve Unicode characters throughout all of the code. Manipulations of them should take place only through these utilities.

Control

$URL: https://svn.apache.org/path/name/unicode.c $ $Id: unicode.c 0 09/28/2005 dlydick $

Copyright 2005 The Apache Software Foundation or its licensors, as applicable.

Licensed under the Apache License, Version 2.0 ("the License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

See the License for the specific language governing permissions and limitations under the License.

Version:
$LastChangedRevision: 0 $
Date:
$LastChangedDate: 09/28/2005 $
Author:
$LastChangedBy: dlydick $ Original code contributed by Daniel Lydick on 09/28/2005.

Reference

Definition in file unicode.c.

#include "arch.h"
#include <string.h>
#include "jvmcfg.h"
#include "cfmacros.h"
#include "classfile.h"

Go to the source code of this file.

Functions

static void unicode_c_dummy (void)
cp_info_dupunicode_cnv2utf (jchar *inbfr, jshort length)
jshort unicode_strcmp (jchar *s1, u2 l1, jchar *s2, u2 l2)
 Compare two Unicode strings of any length, s1 minus s2.

Variables

static char * unicode_c_copyright = "\0" "$URL: https://svn.apache.org/path/name/unicode.c $ $Id: unicode.c 0 09/28/2005 dlydick $" " " "Copyright 2005 The Apache Software Foundation or its licensors, as applicable."


Function Documentation

static void unicode_c_dummy void   )  [static]
 

Definition at line 54 of file unicode.c.

cp_info_dup* unicode_cnv2utf jchar inbfr,
jshort  length
 

< '\u0001', UTF-8 representation

< '\u007f', UTF-8 representation

< '\u0080', Unicode representation

< '\u07ff', Unicode representation

< '\u0000', Unicode representation

< '\u0001', UTF-8 representation

< '\u007f', UTF-8 representation

< Bits 0-6 contain data (except != 0, or NUL)

< '\u0080', Unicode representation

< '\u07ff', Unicode representation

< '\u0000', Unicode representation

< Move first byte up to bits 10-6

< Bottom 5 bits contain data bits 10-6

< Top 3 bits are '110'

< Bottom 6 bits contain data bits 0-5

< Top 2 bits are '10'

! Move first byte up to bits 15-12

! Bottom 5 bits contain data bits 15-12

! Top 4 bits are '1110'

! Move second byte up to bits 10-6

! Bottom 6 bits contain data bits 11-6

! Top 2 bits are '10'

! Bottom 6 bits contain data bits 5-0

! Top 2 bits are '10'

Definition at line 91 of file unicode.c.

References CONSTANT_Utf8_info::bytes, CONSTANT_Utf8, HEAP_GET_DATA, CONSTANT_Utf8_info::length, PTR_THIS_CP_Utf8, rfalse, CONSTANT_Utf8_info::tag, UNICODE_DOUBLE_MAX, UNICODE_DOUBLE_MIN, UNICODE_DOUBLE_NUL, UTF8_DOUBLE_FIRST_MASK0, UTF8_DOUBLE_FIRST_SHIFT, UTF8_DOUBLE_FIRST_VAL, UTF8_DOUBLE_SECOND_MASK0, UTF8_DOUBLE_SECOND_VAL, UTF8_SINGLE_MASK0, UTF8_SINGLE_MAX, UTF8_SINGLE_MIN, UTF8_TRIPLE_FIRST_MASK0, UTF8_TRIPLE_FIRST_SHIFT, UTF8_TRIPLE_FIRST_VAL, UTF8_TRIPLE_SECOND_MASK0, UTF8_TRIPLE_SECOND_SHIFT, UTF8_TRIPLE_SECOND_VAL, UTF8_TRIPLE_THIRD_MASK0, and UTF8_TRIPLE_THIRD_VAL.

jshort unicode_strcmp jchar s1,
u2  l1,
jchar s2,
u2  l2
 

Compare two Unicode strings of any length, s1 minus s2.

Parameters:
s1 First string to compare
l1 Length of first string
s2 Second string to compare
l2 Length of second string
Returns:
lexicographical difference of s1 - s2. Notice that the (jchar) data is unsigned, the (jshort) result is signed, due to the arithmetic nature of the calculation.

Definition at line 269 of file unicode.c.


Variable Documentation

char* unicode_c_copyright = "\0" "$URL: https://svn.apache.org/path/name/unicode.c $ $Id: unicode.c 0 09/28/2005 dlydick $" " " "Copyright 2005 The Apache Software Foundation or its licensors, as applicable." [static]
 

Definition at line 54 of file unicode.c.


Generated on Fri Sep 30 18:50:35 2005 by  doxygen 1.4.4