<commit_before>/*
 * Copyright (C) 2013-2016 Argonne National Laboratory, Department of Energy,
 *                    UChicago Argonne, LLC and The HDF Group.
 * All rights reserved.
 *
 * The full copyright notice, including terms governing use, modification,
 * and redistribution, is contained in the COPYING file that can be
 * found at the root of the source code distribution tree.
 */

#ifndef _WIN32
  #define HG_PROC_HEADER_INLINE
#endif
#include "mercury_proc_header.h"
#include "mercury_proc.h"

#ifdef HG_HAS_CHECKSUMS
  #include <mchecksum.h>
  #include <mchecksum_error.h>
#endif

#ifdef _WIN32
  #include <winsock2.h>
#else
  #include <arpa/inet.h>
#endif
#include <stdlib.h>

/****************/
/* Local Macros */
/****************/

/************************************/
/* Local Type and Struct Definition */
/************************************/

/********************/
/* Local Prototypes */
/********************/
extern const char *
HG_Error_to_string(
        hg_return_t errnum
        );

/*******************/
/* Local Variables */
/*******************/

/*---------------------------------------------------------------------------*/
void
hg_proc_header_request_init(hg_id_t id, hg_bulk_t extra_in_handle,
    struct hg_header_request *header)
{
    header->hg = HG_IDENTIFIER;
    header->protocol = HG_PROTOCOL_VERSION;
    header->id = id;
    header->flags = (hg_uint8_t) (extra_in_handle != HG_BULK_NULL);
    header->cookie = (hg_uint32_t) rand();
    header->crc16 = 0;
    header->extra_in_handle = extra_in_handle;
}

/*---------------------------------------------------------------------------*/
void
hg_proc_header_response_init(struct hg_header_response *header)
{
    header->flags = 0;
    header->ret_code = 0;
    header->cookie = 0;
    header->crc16 = 0;
}

/*---------------------------------------------------------------------------*/
hg_return_t
hg_proc_header_request(void *buf, size_t buf_size,
    struct hg_header_request *header, hg_proc_op_t op, hg_class_t *hg_class,
    hg_size_t *extra_header_size)<commit_msg>Disable cookie for now (fixes #137)<commit_after>/*
 * Copyright (C) 2013-2016 Argonne National Laboratory, Department of Energy,
 *                    UChicago Argonne, LLC and The HDF Group.
 * All rights reserved.
 *
 * The full copyright notice, including terms governing use, modification,
 * and redistribution, is contained in the COPYING file that can be
 * found at the root of the source code distribution tree.
 */

#ifndef _WIN32
  #define HG_PROC_HEADER_INLINE
#endif
#include "mercury_proc_header.h"
#include "mercury_proc.h"

#ifdef HG_HAS_CHECKSUMS
  #include <mchecksum.h>
  #include <mchecksum_error.h>
#endif

#ifdef _WIN32
  #include <winsock2.h>
#else
  #include <arpa/inet.h>
#endif
#include <stdlib.h>

/****************/
/* Local Macros */
/****************/

/************************************/
/* Local Type and Struct Definition */
/************************************/

/********************/
/* Local Prototypes */
/********************/
extern const char *
HG_Error_to_string(
        hg_return_t errnum
        );

/*******************/
/* Local Variables */
/*******************/

/*---------------------------------------------------------------------------*/
void
hg_proc_header_request_init(hg_id_t id, hg_bulk_t extra_in_handle,
    struct hg_header_request *header)
{
    header->hg = HG_IDENTIFIER;
    header->protocol = HG_PROTOCOL_VERSION;
    header->id = id;
    header->flags = (hg_uint8_t) (extra_in_handle != HG_BULK_NULL);
    header->cookie = 0; /* TODO not used for now */
    header->crc16 = 0;
    header->extra_in_handle = extra_in_handle;
}

/*---------------------------------------------------------------------------*/
void
hg_proc_header_response_init(struct hg_header_response *header)
{
    header->flags = 0;
    header->ret_code = 0;
    header->cookie = 0;
    header->crc16 = 0;
}

/*---------------------------------------------------------------------------*/
hg_return_t
hg_proc_header_request(void *buf, size_t buf_size,
    struct hg_header_request *header, hg_proc_op_t op, hg_class_t *hg_class,
    hg_size_t *extra_header_size)
{'fraction_non_alphanumeric': 0.28636472561706205, 'fraction_numerical': 0.012461059190031152, 'mean_word_length': 2.5134680134680134, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 35, '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': '631901', 'n_tokens_mistral': 1338, 'n_tokens_neox': 1250, 'n_words': 296}