Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/npt/npt.h
38767 views
/*1* Copyright (c) 2004, 2013, 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/* Native Platform Toolkit */2627#ifndef _NPT_H28#define _NPT_H2930#define NPT_VERSION "0.0.0"3132#include <stdio.h>3334#include "jni.h"3536#include "npt_md.h"37#include "utf.h"3839#define NPT_ERROR(s) { (void)fprintf(stderr, "NPT ERROR: %s\n", s); exit(1); }4041#ifdef __cplusplus42extern "C" {43#endif4445typedef struct {4647/* Used to save handle to our own dynamicly loaded library */48void *libhandle;4950/* Copy of the options sent in at initialization */51char *options;5253/* Can be used to save the UtfInst handle */54struct UtfInst *utf;5556/* UTF interfaces, see utf.c */57struct UtfInst* (JNICALL *utfInitialize)58(char *options);59void (JNICALL *utfTerminate)60(struct UtfInst *utf, char *options);61int (JNICALL *utf8ToPlatform)62(struct UtfInst *utf, jbyte *utf8, int len,63char *output, int outputMaxLen);64int (JNICALL *utf8FromPlatform)65(struct UtfInst *utf, char *str, int len,66jbyte *output, int outputMaxLen);67int (JNICALL *utf8ToUtf16)68(struct UtfInst *utf, jbyte *utf8, int len,69jchar *output, int outputMaxLen);70int (JNICALL *utf16ToUtf8m)71(struct UtfInst *utf, jchar *utf16, int len,72jbyte *output, int outputMaxLen);73int (JNICALL *utf16ToUtf8s)74(struct UtfInst *utf, jchar *utf16, int len,75jbyte *output, int outputMaxLen);76int (JNICALL *utf8sToUtf8mLength)77(struct UtfInst *utf, jbyte *string, int length);78void (JNICALL *utf8sToUtf8m)79(struct UtfInst *utf, jbyte *string, int length,80jbyte *newString, int newLength);81int (JNICALL *utf8mToUtf8sLength)82(struct UtfInst *utf, jbyte *string, int length);83void (JNICALL *utf8mToUtf8s)84(struct UtfInst *utf, jbyte *string, int length,85jbyte *newString, int newLength);8687} NptEnv;8889/* Typedefs for the only 2 'extern' functions in npt library:90* nptInitialize and nptTerminate91* See NPT_INITIALIZE() and NPT_TERMINATE() in npt_md.h.92*/9394JNIEXPORT void JNICALL nptInitialize95(NptEnv **pnpt, char *nptVersion, char *options);96typedef void (JNICALL *NptInitialize)97(NptEnv **pnpt, char *nptVersion, char *options);9899JNIEXPORT void JNICALL nptTerminate100(NptEnv* npt, char *options);101typedef void (JNICALL *NptTerminate)102(NptEnv* npt, char *options);103104#ifdef __cplusplus105} /* extern "C" */106#endif /* __cplusplus */107108#endif109110111