<commit_before>#include "adlb_types.h"

#include <assert.h>
#include <string.h>

#include "adlb.h"
#include "data_cleanup.h"
#include "data_structs.h"

static char *data_repr_container(adlb_container *c);

adlb_data_code
ADLB_Pack(const adlb_datum_storage *d, adlb_data_type type,
          const adlb_buffer *caller_buffer,
          adlb_binary_data *result)
{
  switch (type)
  {
    case ADLB_DATA_TYPE_INTEGER:
      return ADLB_Pack_integer(&d->INTEGER, result);
    case ADLB_DATA_TYPE_REF:
      return ADLB_Pack_ref(&d->REF, result);
    case ADLB_DATA_TYPE_FLOAT:
      return ADLB_Pack_float(&d->FLOAT, result);
    case ADLB_DATA_TYPE_STRING:
      return ADLB_Pack_string(&d->STRING, result);
    case ADLB_DATA_TYPE_BLOB:
      return ADLB_Pack_blob(&d->BLOB, result);
    case ADLB_DATA_TYPE_FILE_REF:
      return ADLB_Pack_file_ref(&d->FILE_REF, result);<commit_msg>Fix warning on asprintf()<commit_after>
#define _GNU_SOURCE // for asprintf()

#include "adlb_types.h"

#include <stdio.h>

#include "adlb.h"
#include "data_cleanup.h"
#include "data_structs.h"

static char *data_repr_container(adlb_container *c);

adlb_data_code
ADLB_Pack(const adlb_datum_storage *d, adlb_data_type type,
          const adlb_buffer *caller_buffer,
          adlb_binary_data *result)
{
  switch (type)
  {
    case ADLB_DATA_TYPE_INTEGER:
      return ADLB_Pack_integer(&d->INTEGER, result);
    case ADLB_DATA_TYPE_REF:
      return ADLB_Pack_ref(&d->REF, result);
    case ADLB_DATA_TYPE_FLOAT:
      return ADLB_Pack_float(&d->FLOAT, result);
    case ADLB_DATA_TYPE_STRING:
      return ADLB_Pack_string(&d->STRING, result);
    case ADLB_DATA_TYPE_BLOB:
      return ADLB_Pack_blob(&d->BLOB, result);
    case ADLB_DATA_TYPE_FILE_REF:
      return ADLB_Pack_file_ref(&d->FILE_REF, result);
{'fraction_non_alphanumeric': 0.10406232609905398, 'fraction_numerical': 0.0, 'mean_word_length': 4.448484848484848, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 18, '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': '1738702', 'n_tokens_mistral': 702, 'n_tokens_neox': 673, 'n_words': 123}