Done some re-organization of java bindings
This commit is contained in:
74
extras/java/trunk/src/jni/libisofs/IsoExclude.c
Normal file
74
extras/java/trunk/src/jni/libisofs/IsoExclude.c
Normal file
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
* IsoTreeNode.c
|
||||
*
|
||||
* Copyright (c) 2007 Vreixo Formoso
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
* See COPYING file for details.
|
||||
*/
|
||||
|
||||
#include "org_pykix_libburnia_libisofs_IsoExclude.h"
|
||||
|
||||
#include "libisofs.h"
|
||||
|
||||
/*
|
||||
* Class: org_pykix_libburnia_libisofs_IsoExclude
|
||||
* Method: iso_exclude_add_path
|
||||
* Signature: (Ljava/lang/String;)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_org_pykix_libburnia_libisofs_IsoExclude_iso_1exclude_1add_1path
|
||||
(
|
||||
JNIEnv *env, jclass cls, jstring path
|
||||
)
|
||||
{
|
||||
const char *cpath;
|
||||
|
||||
cpath = (*env)->GetStringUTFChars(env, path, NULL);
|
||||
if ( cpath == NULL ) {
|
||||
return; /* OutOfMemoryError already thrown */
|
||||
}
|
||||
|
||||
iso_exclude_add_path(cpath);
|
||||
|
||||
(*env)->ReleaseStringUTFChars(env, path, cpath);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: org_pykix_libburnia_libisofs_IsoExclude
|
||||
* Method: iso_exclude_remove_path
|
||||
* Signature: (Ljava/lang/String;)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_org_pykix_libburnia_libisofs_IsoExclude_iso_1exclude_1remove_1path
|
||||
(
|
||||
JNIEnv *env, jclass cls, jstring path
|
||||
)
|
||||
{
|
||||
const char *cpath;
|
||||
|
||||
cpath = (*env)->GetStringUTFChars(env, path, NULL);
|
||||
if ( cpath == NULL ) {
|
||||
return; /* OutOfMemoryError already thrown */
|
||||
}
|
||||
|
||||
iso_exclude_remove_path(cpath);
|
||||
|
||||
(*env)->ReleaseStringUTFChars(env, path, cpath);
|
||||
}
|
||||
/*
|
||||
* Class: org_pykix_libburnia_libisofs_IsoExclude
|
||||
* Method: iso_exclude_empty
|
||||
* Signature: ()V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_org_pykix_libburnia_libisofs_IsoExclude_iso_1exclude_1empty
|
||||
(
|
||||
JNIEnv *env, jclass cls
|
||||
)
|
||||
{
|
||||
iso_exclude_empty();
|
||||
}
|
131
extras/java/trunk/src/jni/libisofs/IsoTreeNode.c
Normal file
131
extras/java/trunk/src/jni/libisofs/IsoTreeNode.c
Normal file
@@ -0,0 +1,131 @@
|
||||
/*
|
||||
* IsoTreeNode.c
|
||||
*
|
||||
* Copyright (c) 2007 Vreixo Formoso
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
* See COPYING file for details.
|
||||
*/
|
||||
|
||||
#include "org_pykix_libburnia_libisofs_IsoTreeNode.h"
|
||||
|
||||
#include "libisofs.h"
|
||||
|
||||
/*
|
||||
* Class: org_pykix_libburnia_libisofs_IsoTreeNode
|
||||
* Method: iso_tree_add_node
|
||||
* Signature: (JLjava/lang/String;)J
|
||||
*/
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_org_pykix_libburnia_libisofs_IsoTreeNode_iso_1tree_1add_1node
|
||||
(
|
||||
JNIEnv *env, jclass cls, jlong parent, jstring path
|
||||
)
|
||||
{
|
||||
const char *cpath;
|
||||
struct iso_tree_node *node;
|
||||
|
||||
cpath = (*env)->GetStringUTFChars(env, path, NULL);
|
||||
if ( cpath == NULL ) {
|
||||
return 0; /* OutOfMemoryError already thrown */
|
||||
}
|
||||
|
||||
node = iso_tree_add_node( (struct iso_tree_node *) parent, cpath);
|
||||
|
||||
(*env)->ReleaseStringUTFChars(env, path, cpath);
|
||||
|
||||
return (jlong) node;
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: org_pykix_libburnia_libisofs_IsoTreeNode
|
||||
* Method: iso_tree_radd_dir
|
||||
* Signature: (JLjava/lang/String;)J
|
||||
*/
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_org_pykix_libburnia_libisofs_IsoTreeNode_iso_1tree_1radd_1dir
|
||||
(
|
||||
JNIEnv *env, jclass cls, jlong parent, jstring path
|
||||
)
|
||||
{
|
||||
const char *cpath;
|
||||
struct iso_tree_node *node;
|
||||
|
||||
cpath = (*env)->GetStringUTFChars(env, path, NULL);
|
||||
if ( cpath == NULL ) {
|
||||
return 0; /* OutOfMemoryError already thrown */
|
||||
}
|
||||
|
||||
node = iso_tree_radd_dir( (struct iso_tree_node *) parent, cpath);
|
||||
|
||||
(*env)->ReleaseStringUTFChars(env, path, cpath);
|
||||
|
||||
return (jlong) node;
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: org_pykix_libburnia_libisofs_IsoTreeNode
|
||||
* Method: iso_tree_print
|
||||
* Signature: (JI)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_org_pykix_libburnia_libisofs_IsoTreeNode_iso_1tree_1print
|
||||
(
|
||||
JNIEnv *env, jclass cls, jlong root, jint spaces
|
||||
)
|
||||
{
|
||||
iso_tree_print( (const struct iso_tree_node *) root, spaces);
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: org_pykix_libburnia_libisofs_IsoTreeNode
|
||||
* Method: iso_tree_node_set_name
|
||||
* Signature: (JLjava/lang/String;)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_org_pykix_libburnia_libisofs_IsoTreeNode_iso_1tree_1node_1set_1name
|
||||
(
|
||||
JNIEnv *env, jclass cls, jlong file, jstring name
|
||||
)
|
||||
{
|
||||
const char *cname;
|
||||
|
||||
cname = (*env)->GetStringUTFChars(env, name, NULL);
|
||||
if ( cname == NULL ) {
|
||||
return; /* OutOfMemoryError already thrown */
|
||||
}
|
||||
|
||||
iso_tree_node_set_name( (struct iso_tree_node *) file, cname);
|
||||
|
||||
(*env)->ReleaseStringUTFChars(env, name, cname);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: org_pykix_libburnia_libisofs_IsoTreeNode
|
||||
* Method: iso_tree_add_new_dir
|
||||
* Signature: (JLjava/lang/String;)J
|
||||
*/
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_org_pykix_libburnia_libisofs_IsoTreeNode_iso_1tree_1add_1new_1dir
|
||||
(
|
||||
JNIEnv *env, jclass cls, jlong parent, jstring name
|
||||
)
|
||||
{
|
||||
const char *cname;
|
||||
struct iso_tree_node *node;
|
||||
|
||||
cname = (*env)->GetStringUTFChars(env, name, NULL);
|
||||
if ( cname == NULL ) {
|
||||
return; /* OutOfMemoryError already thrown */
|
||||
}
|
||||
|
||||
node = iso_tree_add_new_dir( (struct iso_tree_node *) parent, cname);
|
||||
|
||||
(*env)->ReleaseStringUTFChars(env, name, cname);
|
||||
|
||||
return (jlong) node;
|
||||
}
|
55
extras/java/trunk/src/jni/libisofs/IsoVolSet.c
Normal file
55
extras/java/trunk/src/jni/libisofs/IsoVolSet.c
Normal file
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* IsoVolSet.c
|
||||
*
|
||||
* Copyright (c) 2007 Vreixo Formoso
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
* See COPYING file for details.
|
||||
*/
|
||||
|
||||
#include "org_pykix_libburnia_libisofs_IsoVolSet.h"
|
||||
|
||||
#include "libisofs.h"
|
||||
|
||||
/*
|
||||
* Class: org_pykix_libburnia_libisofs_IsoVolSet
|
||||
* Method: iso_volset_free
|
||||
* Signature: (J)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_org_pykix_libburnia_libisofs_IsoVolSet_iso_1volset_1free
|
||||
(
|
||||
JNIEnv *env, jclass cls, jlong volume
|
||||
)
|
||||
{
|
||||
iso_volset_free( (struct iso_volset *) volume);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: org_pykix_libburnia_libisofs_IsoVolSet
|
||||
* Method: iso_volset_new
|
||||
* Signature: (JLjava/lang/String;)J
|
||||
*/
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_org_pykix_libburnia_libisofs_IsoVolSet_iso_1volset_1new
|
||||
(
|
||||
JNIEnv *env, jclass cls, jlong volume, jstring volsetId
|
||||
)
|
||||
{
|
||||
const char *volset_id;
|
||||
struct iso_volset *volset;
|
||||
|
||||
volset_id = (*env)->GetStringUTFChars(env, volsetId, NULL);
|
||||
if ( volset_id == NULL ) {
|
||||
return (jlong) 0; /* OutOfMemoryError already thrown */
|
||||
}
|
||||
|
||||
volset = iso_volset_new( (struct iso_volume *) volume, volset_id);
|
||||
|
||||
(*env)->ReleaseStringUTFChars(env, volsetId, volset_id);
|
||||
|
||||
return (jlong) volset;
|
||||
}
|
292
extras/java/trunk/src/jni/libisofs/IsoVolume.c
Normal file
292
extras/java/trunk/src/jni/libisofs/IsoVolume.c
Normal file
@@ -0,0 +1,292 @@
|
||||
/*
|
||||
* IsoVolume.c
|
||||
*
|
||||
* Copyright (c) 2007 Vreixo Formoso
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
* See COPYING file for details.
|
||||
*/
|
||||
|
||||
#include "org_pykix_libburnia_libisofs_IsoVolume.h"
|
||||
|
||||
#include "libisofs.h"
|
||||
|
||||
/*
|
||||
* Class: org_pykix_libburnia_libisofs_IsoVolume
|
||||
* Method: iso_volume_new
|
||||
* Signature: (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)J
|
||||
*/
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_org_pykix_libburnia_libisofs_IsoVolume_iso_1volume_1new
|
||||
(
|
||||
JNIEnv *env,
|
||||
jclass cls,
|
||||
jstring volumeId,
|
||||
jstring publisherId,
|
||||
jstring dataPreparerId
|
||||
)
|
||||
{
|
||||
const char *volume_id = NULL;
|
||||
const char *publisher_id = NULL;
|
||||
const char *data_preparer_id = NULL;
|
||||
|
||||
if ( volumeId != NULL ) {
|
||||
volume_id = (*env)->GetStringUTFChars(env, volumeId, NULL);
|
||||
if ( volume_id == NULL ) {
|
||||
return (jlong) 0; /* OutOfMemoryError already thrown */
|
||||
}
|
||||
}
|
||||
if ( publisherId != NULL ) {
|
||||
publisher_id = (*env)->GetStringUTFChars(env, publisherId, NULL);
|
||||
if (publisher_id == NULL) {
|
||||
return (jlong) 0; /* OutOfMemoryError already thrown */
|
||||
}
|
||||
}
|
||||
if ( dataPreparerId != NULL ) {
|
||||
data_preparer_id = (*env)->GetStringUTFChars(env, dataPreparerId, NULL);
|
||||
if ( data_preparer_id == NULL ) {
|
||||
return (jlong) 0; /* OutOfMemoryError already thrown */
|
||||
}
|
||||
}
|
||||
|
||||
struct iso_volume *iso = iso_volume_new(volume_id, publisher_id, data_preparer_id);
|
||||
|
||||
(*env)->ReleaseStringUTFChars(env, volumeId, volume_id);
|
||||
(*env)->ReleaseStringUTFChars(env, publisherId, publisher_id);
|
||||
(*env)->ReleaseStringUTFChars(env, dataPreparerId, data_preparer_id);
|
||||
|
||||
return (jlong) iso;
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: org_pykix_libburnia_libisofs_IsoVolume
|
||||
* Method: iso_volume_new_with_root
|
||||
* Signature: (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;J)J
|
||||
*/
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_org_pykix_libburnia_libisofs_IsoVolume_iso_1volume_1new_1with_1root
|
||||
(
|
||||
JNIEnv *env,
|
||||
jclass cls,
|
||||
jstring volumeId,
|
||||
jstring publisherId,
|
||||
jstring dataPreparerId,
|
||||
jlong root
|
||||
)
|
||||
{
|
||||
const char *volume_id = NULL;
|
||||
const char *publisher_id = NULL;
|
||||
const char *data_preparer_id = NULL;
|
||||
struct iso_volume *iso;
|
||||
|
||||
if ( volumeId != NULL ) {
|
||||
volume_id = (*env)->GetStringUTFChars(env, volumeId, NULL);
|
||||
if ( volume_id == NULL ) {
|
||||
return (jlong) 0; /* OutOfMemoryError already thrown */
|
||||
}
|
||||
}
|
||||
if ( publisherId != NULL ) {
|
||||
publisher_id = (*env)->GetStringUTFChars(env, publisherId, NULL);
|
||||
if (publisher_id == NULL) {
|
||||
return (jlong) 0; /* OutOfMemoryError already thrown */
|
||||
}
|
||||
}
|
||||
if ( dataPreparerId != NULL ) {
|
||||
data_preparer_id = (*env)->GetStringUTFChars(env, dataPreparerId, NULL);
|
||||
if ( data_preparer_id == NULL ) {
|
||||
return (jlong) 0; /* OutOfMemoryError already thrown */
|
||||
}
|
||||
}
|
||||
|
||||
iso = iso_volume_new_with_root(volume_id, publisher_id, data_preparer_id,
|
||||
(struct iso_tree_node *) root);
|
||||
|
||||
(*env)->ReleaseStringUTFChars(env, volumeId, volume_id);
|
||||
(*env)->ReleaseStringUTFChars(env, publisherId, publisher_id);
|
||||
(*env)->ReleaseStringUTFChars(env, dataPreparerId, data_preparer_id);
|
||||
|
||||
return (jlong) iso;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Class: org_pykix_libburnia_libisofs_IsoVolume
|
||||
* Method: iso_volume_free
|
||||
* Signature: (J)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_org_pykix_libburnia_libisofs_IsoVolume_iso_1volume_1free
|
||||
(
|
||||
JNIEnv *env, jclass cls, jlong volume
|
||||
)
|
||||
{
|
||||
iso_volume_free( (struct iso_volume *) volume );
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: org_pykix_libburnia_libisofs_IsoVolume
|
||||
* Method: iso_volume_get_root
|
||||
* Signature: (J)J
|
||||
*/
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_org_pykix_libburnia_libisofs_IsoVolume_iso_1volume_1get_1root
|
||||
(
|
||||
JNIEnv *env, jclass cls, jlong volume
|
||||
)
|
||||
{
|
||||
//return (jlong) iso_volume_get_root( (struct iso_volume *) volume );
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: org_pykix_libburnia_libisofs_IsoVolume
|
||||
* Method: iso_volume_set_volume_id
|
||||
* Signature: (JLjava/lang/String;)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_org_pykix_libburnia_libisofs_IsoVolume_iso_1volume_1set_1volume_1id
|
||||
(
|
||||
JNIEnv *env, jclass cls, jlong volume, jstring volumeId
|
||||
)
|
||||
{
|
||||
const char *volume_id;
|
||||
volume_id = (*env)->GetStringUTFChars(env, volumeId, NULL);
|
||||
if ( volume_id == NULL ) {
|
||||
return; /* OutOfMemoryError already thrown */
|
||||
}
|
||||
|
||||
//iso_volume_set_volume_id( (struct iso_volume *) volume, volume_id);
|
||||
|
||||
(*env)->ReleaseStringUTFChars(env, volumeId, volume_id);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: org_pykix_libburnia_libisofs_IsoVolume
|
||||
* Method: iso_volume_set_publisher_id
|
||||
* Signature: (JLjava/lang/String;)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_org_pykix_libburnia_libisofs_IsoVolume_iso_1volume_1set_1publisher_1id
|
||||
(
|
||||
JNIEnv *env, jclass cls, jlong volume, jstring publisherId
|
||||
)
|
||||
{
|
||||
const char *publisher_id;
|
||||
publisher_id = (*env)->GetStringUTFChars(env, publisherId, NULL);
|
||||
if (publisher_id == NULL) {
|
||||
return; /* OutOfMemoryError already thrown */
|
||||
}
|
||||
|
||||
//iso_volume_set_publisher_id( (struct iso_volume *) volume, publisher_id);
|
||||
|
||||
(*env)->ReleaseStringUTFChars(env, publisherId, publisher_id);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: org_pykix_libburnia_libisofs_IsoVolume
|
||||
* Method: iso_volume_set_data_preparer_id
|
||||
* Signature: (JLjava/lang/String;)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_org_pykix_libburnia_libisofs_IsoVolume_iso_1volume_1set_1data_1preparer_1id
|
||||
(
|
||||
JNIEnv *env, jclass cls, jlong volume, jstring dataPreparerId
|
||||
)
|
||||
{
|
||||
const char *data_preparer_id;
|
||||
data_preparer_id = (*env)->GetStringUTFChars(env, dataPreparerId, NULL);
|
||||
if ( data_preparer_id == NULL ) {
|
||||
return; /* OutOfMemoryError already thrown */
|
||||
}
|
||||
|
||||
//iso_volume_set_data_preparer_id( (struct iso_volume *) volume, data_preparer_id);
|
||||
|
||||
(*env)->ReleaseStringUTFChars(env, dataPreparerId, data_preparer_id);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: org_pykix_libburnia_libisofs_IsoVolume
|
||||
* Method: iso_tree_volume_path_to_node
|
||||
* Signature: (JLjava/lang/String;)J
|
||||
*/
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_org_pykix_libburnia_libisofs_IsoVolume_iso_1tree_1volume_1path_1to_1node
|
||||
(
|
||||
JNIEnv *env, jclass cls, jlong volume, jstring path
|
||||
)
|
||||
{
|
||||
const char *cpath;
|
||||
struct iso_tree_node *node;
|
||||
|
||||
cpath = (*env)->GetStringUTFChars(env, path, NULL);
|
||||
if ( cpath == NULL ) {
|
||||
return 0; /* OutOfMemoryError already thrown */
|
||||
}
|
||||
|
||||
node = iso_tree_volume_path_to_node((struct iso_volume *) volume, cpath);
|
||||
|
||||
(*env)->ReleaseStringUTFChars(env, path, cpath);
|
||||
|
||||
return (jlong) node;
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: org_pykix_libburnia_libisofs_IsoVolume
|
||||
* Method: iso_tree_volume_add_path
|
||||
* Signature: (JLjava/lang/String;Ljava/lang/String;)J
|
||||
*/
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_org_pykix_libburnia_libisofs_IsoVolume_iso_1tree_1volume_1add_1path
|
||||
(
|
||||
JNIEnv *env, jclass cls, jlong volume, jstring discPath, jstring path
|
||||
)
|
||||
{
|
||||
const char *disc_path;
|
||||
const char *cpath;
|
||||
struct iso_tree_node *node;
|
||||
|
||||
disc_path = (*env)->GetStringUTFChars(env, discPath, NULL);
|
||||
if ( disc_path == NULL ) {
|
||||
return 0; /* OutOfMemoryError already thrown */
|
||||
}
|
||||
cpath = (*env)->GetStringUTFChars(env, path, NULL);
|
||||
if ( cpath == NULL ) {
|
||||
return 0; /* OutOfMemoryError already thrown */
|
||||
}
|
||||
|
||||
node = iso_tree_volume_add_path( (struct iso_volume *) volume, disc_path, path);
|
||||
|
||||
(*env)->ReleaseStringUTFChars(env, path, cpath);
|
||||
(*env)->ReleaseStringUTFChars(env, discPath, disc_path);
|
||||
|
||||
return (jlong) node;
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: org_pykix_libburnia_libisofs_IsoVolume
|
||||
* Method: iso_tree_volume_add_new_dir
|
||||
* Signature: (JLjava/lang/String;)J
|
||||
*/
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_org_pykix_libburnia_libisofs_IsoVolume_iso_1tree_1volume_1add_1new_1dir
|
||||
(
|
||||
JNIEnv *env, jclass cls, jlong volume, jstring discPath
|
||||
)
|
||||
{
|
||||
const char *disc_path;
|
||||
struct iso_tree_node *node;
|
||||
|
||||
disc_path = (*env)->GetStringUTFChars(env, discPath, NULL);
|
||||
if ( disc_path == NULL ) {
|
||||
return 0; /* OutOfMemoryError already thrown */
|
||||
}
|
||||
|
||||
node = iso_tree_volume_add_new_dir( (struct iso_volume *) volume, disc_path);
|
||||
|
||||
(*env)->ReleaseStringUTFChars(env, discPath, disc_path);
|
||||
|
||||
return (jlong) node;
|
||||
}
|
Reference in New Issue
Block a user