extras-legacy/java/trunk/src/jni/libburn/DriveInfo.c

50 lines
1.2 KiB
C

/*
* DriveInfo.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_libburn_DriveInfo.h"
#include "libburn.h"
/*
* Class: org_pykix_libburnia_libburn_DriveInfo
* Method: burn_drive_info_forget
* Signature: (JI)I
*/
JNIEXPORT jint JNICALL
Java_org_pykix_libburnia_libburn_DriveInfo_burn_1drive_1info_1forget
(
JNIEnv *env, jclass cls, jlong d, jint force
)
{
return burn_drive_info_forget( (struct burn_drive_info *) d, force);
}
/*
* Class: org_pykix_libburnia_libburn_DriveInfo
* Method: burn_drive_get_adr
* Signature: (J)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL
Java_org_pykix_libburnia_libburn_DriveInfo_burn_1drive_1get_1adr
(
JNIEnv *env, jclass cls, jlong d
)
{
char adr[BURN_DRIVE_ADR_LEN];
if ( burn_drive_get_adr( (struct burn_drive_info *) d, adr) <= 0 ) {
return NULL;
}
return (*env)->NewStringUTF(env, adr);
}