<commit_before>#include <jni.h>
#include "OpenHMD-Java.h"
  
JNIEXPORT ohmd_context* JNICALL Java_ohmd_ctx_create();
{
	///TODO: Find out how to handle the return/context
	ohmd_ctx_create();
}

JNIEXPORT void JNICALL Java_ohmd_ctx_destroy(ohmd_context* ctx);
{
	ohmd_ctx_destroy();
}

JNIEXPORT jstring JNICALL Java_ohmd_ctx_get_error(ohmd_context* ctx);
{
	const char* cerror = ohmd_ctx_get_error(ctx);
	jstring error;
	
	error = (*env)->NewStringUTF(env,cerror);
	
	return error; 
}

JNIEXPORT void JNICALL Java_ohmd_ctx_update(ohmd_context* ctx);
{
	ohmd_ctx_update(ctx);
}

JNIEXPORT jint JNICALL Java_ohmd_ctx_probe(ohmd_context* ctx);
{	
	return ohmd_ctx_probe(ctx);
	
}

JNIEXPORT jstring JNICALL Java_ohmd_list_gets(ohmd_context* ctx, int index, ohmd_string_value type);
{
	const char* creturn = ohmd_list_gets(ctx, index, type);
	jstring jreturn;
	
	jreturn = (*env)->NewStringUTF(env,jreturn);
	
	return jreturn; 
}

JNIEXPORT ohmd_device* JNICALL Java_ohmd_list_open_device(ohmd_context* ctx, int index);
{
	///TODO: Find out how to handle the return/device
}

JNIEXPORT jint JNICALL Java_ohmd_close_device(ohmd_device* device);
{
	return ohmd_close_device(device);
}

JNIEXPORT jfloat* JNICALL Java_ohmd_device_getf(ohmd_device* device, ohmd_float_value type, float* out);
{
	float* cout;
	jfloat* jout;
	
	ohmd_device_getf(device, type, out);
	jout = (*env)->GetFloatArrayElements(env, cout, 0);
	
	return jout;
}

JNIEXPORT jint JNICALL Java_ohmd_device_setf(ohmd_device* device, ohmd_float_value type, float* in);
{
	return ohmd_device_setf(device, type, in);
}

JNIEXPORT jint JNICALL Java_ohmd_device_geti(* device, ohmd_int_value type, int* out);
{
	int* cout;
	jint* jout;
	
	ohmd_device_geti(device, type, cout);
	jout = (*env)->GetIntArrayElements(env, cout, 0);
	
	return jout;
}<commit_msg>-Modified function names to match those we will be using on the Java side<commit_after>#include <jni.h>
#include "OpenHMD-Java.h"

JNIEXPORT ohmd_context* JNICALL Java_OpenHMD_ohmd_ctx_create();
{
	///TODO: Find out how to handle the return/context
	ohmd_ctx_create();
}

JNIEXPORT void JNICALL Java_ohmd_ctx_destroy(ohmd_context* ctx);
{
	ohmd_ctx_destroy();
}

JNIEXPORT jstring JNICALL Java_OpenHMD_OpenHMD_ohmd_ctx_get_error(ohmd_context* ctx);
{
	const char* cerror = ohmd_ctx_get_error(ctx);
	jstring error;

	error = (*env)->NewStringUTF(env,cerror);

	return error;
}

JNIEXPORT void JNICALL Java_OpenHMD_ohmd_ctx_update(ohmd_context* ctx);
{
	ohmd_ctx_update(ctx);
}

JNIEXPORT jint JNICALL Java_OpenHMD_ohmd_ctx_probe(ohmd_context* ctx);
{
	return ohmd_ctx_probe(ctx);

}

JNIEXPORT jstring JNICALL Java_OpenHMD_ohmd_list_gets(ohmd_context* ctx, int index, ohmd_string_value type);
{
	const char* creturn = ohmd_list_gets(ctx, index, type);
	jstring jreturn;

	jreturn = (*env)->NewStringUTF(env,jreturn);

	return jreturn;
}

JNIEXPORT ohmd_device* JNICALL Java_OpenHMD_ohmd_list_open_device(ohmd_context* ctx, int index);
{
	///TODO: Find out how to handle the return/device
}

JNIEXPORT jint JNICALL Java_OpenHMD_ohmd_close_device(ohmd_device* device);
{
	return ohmd_close_device(device);
}

JNIEXPORT jfloat* JNICALL Java_OpenHMD_ohmd_device_getf(ohmd_device* device, ohmd_float_value type, float* out);
{
	float* cout;
	jfloat* jout;

	ohmd_device_getf(device, type, out);
	jout = (*env)->GetFloatArrayElements(env, cout, 0);

	return jout;
}

JNIEXPORT jint JNICALL Java_OpenHMD_ohmd_device_setf(ohmd_device* device, ohmd_float_value type, float* in);
{
	return ohmd_device_setf(device, type, in);
}

JNIEXPORT jint JNICALL Java_OpenHMD_ohmd_device_geti(ohmd_device* device, ohmd_int_value type, int* out);
{
	int* cout;
	jint* jout;

	ohmd_device_geti(device, type, cout);
	jout = (*env)->GetIntArrayElements(env, cout, 0);

	return jout;
}
{'fraction_non_alphanumeric': 0.10633784142137365, 'fraction_numerical': 0.0010607265977194379, 'mean_word_length': 6.439842209072978, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1248562', 'n_tokens_mistral': 1573, 'n_tokens_neox': 1519, 'n_words': 315}