<commit_before>#define _GNU_SOURCE
#include "__bson.h"
#include "bson.h"
#include "color.h"
#include "deep_inspection.h"
#include "ext4.h"
#include "ntfs.h"
#include "redis_queue.h"
#include "util.h"

#include <stdbool.h>
#include <stdlib.h>
#include <string.h>

#include <assert.h>
#include <errno.h>
#include <unistd.h>

#ifndef HOST_NAME_MAX
    #define HOST_NAME_MAX 256
#endif

#define FILE_DATA_WRITE "data"
#define FILE_META_WRITE "metadata"
#define VM_NAME_MAX 512
#define PATH_MAX 4096

#define STRINGIFY2(x) #x
#define STRINGIFY(x) STRINGIFY2(x)

#define D_PRINT64(val) { fprintf_light_yellow(stdout, "" \
                         STRINGIFY(val)" : %"PRIu64"\n", val); }
#define D_PRINT16(val) { fprintf_light_yellow(stdout, "" \
                         STRINGIFY(val)" : %"PRIu32"\n", (uint32_t) val); }

/*** Pre-Definitions ***/
int qemu_deep_inspect(struct ext4_superblock* superblock,
                      struct qemu_bdrv_write* write,
                      struct kv_store* store, uint64_t write_counter,
                      char* vmname, uint64_t partition_offset);

char* construct_channel_name(char* vmname, char* path)
{
    char* buf = malloc(HOST_NAME_MAX + VM_NAME_MAX + PATH_MAX + 3);
    if (buf == NULL)
        return NULL;

    if (gethostname(buf, HOST_NAME_MAX))
    {
        free(buf);
        return NULL;
    }

    strncat(buf, ":", 1);
    strncat(buf, vmname, strlen(vmname));
    strncat(buf, ":", 1);
    strncat(buf, path, strlen(path));
    return buf;
}
<commit_msg>stream_analyzer: defined in header file, no need in C<commit_after>#define _GNU_SOURCE
#include "__bson.h"
#include "bson.h"
#include "color.h"
#include "deep_inspection.h"
#include "ext4.h"
#include "ntfs.h"
#include "redis_queue.h"
#include "util.h"

#include <stdbool.h>
#include <stdlib.h>
#include <string.h>

#include <assert.h>
#include <errno.h>
#include <unistd.h>

#ifndef HOST_NAME_MAX
    #define HOST_NAME_MAX 256
#endif

#define FILE_DATA_WRITE "data"
#define FILE_META_WRITE "metadata"
#define VM_NAME_MAX 512
#define PATH_MAX 4096

#define STRINGIFY2(x) #x
#define STRINGIFY(x) STRINGIFY2(x)

#define D_PRINT64(val) { fprintf_light_yellow(stdout, "" \
                         STRINGIFY(val)" : %"PRIu64"\n", val); }
#define D_PRINT16(val) { fprintf_light_yellow(stdout, "" \
                         STRINGIFY(val)" : %"PRIu32"\n", (uint32_t) val); }

/*** Pre-Definitions ***/
char* construct_channel_name(char* vmname, char* path)
{
    char* buf = malloc(HOST_NAME_MAX + VM_NAME_MAX + PATH_MAX + 3);
    if (buf == NULL)
        return NULL;

    if (gethostname(buf, HOST_NAME_MAX))
    {
        free(buf);
        return NULL;
    }

    strncat(buf, ":", 1);
    strncat(buf, vmname, strlen(vmname));
    strncat(buf, ":", 1);
    strncat(buf, path, strlen(path));
    return buf;
}

{'fraction_non_alphanumeric': 0.1453900709219858, 'fraction_numerical': 0.02021276595744681, 'mean_word_length': 3.4216300940438873, 'pattern_counts': {'":': 4, '<': 15, '<?xml version=': 0, '>': 15, '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': '509607', 'n_tokens_mistral': 1119, 'n_tokens_neox': 1065, 'n_words': 228}