<commit_before>#ifndef UTIL_H_
#define UTIL_H_

#include <inttypes.h>
#include <stdlib.h>

int          pow2(uint64_t);
size_t       pagesize() __attribute__((const));
int          file_exists(const char*);
size_t       page_aligned_addr(size_t);
int          ensure_directory(const char*);
int          delete_directory(const char*);
int          append_file_to_dir(char*, size_t, const char*, const char*);
unsigned int crc32(unsigned char*, size_t);

#ifdef LOG_DEBUG
#include <stdio.h>
#define PRINT(...) printf(__VA_ARGS__)
#else
#define PRINT(x) do {} while (0);
#endif

#ifdef UNUSED
#elif defined(__GNUC__)
#define UNUSED(x) UNUSED_ ## x __attribute__((unused))
#elif defined(__LCLINT__)
#define UNUSED(x) /*@unused@*/ x
#else
#define UNUSED(x) x
#endif

#endif
<commit_msg>Add useful `min` and `max` function to util<commit_after>#ifndef UTIL_H_
#define UTIL_H_

#include <inttypes.h>
#include <stdlib.h>

#define max(x, y) ((x) > (y) ? (x) : (y))
#define min(x, y) ((x) < (y) ? (x) : (y))

int          pow2(uint64_t);
size_t       pagesize() __attribute__((const));
int          file_exists(const char*);
size_t       page_aligned_addr(size_t);
int          ensure_directory(const char*);
int          delete_directory(const char*);
int          append_file_to_dir(char*, size_t, const char*, const char*);
unsigned int crc32(unsigned char*, size_t);

#ifdef LOG_DEBUG
#include <stdio.h>
#define PRINT(...) printf(__VA_ARGS__)
#else
#define PRINT(x) do {} while (0);
#endif

#ifdef UNUSED
#elif defined(__GNUC__)
#define UNUSED(x) UNUSED_ ## x __attribute__((unused))
#elif defined(__LCLINT__)
#define UNUSED(x) /*@unused@*/ x
#else
#define UNUSED(x) x
#endif

#endif

{'fraction_non_alphanumeric': 0.14889815366289458, 'fraction_numerical': 0.00714711137581894, 'mean_word_length': 4.333333333333333, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, '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': '6360342', 'n_tokens_mistral': 639, 'n_tokens_neox': 618, 'n_words': 163}