<commit_before>#define NX_SERVICE_ASSUME_NON_DOMAIN
#include <string.h>
#include "service_guard.h"
#include "runtime/hosversion.h"
#include "services/btm.h"

static Service g_btmSrv;

NX_GENERATE_SERVICE_GUARD(btm);

Result _btmInitialize(void) {
    return smGetService(&g_btmSrv, "btm");
}

void _btmCleanup(void) {
    serviceClose(&g_btmSrv);
}

Service* btmGetServiceSession(void) {
    return &g_btmSrv;
}

static Result _btmCmdNoIO(u32 cmd_id) {
    return serviceDispatch(&g_btmSrv, cmd_id);
}

static Result _btmCmdGetEventOutFlag(Event* out_event, bool autoclear, u32 cmd_id) {
    Handle tmp_handle = INVALID_HANDLE;
    Result rc = 0;

    if (hosversionBefore(3,0,0)) {
        u8 out=0;
        rc = serviceDispatchOut(&g_btmSrv, cmd_id, out,
            .out_handle_attrs = { SfOutHandleAttr_HipcCopy },<commit_msg>btm: Fixed backwards sysver check in _btmCmdGetEventOutFlag.<commit_after>#define NX_SERVICE_ASSUME_NON_DOMAIN
#include <string.h>
#include "service_guard.h"
#include "runtime/hosversion.h"
#include "services/btm.h"

static Service g_btmSrv;

NX_GENERATE_SERVICE_GUARD(btm);

Result _btmInitialize(void) {
    return smGetService(&g_btmSrv, "btm");
}

void _btmCleanup(void) {
    serviceClose(&g_btmSrv);
}

Service* btmGetServiceSession(void) {
    return &g_btmSrv;
}

static Result _btmCmdNoIO(u32 cmd_id) {
    return serviceDispatch(&g_btmSrv, cmd_id);
}

static Result _btmCmdGetEventOutFlag(Event* out_event, bool autoclear, u32 cmd_id) {
    Handle tmp_handle = INVALID_HANDLE;
    Result rc = 0;

    if (hosversionAtLeast(3,0,0)) {
        u8 out=0;
        rc = serviceDispatchOut(&g_btmSrv, cmd_id, out,
            .out_handle_attrs = { SfOutHandleAttr_HipcCopy },
{'fraction_non_alphanumeric': 0.10772833723653395, 'fraction_numerical': 0.0117096018735363, 'mean_word_length': 4.812925170068027, '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': '5866908', 'n_tokens_mistral': 678, 'n_tokens_neox': 674, 'n_words': 120}