Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

src/jni/dcb.cpp

Go to the documentation of this file.
00001 /*
00002  * $Id: dcb.cpp,v 1.1 2004/12/16 01:38:15 kevino Exp $
00003  *
00004  * Copyright (c) 2003,2004 Kevin O'Donnell
00005  * 
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Lesser General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2.1 of the License, or (at your option) any later version.
00010  *
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with this library; if not, write to the Free Software
00018  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307,  USA.
00019  */
00020 
00021 #include "common.h"
00022 #include "net_threebit_jvr_dcb.h"
00023 
00024 /*
00025  * Class:     net_threebit_jvr_dcb
00026  * Method:    open
00027  * Signature: (Ljava/lang/String;I)I
00028  */
00029 JNIEXPORT jint JNICALL Java_net_threebit_jvr_dcb_open
00030   (JNIEnv *e, jclass c, jstring name, jint flags)
00031 {
00032   JVR_ENTER;
00033   char *namep = (char*) e->GetStringUTFChars(name,NULL);
00034   int ret = dcb_open(namep,flags);
00035   if (ret == -1) {
00036     jvr_throw(JVR_THROW_DG,"dcb_open(\"%s\",%d) failed",namep,flags);
00037   }
00038   e->ReleaseStringUTFChars(name,namep);
00039   JVR_EXIT; return ret;
00040 }
00041 
00042 /*
00043  * Class:     net_threebit_jvr_dcb
00044  * Method:    close
00045  * Signature: (I)I
00046  */
00047 JNIEXPORT jint JNICALL Java_net_threebit_jvr_dcb_close
00048   (JNIEnv *e, jclass c, jint dev)
00049 {
00050   JVR_ENTER;
00051   int ret = dcb_close(dev);
00052   if (ret == -1) {
00053     jvr_throw(JVR_THROW_DG,"dcb_close(%d) failed. errno = %d",dev,errno);
00054   }
00055   JVR_EXIT; return ret;
00056 }
00057 
00058 /*
00059  * Class:     net_threebit_jvr_dcb
00060  * Method:    delconf
00061  * Signature: (II)I
00062  */
00063 JNIEXPORT jint JNICALL Java_net_threebit_jvr_dcb_delconf
00064   (JNIEnv *e, jclass c, jint dev, jint confID)
00065 {
00066   JVR_ENTER;
00067   int ret = dcb_delconf(dev,confID);
00068   if (ret == -1) {
00069     jvr_throw(JVR_THROW_DG,"dcb_delconf(%d,%d) failed: %s",dev,confID,ATDV_ERRMSGP(dev));
00070   }
00071   JVR_EXIT; return ret;
00072 }
00073 
00074 /*
00075  * Class:     net_threebit_jvr_dcb
00076  * Method:    monconf
00077  * Signature: (II)J
00078  */
00079 JNIEXPORT jlong JNICALL Java_net_threebit_jvr_dcb_monconf
00080   (JNIEnv *e, jclass c, jint dev, jint confID)
00081 {
00082   JVR_ENTER;
00083   long ts;
00084   int ret = dcb_monconf(dev,confID,&ts);
00085   if (ret == -1) {
00086     jvr_throw(JVR_THROW_DG,"dcb_monconf(%d,%d) failed: %s",dev,confID,ATDV_ERRMSGP(dev));
00087     JVR_EXIT; return -1;
00088   }
00089   JVR_EXIT; return ts;
00090 }
00091 
00092 /*
00093  * Class:     net_threebit_jvr_dcb
00094  * Method:    unmonconf
00095  * Signature: (II)I
00096  */
00097 JNIEXPORT jint JNICALL Java_net_threebit_jvr_dcb_unmonconf
00098   (JNIEnv *e, jclass c, jint dev, jint confID)
00099 {
00100   JVR_ENTER;
00101   int ret = dcb_unmonconf(dev,confID);
00102   if (ret == -1) {
00103     jvr_throw(JVR_THROW_DG,"dcb_unmonconf(%d,%d) failed: %s",dev,confID,ATDV_ERRMSGP(dev));
00104   }
00105   JVR_EXIT; return ret;
00106 }
00107 

Generated on Sat Jul 16 03:47:26 2005 for JVR by doxygen 1.3.5