<commit_before>#ifndef __TLV_MSG_H__
#define __TLV_MSG_H__

#include "core_tlv.h"
#include "core_pkbuf.h"

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

#define TLV_MAX_HEADROOM 16
#define TLV_VARIABLE_LEN 0
#define TLV_MAX_MORE 8
#define TLV_1_OR_MORE(__v) __v[TLV_MAX_MORE]

typedef enum {
    TLV_UINT8,
    TLV_UINT16,
    TLV_UINT24,
    TLV_UINT32,
    TLV_INT8,
    TLV_INT16,
    TLV_INT24,
    TLV_INT32,
    TLV_FIXED_STR,
    TLV_VAR_STR,
    TLV_NULL,
    TLV_MORE,
    TLV_COMPOUND,
    TLV_MESSAGE,
} tlv_type_e;

typedef struct _tlv_desc_t {
    tlv_type_e ctype;
    c_int8_t *name;
    c_uint16_t type;
    c_uint16_t length;
    c_uint8_t  instance;
    c_uint16_t vsize;
    void *child_descs[];
} tlv_desc_t;

extern tlv_desc_t tlv_desc_more1;
extern tlv_desc_t tlv_desc_more2;
extern tlv_desc_t tlv_desc_more3;
extern tlv_desc_t tlv_desc_more4;
extern tlv_desc_t tlv_desc_more5;
extern tlv_desc_t tlv_desc_more6;
extern tlv_desc_t tlv_desc_more7;
extern tlv_desc_t tlv_desc_more8;

typedef c_uint64_t tlv_presence_t;

/* 8-bit Unsigned integer */
typedef struct _tlv_uint8_t {
    tlv_presence_t presence;
    c_uint8_t u8;
} tlv_uint8_t;

/* 16-bit Unsigned integer */
typedef struct _tlv_uint16_t {
    tlv_presence_t presence;
    c_uint16_t u16;
} tlv_uint16_t;

/* 24-bit Unsigned integer */
typedef struct _tlv_uint24_t {
    tlv_presence_t presence;
    c_uint32_t u24; /* Only 3 bytes valid */
} tlv_uint24_t;
<commit_msg>for old version gcc compiler, we fix the size of child_desc in TLV message library<commit_after>#ifndef __TLV_MSG_H__
#define __TLV_MSG_H__

#include "core_tlv.h"
#include "core_pkbuf.h"

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

#define TLV_MAX_HEADROOM 16
#define TLV_VARIABLE_LEN 0
#define TLV_MAX_MORE 8
#define TLV_1_OR_MORE(__v) __v[TLV_MAX_MORE]

#define TLV_MAX_CHILD_DESC 128

typedef enum {
    TLV_UINT8,
    TLV_UINT16,
    TLV_UINT24,
    TLV_UINT32,
    TLV_INT8,
    TLV_INT16,
    TLV_INT24,
    TLV_INT32,
    TLV_FIXED_STR,
    TLV_VAR_STR,
    TLV_NULL,
    TLV_MORE,
    TLV_COMPOUND,
    TLV_MESSAGE,
} tlv_type_e;

typedef struct _tlv_desc_t {
    tlv_type_e ctype;
    c_int8_t *name;
    c_uint16_t type;
    c_uint16_t length;
    c_uint8_t  instance;
    c_uint16_t vsize;
    void *child_descs[TLV_MAX_CHILD_DESC];
} tlv_desc_t;

extern tlv_desc_t tlv_desc_more1;
extern tlv_desc_t tlv_desc_more2;
extern tlv_desc_t tlv_desc_more3;
extern tlv_desc_t tlv_desc_more4;
extern tlv_desc_t tlv_desc_more5;
extern tlv_desc_t tlv_desc_more6;
extern tlv_desc_t tlv_desc_more7;
extern tlv_desc_t tlv_desc_more8;

typedef c_uint64_t tlv_presence_t;

/* 8-bit Unsigned integer */
typedef struct _tlv_uint8_t {
    tlv_presence_t presence;
    c_uint8_t u8;
} tlv_uint8_t;

/* 16-bit Unsigned integer */
typedef struct _tlv_uint16_t {
    tlv_presence_t presence;
    c_uint16_t u16;
} tlv_uint16_t;

/* 24-bit Unsigned integer */
typedef struct _tlv_uint24_t {
    tlv_presence_t presence;
    c_uint32_t u24; /* Only 3 bytes valid */
} tlv_uint24_t;

{'fraction_non_alphanumeric': 0.06896551724137931, 'fraction_numerical': 0.042364532019704436, 'mean_word_length': 4.260794473229707, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4715787', 'n_tokens_mistral': 1493, 'n_tokens_neox': 1381, 'n_words': 267}