Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/npt/utf.h
38767 views
/*1* Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425/* Routines for various UTF conversions */2627#ifndef _UTF_H28#define _UTF_H2930#include <stdio.h>3132#include "jni.h"33#include "utf_md.h"3435/* Use THIS_FILE when it is available. */36#ifndef THIS_FILE37#define THIS_FILE __FILE__38#endif3940/* Error and assert macros */41#define UTF_ERROR(m) utfError(THIS_FILE, __LINE__, m)42#define UTF_ASSERT(x) ( (x)==0 ? UTF_ERROR("ASSERT ERROR " #x) : (void)0 )4344void utfError(char *file, int line, char *message);4546struct UtfInst* JNICALL utfInitialize47(char *options);48void JNICALL utfTerminate49(struct UtfInst *ui, char *options);50int JNICALL utf8ToPlatform51(struct UtfInst *ui, jbyte *utf8,52int len, char *output, int outputMaxLen);53int JNICALL utf8FromPlatform54(struct UtfInst *ui, char *str, int len,55jbyte *output, int outputMaxLen);56int JNICALL utf8ToUtf1657(struct UtfInst *ui, jbyte *utf8, int len,58jchar *output, int outputMaxLen);59int JNICALL utf16ToUtf8m60(struct UtfInst *ui, jchar *utf16, int len,61jbyte *output, int outputMaxLen);62int JNICALL utf16ToUtf8s63(struct UtfInst *ui, jchar *utf16, int len,64jbyte *output, int outputMaxLen);65int JNICALL utf8sToUtf8mLength66(struct UtfInst *ui, jbyte *string, int length);67void JNICALL utf8sToUtf8m68(struct UtfInst *ui, jbyte *string, int length,69jbyte *new_string, int new_length);70int JNICALL utf8mToUtf8sLength71(struct UtfInst *ui, jbyte *string, int length);72void JNICALL utf8mToUtf8s73(struct UtfInst *ui, jbyte *string, int length,74jbyte *new_string, int new_length);7576#endif777879