<commit_before>// Standard includes
#include <stdlib.h>
#include <stdio.h>

// Public disir interface
#include <disir/disir.h>

// Private disir includes
#include "log.h"

//! PUBLIC API
char *
dx_semver_string (char *buffer, int32_t buffer_size, struct semantic_version *semver)
{
    int res;
    if (buffer == NULL || semver == NULL)
    {
        log_warn ("%s invoked with NULL buffer or semverpointer", __FUNCTION__);
        return "<invalid_arguments>";
    }

    res = snprintf (buffer, buffer_size,
            "%d.%d.%d.", semver->sv_major, semver->sv_minor, semver->sv_patch);
    if (res < 0 || res >= buffer_size)
    {
        log_warn ("Insufficient buffer( %p ) size( %d ) to copy semver (%d.%d.%d) - Res: %d",
                    buffer, buffer_size, semver->sv_major, semver->sv_minor,
                    semver->sv_patch, res);
        return "<insufficient_buffer>";
    }

    return buffer;
}

//! PUBLIC API
int
dx_semantic_version_compare (struct semantic_version *s1, struct semantic_version *s2)
{
    int res;

    res = 0;<commit_msg>fix: trailing period in semver string<commit_after>// Standard includes
#include <stdlib.h>
#include <stdio.h>

// Public disir interface
#include <disir/disir.h>

// Private disir includes
#include "log.h"

//! PUBLIC API
char *
dx_semver_string (char *buffer, int32_t buffer_size, struct semantic_version *semver)
{
    int res;
    if (buffer == NULL || semver == NULL)
    {
        log_warn ("%s invoked with NULL buffer or semverpointer", __FUNCTION__);
        return "<invalid_arguments>";
    }

    res = snprintf (buffer, buffer_size,
            "%d.%d.%d", semver->sv_major, semver->sv_minor, semver->sv_patch);
    if (res < 0 || res >= buffer_size)
    {
        log_warn ("Insufficient buffer( %p ) size( %d ) to copy semver (%d.%d.%d) - Res: %d",
                    buffer, buffer_size, semver->sv_major, semver->sv_minor,
                    semver->sv_patch, res);
        return "<insufficient_buffer>";
    }

    return buffer;
}

//! PUBLIC API
int
dx_semantic_version_compare (struct semantic_version *s1, struct semantic_version *s2)
{
    int res;

    res = 0;
{'fraction_non_alphanumeric': 0.13376683697166744, 'fraction_numerical': 0.00557361820715281, 'mean_word_length': 2.8259325044404973, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 27, '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': '590621', 'n_tokens_mistral': 746, 'n_tokens_neox': 700, 'n_words': 194}