<commit_before>
#ifndef __THRIFT_TYPES_H__
#define __THRIFT_TYPES_H__

#include <config.h>
#include <stddef.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>

/* Macros for min/max.  */
#ifndef MIN
# define MIN(a, b) (((a) < (b)) ? (a) : (b))
#endif

#ifndef MAX
# define MAX(a, b) (((a) > (b)) ? (a) : (b))
#endif

typedef enum
{
    T_ERR_OK                        = 0,
    T_ERR_ALLOC_FAILED              = 1024,
    T_ERR_ALLOC_NOT_SUPPORTED       = 1025,
    T_ERR_BUFFER_OVERFLOW           = 1026,
    T_ERR_BUFFER_UNDERFLOW          = 1027
} tn_error_t;
const char* tn_error_str(tn_error_t t);

/**
 * Enumerated definition of the types that the Thrift protocol supports.
 * Take special note of the T_END type which is used specifically to mark
 * the end of a sequence of fields.
 */
typedef enum
{
  T_STOP   = 0,
  T_VOID   = 1,
  T_BOOL   = 2,
  T_BYTE   = 3,
  T_I08    = 3,
  T_I16    = 6,
  T_I32    = 8,
  T_U64    = 9,
  T_I64    = 10,
  T_DOUBLE = 4,
  T_STRING = 11,
  T_UTF7   = 11,
  T_STRUCT = 12,
  T_MAP    = 13,
  T_SET    = 14,
  T_LIST   = 15,
  T_UTF8   = 16,
  T_UTF16  = 17
} tn_type_t;

/**
 * Enumerated definition of the message types that the Thrift protocol
 * supports.
 */
typedef enum
{
  T_CALL      = 1,
  T_REPLY     = 2,
  T_EXCEPTION = 3,
  T_ONEWAY    = 4
} tn_message_type_t;


/**
 * Base type for all things.  This has methods and properties common to
 * all types in tn.  Right now we just have tn_destroy but we may have
 * things like refcounter in the future
 */
typedef struct tn_object_t
{
    void (*tn_destroy)(struct tn_object_t *self);
} tn_object_t;
void tn_object_destroy(void *obj);


/**
 * A list type that copies data into an internal buffer.  The mowgli list is nice
 * but it's a little more complicated than we need.
 */
typedef struct
{
    tn_object_t parent;
	void *data;<commit_msg>minor doco change<commit_after>
#ifndef __THRIFT_TYPES_H__
#define __THRIFT_TYPES_H__

#include <config.h>
#include <stddef.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>

/* Macros for min/max.  */
#ifndef MIN
# define MIN(a, b) (((a) < (b)) ? (a) : (b))
#endif

#ifndef MAX
# define MAX(a, b) (((a) > (b)) ? (a) : (b))
#endif

typedef enum
{
    T_ERR_OK                        = 0,
    T_ERR_ALLOC_FAILED              = 1024,
    T_ERR_ALLOC_NOT_SUPPORTED       = 1025,
    T_ERR_BUFFER_OVERFLOW           = 1026,
    T_ERR_BUFFER_UNDERFLOW          = 1027
} tn_error_t;
const char* tn_error_str(tn_error_t t);

/**
 * Enumerated definition of the types that the Thrift protocol supports.
 * Take special note of the T_END type which is used specifically to mark
 * the end of a sequence of fields.
 */
typedef enum
{
  T_STOP   = 0,
  T_VOID   = 1,
  T_BOOL   = 2,
  T_BYTE   = 3,
  T_I08    = 3,
  T_I16    = 6,
  T_I32    = 8,
  T_U64    = 9,
  T_I64    = 10,
  T_DOUBLE = 4,
  T_STRING = 11,
  T_UTF7   = 11,
  T_STRUCT = 12,
  T_MAP    = 13,
  T_SET    = 14,
  T_LIST   = 15,
  T_UTF8   = 16,
  T_UTF16  = 17
} tn_type_t;

/**
 * Enumerated definition of the message types that the Thrift protocol
 * supports.
 */
typedef enum
{
  T_CALL      = 1,
  T_REPLY     = 2,
  T_EXCEPTION = 3,
  T_ONEWAY    = 4
} tn_message_type_t;


/**
 * Base type for all things.  This has methods and properties common to
 * all types in tn.  Basically, just holds a common destructor.
 */
typedef struct tn_object_t
{
    void (*tn_destroy)(struct tn_object_t *self);
} tn_object_t;
void tn_object_destroy(void *obj);


/**
 * A list type that copies data into an internal buffer.  The mowgli list is nice
 * but it's a little more complicated than we need.
 */
typedef struct
{
    tn_object_t parent;
	void *data;
{'fraction_non_alphanumeric': 0.10496338486574451, 'fraction_numerical': 0.033631678871711417, 'mean_word_length': 2.6015625, 'pattern_counts': {'":': 0, '<': 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': '2108723', 'n_tokens_mistral': 1589, 'n_tokens_neox': 1461, 'n_words': 429}