1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-15 21:15:23 +02:00
cdt/wince/org.eclipse.tm.rapi/native/RapiEnumDevices.cpp
2008-03-27 19:52:30 +00:00

35 lines
1.1 KiB
C++

/*******************************************************************************
* Copyright (c) 2008 Radoslav Gerganov
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Radoslav Gerganov - initial API and implementation
*******************************************************************************/
#include <WinSock2.h>
#include <rapi2.h>
#include "org_eclipse_tm_internal_rapi_RapiEnumDevices.h"
#define RAPI_NATIVE(func) Java_org_eclipse_tm_internal_rapi_RapiEnumDevices_##func
JNIEXPORT jint JNICALL RAPI_NATIVE(Next)
(JNIEnv *env, jobject that, jint arg0, jintArray arg1)
{
jint rc = E_FAIL;
jint *lparg1 = NULL;
if (arg0 == 0) return rc;
if (arg1) {
lparg1 = env->GetIntArrayElements(arg1, NULL);
if (lparg1 == NULL) goto fail;
}
IRAPIEnumDevices *pEnumDevices = (IRAPIEnumDevices*) arg0;
rc = pEnumDevices->Next((IRAPIDevice**)lparg1);
fail:
if (arg1 && lparg1) env->ReleaseIntArrayElements(arg1, lparg1, 0);
return rc;
}