<commit_before>#ifndef STATIC_LINK
#define IMPLEMENT_API
#endif

#include <hx/CFFI.h>

#import "openglcontext_ios/OpenGLResponder.h"

value *__onMainRenderCallback = NULL;
value *__onSizeChangedCallback = NULL;

static value openglcontextios_initialize_main_context(value onMainRenderCallback, value onSizeChangedCallback)
{
	val_check_function(onMainRenderCallback, 0); // Is Func ?

	if (__onMainRenderCallback == NULL)
	{
		__onMainRenderCallback = alloc_root();
	}
	*__onMainRenderCallback = onMainRenderCallback;

	val_check_function(onSizeChangedCallback, 0); // Is Func ?

	if (__onSizeChangedCallback == NULL)
	{
		__onSizeChangedCallback = alloc_root();
	}
	*__onSizeChangedCallback = onSizeChangedCallback;

	EAGLContext *context = [OpenGLResponder initializeMainContext];

	return (value)context;
}
DEFINE_PRIM (openglcontextios_initialize_main_context, 2);

static value openglcontextios_get_main_context_width()
{<commit_msg>casting a pointer to value is a terrible idea for GC<commit_after>#ifndef STATIC_LINK
#define IMPLEMENT_API
#endif

#include <hx/CFFI.h>

#import "openglcontext_ios/OpenGLResponder.h"

DEFINE_KIND(k_Context) 

value *__onMainRenderCallback = NULL;
value *__onSizeChangedCallback = NULL;

static value openglcontextios_initialize_main_context(value onMainRenderCallback, value onSizeChangedCallback)
{
	val_check_function(onMainRenderCallback, 0); // Is Func ?

	if (__onMainRenderCallback == NULL)
	{
		__onMainRenderCallback = alloc_root();
	}
	*__onMainRenderCallback = onMainRenderCallback;

	val_check_function(onSizeChangedCallback, 0); // Is Func ?

	if (__onSizeChangedCallback == NULL)
	{
		__onSizeChangedCallback = alloc_root();
	}
	*__onSizeChangedCallback = onSizeChangedCallback;

	EAGLContext *context = [OpenGLResponder initializeMainContext];

	return alloc_abstract(k_Context, context);
}
DEFINE_PRIM (openglcontextios_initialize_main_context, 2);

static value openglcontextios_get_main_context_width()
{
{'fraction_non_alphanumeric': 0.08520408163265306, 'fraction_numerical': 0.003061224489795918, 'mean_word_length': 7.489177489177489, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '6125174', 'n_tokens_mistral': 664, 'n_tokens_neox': 636, 'n_words': 122}