diff options
author | Sven Gothel <[email protected]> | 2023-11-28 10:18:31 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2023-11-28 10:18:31 +0100 |
commit | 072c55ca78d57ce6cee44a83a78cffe1559f2b81 (patch) | |
tree | 34cc9e1ac115b44ddb69cfcb2f1e05652b99485a /src/native | |
parent | 316e80eaa678c9bf1b03685c081d48d2cf927f43 (diff) | |
parent | 0fde337685aa1feda82cc29ea852518135cb9eff (diff) |
Merge remote-tracking branch 'Mathieu_Fery/1475-devices-specifiers'
Diffstat (limited to 'src/native')
-rw-r--r-- | src/native/almisc.c | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/src/native/almisc.c b/src/native/almisc.c index ca638d9..06fa794 100644 --- a/src/native/almisc.c +++ b/src/native/almisc.c @@ -1,19 +1,21 @@ - #include <jni.h> #include <stdlib.h> #include <assert.h> - #include "al.h" - #include "alc.h" - #ifndef _MSC_VER /* Non-Windows platforms */ +#include "al.h" +#include "alc.h" +#ifndef _MSC_VER /* Non-Windows platforms */ #define __cdecl /* Trim non-standard keyword */ - #endif - #include "efx.h" - #include <string.h> +#endif +#include "efx.h" +#include <string.h> +#include <stdbool.h> extern int strlen_alc(ALCdevice *device, int param, const char* str); +extern bool alc_is_double_null_terminated_string(ALCdevice *device, int param); + /* Java->C glue code: * Java package: jogamp.openal.ALImpl * Java method: long dispatch_alGetProcAddressStatic(java.lang.String fname) @@ -61,3 +63,12 @@ Java_jogamp_openal_ALCImpl_dispatch_1alcGetStringImpl1(JNIEnv *env, jobject _unu return (*env)->NewDirectByteBuffer(env, _res, strlen_alc(_device_ptr, param, _res)); } +JNIEXPORT jboolean JNICALL +Java_jogamp_openal_ALCImpl_dispatch_1alcIsDoubleNullTerminatedString(JNIEnv *env, jobject _unused, jobject device, jint param) { + ALCdevice * _device_ptr = NULL; + const ALCchar * _res; + if ( NULL != device ) { + _device_ptr = (ALCdevice *) (((char*) (*env)->GetDirectBufferAddress(env, device)) + 0); + } + return (jboolean) alc_is_double_null_terminated_string((ALCdevice *) _device_ptr, (ALCenum) param); +} |