<commit_before>// predefined selector callbacks for the halg_foreach() iterator
//
// see hal_objects.h:halg_foreach for halg_foreach semantics
// see hal_object_selectors.h for selector usage

#include "config.h"
#include "rtapi.h"
#include "hal.h"
#include "hal_priv.h"
#include "hal_ring.h"
#include "hal_object.h"
#include "hal_list.h"
#include "hal_internal.h"

int yield_match(hal_object_ptr o, foreach_args_t *args)
{
    args->user_ptr1 = o.any;
    return 1;  // terminate visit on first match
}

int yield_name(hal_object_ptr o, foreach_args_t *args)
{
    args->user_ptr1 = hh_get_name(o.hdr);
    return 1;  // terminate visit on first match
}

int yield_count(hal_object_ptr o, foreach_args_t *args)<commit_msg>hal/lib/hal_object_selectors.c:  fix compiler warning<commit_after>// predefined selector callbacks for the halg_foreach() iterator
//
// see hal_objects.h:halg_foreach for halg_foreach semantics
// see hal_object_selectors.h for selector usage

#include "config.h"
#include "rtapi.h"
#include "hal.h"
#include "hal_priv.h"
#include "hal_ring.h"
#include "hal_object.h"
#include "hal_list.h"
#include "hal_internal.h"

int yield_match(hal_object_ptr o, foreach_args_t *args)
{
    args->user_ptr1 = o.any;
    return 1;  // terminate visit on first match
}

int yield_name(hal_object_ptr o, foreach_args_t *args)
{
    args->user_ptr1 = (void *)hh_get_name(o.hdr);
    return 1;  // terminate visit on first match
}

int yield_count(hal_object_ptr o, foreach_args_t *args)
{'fraction_non_alphanumeric': 0.1143048128342246, 'fraction_numerical': 0.0053475935828877, 'mean_word_length': 4.77992277992278, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '7467752', 'n_tokens_mistral': 559, 'n_tokens_neox': 543, 'n_words': 137}