<commit_before>#ifndef _LIBKMOD_UTIL_H_
#define _LIBKMOD_UTIL_H_

#include "macro.h"

#include <limits.h>
#include <stdio.h>
#include <sys/types.h>


char *getline_wrapped(FILE *fp, unsigned int *linenum) __attribute__((nonnull(1)));
#define streq(a, b) (strcmp((a), (b)) == 0)
#define strstartswith(a, b) (strncmp(a, b, strlen(b)) == 0)
void *memdup(const void *p, size_t n) __attribute__((nonnull(1)));

ssize_t read_str_safe(int fd, char *buf, size_t buflen) _must_check_ __attribute__((nonnull(2)));
ssize_t write_str_safe(int fd, const char *buf, size_t buflen) __attribute__((nonnull(2)));<commit_msg>libkmod-util: add missing stdbool.h include<commit_after>#ifndef _LIBKMOD_UTIL_H_
#define _LIBKMOD_UTIL_H_

#include "macro.h"

#include <limits.h>
#include <stdbool.h>
#include <stdio.h>
#include <sys/types.h>


char *getline_wrapped(FILE *fp, unsigned int *linenum) __attribute__((nonnull(1)));
#define streq(a, b) (strcmp((a), (b)) == 0)
#define strstartswith(a, b) (strncmp(a, b, strlen(b)) == 0)
void *memdup(const void *p, size_t n) __attribute__((nonnull(1)));

ssize_t read_str_safe(int fd, char *buf, size_t buflen) _must_check_ __attribute__((nonnull(2)));
ssize_t write_str_safe(int fd, const char *buf, size_t buflen) __attribute__((nonnull(2)));
{'fraction_non_alphanumeric': 0.16363636363636364, 'fraction_numerical': 0.009486166007905139, 'mean_word_length': 7.671232876712328, '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': '7354126', 'n_tokens_mistral': 528, 'n_tokens_neox': 519, 'n_words': 119}