<commit_before>#ifndef BLOOM_CONFIG_H
#define BLOOM_CONFIG_H

/**
 * Stores our configuration
 */
typedef struct {
    int tcp_port;
    int udp_port;
    char *data_dir;
    char *log_level;
    uint64_t initial_capacity;
    double default_probability;
    uint32_t scale_size;
    double probability_reduction;
    uint32_t flush_interval;
    uint32_t cold_interval;
    bool in_memory;
} bloom_config;

/**
 * Default bloom_config values. Should create
 * filters that are about 300KB initially, and suited
 * to grow quickly.
 */
const bloom_config DEFAULT_CONFIG {
    8673,               // TCP defaults to 8673
    8674,               // UDP on 8674
    "/tmp/bloomd",      // Tmp data dir, until configured
    "DEBUG",            // DEBUG level
    100000,             // 100K items by default.
    1e-4,               // Default 1/10K probability.
    4,                  // Scale 4x, SBF_DEFAULT_PARAMS
    0.9,                // SBF_DEFAULT_PARAMS reduction
    60,                 // Flush once a minute
    3600,               // Cold after an hour
    false               // Persist to disk by default
};

/**
 * Initializes the configuration from a filename.
 * Reads the file as an INI configuration, and sets up the
 * config object.
 * @arg filename The name of the file to read. NULL for defaults.
 * @arg config Output. The config object to initialize.
 * @return 0 on success, negative on error.
 */
int config_from_filename(char *filename, bloom_config *config);

#endif<commit_msg>Adjust some types, fix the definition of DEFAULT_CONFIG<commit_after>#ifndef BLOOM_CONFIG_H
#define BLOOM_CONFIG_H
#include <stdint.h>

/**
 * Stores our configuration
 */
typedef struct {
    int tcp_port;
    int udp_port;
    char *data_dir;
    char *log_level;
    uint64_t initial_capacity;
    double default_probability;
    int scale_size;
    double probability_reduction;
    int flush_interval;
    int cold_interval;
    int in_memory;
} bloom_config;

/**
 * Default bloom_config values. Should create
 * filters that are about 300KB initially, and suited
 * to grow quickly.
 */
const bloom_config DEFAULT_CONFIG = {
    8673,               // TCP defaults to 8673
    8674,               // UDP on 8674
    "/tmp/bloomd",      // Tmp data dir, until configured
    "DEBUG",            // DEBUG level
    100000,             // 100K items by default.
    1e-4,               // Default 1/10K probability.
    4,                  // Scale 4x, SBF_DEFAULT_PARAMS
    0.9,                // SBF_DEFAULT_PARAMS reduction
    60,                 // Flush once a minute
    3600,               // Cold after an hour
    0                   // Persist to disk by default
};

/**
 * Initializes the configuration from a filename.
 * Reads the file as an INI configuration, and sets up the
 * config object.
 * @arg filename The name of the file to read. NULL for defaults.
 * @arg config Output. The config object to initialize.
 * @return 0 on success, negative on error.
 */
int config_from_filename(char *filename, bloom_config *config);

#endif
{'fraction_non_alphanumeric': 0.07772697583278902, 'fraction_numerical': 0.03233180927498367, 'mean_word_length': 2.1512345679012346, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '6496961', 'n_tokens_mistral': 956, 'n_tokens_neox': 867, 'n_words': 314}