<commit_before>#ifndef CAUTERIZE_H
#define CAUTERIZE_H

#include <stdint.h>
#include <stddef.h>

#include "cauterize_util.h"

typedef uint32_t CAUTERIZE_STATUS_T;

#define CA_OK                    (0)
#define CA_ERR_ASSERT            (1)
#define CA_ERR_NOT_ENOUGH_SPACE  (2)
#define CA_ERR_NOT_ENOUGH_DATA   (3)
#define CA_ERR_INVALID_LENGTH    (4)
#define CA_ERR_INVALUD_TYPE_TAG  (5)
#define CA_ERR_INVALID_ENUM_VAL  (6)
#define CA_ERR_GENERAL           (UINT32_MAX)

struct Cauterize {
  size_t size; // Size of the buffer in bytes
  size_t used; // Number of used bytes in the buffer
  size_t pos; // The next byte to be read
  uint8_t * buffer; // Buffer to hold data
};

#ifdef __cplusplus
extern "C" {
#endif

CALLCONV CAUTERIZE_STATUS_T DLLDECL CauterizeInitAppend(
    struct Cauterize * m,
    uint8_t * buffer,
    size_t length);

CALLCONV CAUTERIZE_STATUS_T DLLDECL CauterizeInitRead(
    struct Cauterize * m,
    uint8_t * buffer,
    size_t used);

CALLCONV CAUTERIZE_STATUS_T DLLDECL CauterizeAppend(
    struct Cauterize * m,
    uint8_t * src,
    size_t length);

CALLCONV CAUTERIZE_STATUS_T DLLDECL CauterizeRead(
    struct Cauterize * m,
    uint8_t * dst,
    size_t length);

#ifdef __cplusplus
}
#endif

#define CA_MAX(a,b) ((a) > (b) ? (a) : (b))

#endif /* CAUTERIZE_H */
<commit_msg>Provide hook to allow the specification of custom types (not stdint or stddef).<commit_after>#ifndef CAUTERIZE_H
#define CAUTERIZE_H

#ifndef CUSTOM_TYPES
  #include <stdint.h>
  #include <stddef.h>
#else
  #include "cauterize_custom_types.h"
#endif

#include "cauterize_util.h"

typedef uint32_t CAUTERIZE_STATUS_T;

#define CA_OK                    (0)
#define CA_ERR_ASSERT            (1)
#define CA_ERR_NOT_ENOUGH_SPACE  (2)
#define CA_ERR_NOT_ENOUGH_DATA   (3)
#define CA_ERR_INVALID_LENGTH    (4)
#define CA_ERR_INVALUD_TYPE_TAG  (5)
#define CA_ERR_INVALID_ENUM_VAL  (6)
#define CA_ERR_GENERAL           (UINT32_MAX)

struct Cauterize {
  size_t size; // Size of the buffer in bytes
  size_t used; // Number of used bytes in the buffer
  size_t pos; // The next byte to be read
  uint8_t * buffer; // Buffer to hold data
};

#ifdef __cplusplus
extern "C" {
#endif

CALLCONV CAUTERIZE_STATUS_T DLLDECL CauterizeInitAppend(
    struct Cauterize * m,
    uint8_t * buffer,
    size_t length);

CALLCONV CAUTERIZE_STATUS_T DLLDECL CauterizeInitRead(
    struct Cauterize * m,
    uint8_t * buffer,
    size_t used);

CALLCONV CAUTERIZE_STATUS_T DLLDECL CauterizeAppend(
    struct Cauterize * m,
    uint8_t * src,
    size_t length);

CALLCONV CAUTERIZE_STATUS_T DLLDECL CauterizeRead(
    struct Cauterize * m,
    uint8_t * dst,
    size_t length);

#ifdef __cplusplus
}
#endif

#define CA_MAX(a,b) ((a) > (b) ? (a) : (b))

#endif /* CAUTERIZE_H */

{'fraction_non_alphanumeric': 0.08749096167751265, 'fraction_numerical': 0.011569052783803326, 'mean_word_length': 3.6818950930626055, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '6687155', 'n_tokens_mistral': 1134, 'n_tokens_neox': 1097, 'n_words': 278}