0N/A/*
2362N/A * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
2362N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
2362N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
0N/A */
0N/A
0N/A/* Native Platform Toolkit */
0N/A
0N/A#ifndef _NPT_H
0N/A#define _NPT_H
0N/A
0N/A#define NPT_VERSION "0.0.0"
0N/A
0N/A#include <stdio.h>
0N/A
0N/A#include "jni.h"
0N/A
0N/A#include "npt_md.h"
0N/A#include "utf.h"
0N/A
0N/A#define NPT_ERROR(s) { (void)fprintf(stderr, "NPT ERROR: %s\n", s); exit(1); }
0N/A
0N/A#ifdef __cplusplus
0N/Aextern "C" {
0N/A#endif
0N/A
0N/Atypedef struct {
0N/A
0N/A /* Used to save handle to our own dynamicly loaded library */
0N/A void *libhandle;
0N/A
0N/A /* Copy of the options sent in at initialization */
0N/A char *options;
0N/A
0N/A /* Can be used to save the UtfInst handle */
0N/A struct UtfInst *utf;
0N/A
0N/A /* UTF interfaces, see utf.c */
0N/A struct UtfInst* (JNICALL *utfInitialize)
0N/A (char *options);
0N/A void (JNICALL *utfTerminate)
0N/A (struct UtfInst *utf, char *options);
0N/A int (JNICALL *utf8ToPlatform)
0N/A (struct UtfInst *utf, jbyte *utf8, int len,
0N/A char *output, int outputMaxLen);
0N/A int (JNICALL *utf8FromPlatform)
0N/A (struct UtfInst *utf, char *str, int len,
0N/A jbyte *output, int outputMaxLen);
0N/A int (JNICALL *utf8ToUtf16)
0N/A (struct UtfInst *utf, jbyte *utf8, int len,
0N/A jchar *output, int outputMaxLen);
0N/A int (JNICALL *utf16ToUtf8m)
0N/A (struct UtfInst *utf, jchar *utf16, int len,
0N/A jbyte *output, int outputMaxLen);
0N/A int (JNICALL *utf16ToUtf8s)
0N/A (struct UtfInst *utf, jchar *utf16, int len,
0N/A jbyte *output, int outputMaxLen);
0N/A int (JNICALL *utf8sToUtf8mLength)
0N/A (struct UtfInst *utf, jbyte *string, int length);
0N/A void (JNICALL *utf8sToUtf8m)
0N/A (struct UtfInst *utf, jbyte *string, int length,
0N/A jbyte *newString, int newLength);
0N/A int (JNICALL *utf8mToUtf8sLength)
0N/A (struct UtfInst *utf, jbyte *string, int length);
0N/A void (JNICALL *utf8mToUtf8s)
0N/A (struct UtfInst *utf, jbyte *string, int length,
0N/A jbyte *newString, int newLength);
0N/A
0N/A} NptEnv;
0N/A
0N/A/* Typedefs for the only 2 'extern' functions in npt library:
0N/A * nptInitialize and nptTerminate
0N/A * See NPT_INITIALIZE() and NPT_TERMINATE() in npt_md.h.
0N/A */
0N/A
0N/AJNIEXPORT void JNICALL nptInitialize
0N/A (NptEnv **pnpt, char *nptVersion, char *options);
0N/Atypedef JNIEXPORT void (JNICALL *NptInitialize)
0N/A (NptEnv **pnpt, char *nptVersion, char *options);
0N/A
0N/AJNIEXPORT void JNICALL nptTerminate
0N/A (NptEnv* npt, char *options);
0N/Atypedef JNIEXPORT void (JNICALL *NptTerminate)
0N/A (NptEnv* npt, char *options);
0N/A
0N/A#ifdef __cplusplus
0N/A} /* extern "C" */
0N/A#endif /* __cplusplus */
0N/A
0N/A#endif