<commit_before>#include <stdio.h>

#include "msg/msg.h"

void testfunc(wdns_message_t *m)
{
	wdns_print_message(stdout, m);
}
<commit_msg>examples/wdns-test-print-message: add load and free functions<commit_after>#include <stddef.h>
#include <stdio.h>

#include "msg/msg.h"

wdns_message_t m;

bool
loadfunc(uint8_t *data, size_t len)
{
	wdns_msg_status status;
	status = wdns_parse_message(&m, data, len);
	if (status != wdns_msg_success)
		return (false);
	return (true);
}

void
freefunc(void)
{
	wdns_clear_message(&m);
}

bool
testfunc(void)
{
	wdns_print_message(stdout, &m);
	return (true);
}

{'fraction_non_alphanumeric': 0.145, 'fraction_numerical': 0.0016666666666666668, 'mean_word_length': 5.829545454545454, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, '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': '6707033', 'n_tokens_mistral': 259, 'n_tokens_neox': 254, 'n_words': 49}