/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <errno.h>
#include <jni.h>
#include <pool.h>
#include <stdlib.h>
#include <string.h>
#include "jpool.h"
struct pool_callback {
};
static void throwException(JNIEnv *, const char *, const char *);
pool_value_t *, void *);
/*
* Cached class, method, and field IDs.
*/
/*
* Throw an exception of the specified class with the specified message.
*/
void
{
}
/*
* Throw a PoolsException.
*/
void
{
}
/*
* Return an instance of an UnsignedInt64 class which encapsulates the
* supplied value.
*/
{
int i;
return (NULL); /* OutOfMemoryError thrown */
return (NULL); /* OutOfMemoryError thrown */
/*
* Interpret the uint64_t as a 9-byte big-endian signed quantity
* suitable for constructing an UnsignedInt64 or BigInteger.
*/
for (i = 8; i >= 1; i--) {
value >>= 8;
}
bytes[0] = 0;
byteArray)))
return (NULL); /* exception thrown */
return (valueObj);
}
/*
* Create an array list and then copy the native array into it
*/
{
int i;
if (nativeArray != NULL) {
for (i = 0; nativeArray[i] != NULL; i++) {
jobject L;
/* Build longs and add them */
}
}
return (jresult);
}
/*
* pool_version(3pool) wrapper
*/
/*ARGSUSED*/
}
/*
* native constant accessor
*/
/*ARGSUSED*/
return ((jint)POX_NATIVE);
}
/*
* native constant accessor
*/
/*ARGSUSED*/
}
/*
* native constant accessor
*/
/*ARGSUSED*/
}
/*
* native constant accessor
*/
/*ARGSUSED*/
}
/*
* native constant accessor
*/
/*ARGSUSED*/
}
/*
* native constant accessor
*/
/*ARGSUSED*/
return ((jint)POC_DOUBLE);
}
/*
* native constant accessor
*/
/*ARGSUSED*/
}
/*
* native constant accessor
*/
/*ARGSUSED*/
return ((jint)POC_STRING);
}
/*
* native constant accessor
*/
/*ARGSUSED*/
}
/*
* native constant accessor
*/
/*ARGSUSED*/
}
/*
* native constant accessor
*/
/*ARGSUSED*/
return ((jint)POV_STRICT);
}
/*
* native constant accessor
*/
/*ARGSUSED*/
return ((jint)POV_RUNTIME);
}
/*
* native constant accessor
*/
/*ARGSUSED*/
return ((jint)POF_INVALID);
}
/*
* native constant accessor
*/
/*ARGSUSED*/
}
/*
* native constant accessor
*/
/*ARGSUSED*/
return ((jint)POF_DESTROY);
}
/*
* pool_error(3pool) wrapper
*/
/*ARGSUSED*/
return ((jint)pool_error());
}
/*
* pool_strerror(3pool) wrapper
*/
/*ARGSUSED*/
char *result;
if (result)
return (jresult);
}
/*
* strerror(3c) wrapper
*/
/*ARGSUSED*/
char *result;
if (result)
return (jresult);
}
/*
* errno(3c) accessor
*/
/*ARGSUSED*/
}
/*
* pool_resource_type_list(3pool) wrapper
*/
/*ARGSUSED*/
}
/*
* pool_get_status(3pool) wrapper
*/
/*ARGSUSED*/
int status;
int err;
if (err == -1)
else
}
/*
* pool_set_status(3pool) wrapper
*/
/*ARGSUSED*/
}
/*
* pool_conf_alloc(3pool) wrapper
*/
/*ARGSUSED*/
}
/*
* pool_conf_free(3pool) wrapper
*/
/*ARGSUSED*/
}
/*
* pool_conf_status(3pool) wrapper
*/
/*ARGSUSED*/
}
/*
* pool_conf_close(3pool) wrapper
*/
/*ARGSUSED*/
}
/*
* pool_conf_remove(3pool) wrapper
*/
/*ARGSUSED*/
}
/*
* pool_conf_open(3pool) wrapper
*/
/*ARGSUSED*/
const char *location;
int result;
(int)jflags);
if (location)
}
/*
* pool_conf_rollback(3pool) wrapper
*/
/*ARGSUSED*/
}
/*
* pool_conf_commit(3pool) wrapper
*/
/*ARGSUSED*/
return ((jint)pool_conf_commit(
}
/*
* pool_conf_export(3pool) wrapper
*/
/*ARGSUSED*/
const char *location;
int result;
if (location)
}
/*
* pool_conf_validate(3pool) wrapper
*/
/*ARGSUSED*/
}
/*
* pool_conf_update(3pool) wrapper
*/
/*ARGSUSED*/
int changed;
int result;
if (result != PO_SUCCESS) {
}
}
/*
* pool_get_pool(3pool) wrapper
*/
/*ARGSUSED*/
const char *name;
NULL;
if (name)
}
/*
* pool_query_pools(3pool) wrapper
*/
/*ARGSUSED*/
int i;
/*
* Initialize the target parameter for case when input is null
*/
if (size != 0) {
/*
* Allocate space for the props array
*/
== NULL) {
"Could not allocate props array");
return (NULL);
}
/*
* Copy in the array
*/
for (i = 0; i < size; i++) {
"_this", "J");
}
}
}
props);
}
/*
* pool_get_resource(3pool) wrapper
*/
/*ARGSUSED*/
const char *type;
const char *name;
NULL;
NULL;
if (type)
if (name)
}
/*
* pool_query_resources(3pool) wrapper
*/
/*ARGSUSED*/
int i;
/*
* Initialize the target parameter for case when input is null
*/
if (size != 0) {
/*
* Allocate space for the props array
*/
== NULL) {
"Could not allocate props array");
return (NULL);
}
/*
* Copy in the array
*/
for (i = 0; i < size; i++) {
"_this", "J");
}
}
}
props);
}
/*
* pool_query_components(3pool) wrapper
*/
/*ARGSUSED*/
int i;
/*
* Initialize the target parameter for case when input is null
*/
if (size != 0) {
/*
* Allocate space for the props array
*/
== NULL) {
"Could not allocate props array");
return (NULL);
}
/*
* Copy in the array
*/
for (i = 0; i < size; i++) {
"_this", "J");
}
}
}
props);
}
/*
* pool_conf_location(3pool) wrapper
*/
/*ARGSUSED*/
const char *result;
if (result)
return (jresult);
}
/*
* pool_conf_info(3pool) wrapper
*/
/*ARGSUSED*/
const char *result;
if (result)
return (jresult);
}
/*
* pool_resource_create(3pool) wrapper
*/
/*ARGSUSED*/
const char *type;
const char *name;
NULL;
NULL;
result =
if (type)
if (name)
}
/*
* pool_resource_destroy(3pool) wrapper
*/
/*ARGSUSED*/
}
/*
* pool_resource_transfer(3pool) wrapper
*/
/*ARGSUSED*/
}
/*
* pool_resource_xtransfer(3pool) wrapper
*/
/*ARGSUSED*/
int result;
/*
* Initialize the target parameter for case when input is null
*/
components = NULL;
if (jcomponents != NULL) {
if (size != 0) {
int i;
/* Allocate space for the components array */
sizeof (pool_component_t *))) == NULL) {
"Could not allocate component array");
return (NULL);
}
/*
* Copy in the array
*/
for (i = 0; i < size; i++) {
aVal);
components[i] =
}
}
}
}
/*
* pool_query_resource_components(3pool) wrapper
*/
/*ARGSUSED*/
/*
* Initialize the target parameter for case when input is null
*/
if (size != 0) {
int i;
/*
* Allocate space for the props array
*/
== NULL) {
"Could not allocate props array");
return (NULL);
}
/*
* Copy in the array
*/
for (i = 0; i < size; i++) {
"_this", "J");
}
}
}
}
/*
* pool_resource_info(3pool) wrapper
*/
/*ARGSUSED*/
const char *result;
if (result)
return (jresult);
}
/*
* pool_create(3pool) wrapper
*/
/*ARGSUSED*/
const char *name;
NULL;
if (name)
}
/*
* pool_destroy(3pool) wrapper
*/
/*ARGSUSED*/
}
/*
* pool_associate(3pool) wrapper
*/
/*ARGSUSED*/
}
/*
* pool_dissociate(3pool) wrapper
*/
/*ARGSUSED*/
}
/*
* pool_info(3pool) wrapper
*/
/*ARGSUSED*/
const char *result;
if (result)
return (jresult);
}
/*
* pool_query_pool_resources(3pool) wrapper
*/
/*ARGSUSED*/
/*
* Initialize the target parameter for case when input is null
*/
if (size != 0) {
int i;
/*
* Allocate space for the props array
*/
== NULL) {
"Could not allocate props array");
return (NULL);
}
/*
* Copy in the array
*/
for (i = 0; i < size; i++) {
"_this", "J");
}
}
}
}
/*
* pool_get_owning_resource(3pool) wrapper
*/
/*ARGSUSED*/
}
/*
* pool_component_info(3pool) wrapper
*/
/*ARGSUSED*/
const char *result;
if (result)
return (jresult);
}
/*
* pool_get_property(3pool) wrapper
*/
/*ARGSUSED*/
const char *name;
int result;
NULL;
if (name)
}
/*
* pool_put_property(3pool) wrapper
*/
/*ARGSUSED*/
const char *name;
int result;
if (name)
}
/*
* pool_rm_property(3pool) wrapper
*/
/*ARGSUSED*/
const char *name;
int result;
if (name)
}
/*
* pool_walk_properties(3pool) wrapper
*/
/*ARGSUSED*/
int result;
(int (*)(pool_conf_t *, pool_elem_t *, char const *,
}
/*
* pool_conf_to_elem(3pool) wrapper
*/
/*ARGSUSED*/
}
/*
* pool_to_elem(3pool) wrapper
*/
/*ARGSUSED*/
}
/*
* pool_resource_to_elem(3pool) wrapper
*/
/*ARGSUSED*/
}
/*
* pool_component_to_elem(3pool) wrapper
*/
/*ARGSUSED*/
}
/*
* pool_value_get_type(3pool) wrapper
*/
/*ARGSUSED*/
}
/*
* pool_value_set_uint64(3pool) wrapper
*/
/*ARGSUSED*/
}
/*
* pool_value_set_int64(3pool) wrapper
*/
/*ARGSUSED*/
}
/*
* pool_value_set_double(3pool) wrapper
*/
/*ARGSUSED*/
}
/*
* pool_value_set_bool(3pool) wrapper
*/
/*ARGSUSED*/
}
/*
* pool_value_set_string(3pool) wrapper
*/
/*ARGSUSED*/
const char *str;
int result;
if (str)
}
/*
* pool_value_get_name(3pool) wrapper
*/
/*ARGSUSED*/
const char *result;
if (result)
return (jresult);
}
/*
* pool_value_set_name(3pool) wrapper
*/
/*ARGSUSED*/
const char *name;
int result;
if (name)
}
/*
* pool_value_alloc(3pool) wrapper
*/
/*ARGSUSED*/
}
/*
* pool_value_free(3pool) wrapper
*/
/*ARGSUSED*/
}
/*
* pool_static_location(3pool) wrapper
*/
/*ARGSUSED*/
const char *result;
if (result)
return (jresult);
}
/*
* pool_dynamic_location(3pool) wrapper
*/
/*ARGSUSED*/
const char *result;
if (result)
return (jresult);
}
/*
* pool_set_binding(3pool) wrapper
*/
/*ARGSUSED*/
const char *pool;
int result;
if (pool)
}
/*
* pool_get_binding(3pool) wrapper
*/
/*ARGSUSED*/
const char *result;
if (result)
return (jresult);
}
/*
* pool_get_resource_binding(3pool) wrapper
*/
/*ARGSUSED*/
const char *type;
const char *result;
if (result)
if (type)
return (jresult);
}
/*
* pool_walk_pools(3pool) wrapper
*/
/*ARGSUSED*/
int result;
}
/*
* pool_walk_resources(3pool) wrapper
*/
/*ARGSUSED*/
int result;
(int (*)(pool_conf_t *, pool_resource_t *, void *))
}
/*
* pool_walk_components(3pool) wrapper
*/
/*ARGSUSED*/
int result;
(int (*)(pool_conf_t *, pool_component_t *, void *))
}
/*ARGSUSED*/
{
}
/*ARGSUSED*/
static int
{
double dval;
const char *sval;
/*
* Since we intend to embed our value into a Java Value object
* and then reclaim the value when the object is garbage
* collected we must create a new pool value and then pass this
* to the constructor. We must not use the pool value which is
* passed to us.
*/
return (PO_FAIL);
switch (pool_value_get_type(pv)) {
case POC_UINT:
break;
case POC_INT:
break;
case POC_DOUBLE:
break;
case POC_BOOL:
break;
case POC_STRING:
break;
default:
return (PO_FAIL);
}
== NULL ||
clazz, "walk",
return (PO_FAIL);
}
/*ARGSUSED*/
{
int result;
result =
result =
if (result != PO_SUCCESS) {
}
/*
* Unfortunately, Java has no unsigned types, so we lose some
* precision by forcing the top bit clear
*/
arg2 &= 0x7fffffffffffffffULL;
}
}
/*ARGSUSED*/
{
const char *arg2;
int result;
result =
if (result != PO_SUCCESS)
}
/*ARGSUSED*/
{
int result;
if (result != PO_SUCCESS) {
}
return (JNI_TRUE);
else
return (JNI_FALSE);
}
/*ARGSUSED*/
{
double arg2;
int result;
result =
if (result != PO_SUCCESS) {
}
}
/*ARGSUSED*/
{
int result;
result =
if (result != PO_SUCCESS) {
}
}
/*ARGSUSED*/
{
}
/*
* Cache class, method, and field IDs.
*/
/*ARGSUSED*/
{
return; /* exception thrown */
return; /* exception thrown */
}