<commit_before>// +build linux,cgo darwin,cgo

package vcl

// extern void* doEventCallbackProc(void* f, void* args, long argcount);
// static void* doGetEventCallbackAddr() {
//    return &doEventCallbackProc;
// }
//
// extern void* doMessageCallbackProc(void* f, void* msg, void* handled);
// static void* doGetMessageCallbackAddr() {
//    return &doMessageCallbackProc;
// }
import "C"

import (
	"unsafe"
)

//export doEventCallbackProc
func doEventCallbackProc(f unsafe.Pointer, args unsafe.Pointer, argcount C.long) unsafe.Pointer {
	callbackProc(uintptr(f), uintptr(args), int(argcount))
	return unsafe.Pointer(uintptr(0))
}

//export doMessageCallbackProc
func doMessageCallbackProc(f unsafe.Pointer, msg, handled unsafe.Pointer) unsafe.Pointer {
	messageCallbackProc(uintptr(f), uintptr(msg), int(handled))
	return unsafe.Pointer(uintptr(0))
}

var (
	eventCallback   = uintptr(C.doGetEventCallbackAddr())
	messageCallback = uintptr(C.doGetMessageCallbackAddr())
)
<commit_msg>fix callback_posix.go<commit_after>// +build linux,cgo darwin,cgo

package vcl

// extern void* doEventCallbackProc(void* f, void* args, long argcount);
// static void* doGetEventCallbackAddr() {
//    return &doEventCallbackProc;
// }
//
// extern void* doMessageCallbackProc(void* f, void* msg, void* handled);
// static void* doGetMessageCallbackAddr() {
//    return &doMessageCallbackProc;
// }
import "C"

import (
	"unsafe"
)

//export doEventCallbackProc
func doEventCallbackProc(f unsafe.Pointer, args unsafe.Pointer, argcount C.long) unsafe.Pointer {
	eventCallbackProc(uintptr(f), uintptr(args), int(argcount))
	return unsafe.Pointer(uintptr(0))
}

//export doMessageCallbackProc
func doMessageCallbackProc(f unsafe.Pointer, msg, handled unsafe.Pointer) unsafe.Pointer {
	messageCallbackProc(uintptr(f), uintptr(msg), uintptr(handled))
	return unsafe.Pointer(uintptr(0))
}

var (
	eventCallback   = uintptr(C.doGetEventCallbackAddr())
	messageCallback = uintptr(C.doGetMessageCallbackAddr())
)

{'fraction_non_alphanumeric': 0.13095835423983943, 'fraction_numerical': 0.002007024586051179, 'mean_word_length': 5.6245847176079735, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4701057', 'n_tokens_mistral': 639, 'n_tokens_neox': 625, 'n_words': 141}