<commit_before>/*
 * Copyright 2007-2014 National ICT Australia (NICTA)
 *
 * This software may be used and distributed solely under the terms of
 * the MIT license (License).  You should find a copy of the License in
 * COPYING or at http://opensource.org/licenses/MIT. By downloading or
 * using this software you accept the terms and the liability disclaimer
 * in the License.
 */
/** \file bin_writer.c
 * \brief An implementation of the OmlWriter interface functions (see oml2/oml_writer.h) that writes messages using the OML binary protocol \ref omspbin.
 */

#include <stdlib.h>
#include <stdlib.h>
#include <string.h>

#include "oml2/omlc.h"
#include "oml2/oml_writer.h"
#include "oml2/oml_filter.h"
#include "ocomm/o_socket.h"
#include "ocomm/o_log.h"
#include "client.h"
#include "marshal.h"
#include "mbuf.h"
#include "buffered_writer.h"
#include "assert.h"

#define DEF_PROTOCOL "tcp"
#define DEF_PORT 3003

/** An OmlWriter using the binary marshalling functions \ref omspbin */
typedef struct OmlBinWriter {

  /*
   * Fields from OmlWriter interface
   */

  /** \see OmlWriter::meta */
  oml_writer_meta meta;
  /** \see OmlWriter::header_done */
  oml_writer_header_done header_done;
  /** \see OmlWriter::row_start */
  oml_writer_row_start row_start;
  /** \see OmlWriter::row_end */
  oml_writer_row_end row_end;
  /** \see OmlWriter::out */
  oml_writer_out out;
  /** \see OmlWriter::close */
  oml_writer_close close;
  /** \see OmlWriter::next */<commit_msg>Cleanup in lib/client/bin_writer.c<commit_after>/*
 * Copyright 2007-2014 National ICT Australia (NICTA)
 *
 * This software may be used and distributed solely under the terms of
 * the MIT license (License).  You should find a copy of the License in
 * COPYING or at http://opensource.org/licenses/MIT. By downloading or
 * using this software you accept the terms and the liability disclaimer
 * in the License.
 */
/** \file bin_writer.c
 * \brief An implementation of the OmlWriter interface functions (see oml2/oml_writer.h) that writes messages using the OML binary protocol \ref omspbin.
 */

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

#include "oml2/omlc.h"
#include "oml2/oml_writer.h"
#include "oml2/oml_filter.h"
#include "ocomm/o_socket.h"
#include "ocomm/o_log.h"
#include "client.h"
#include "marshal.h"
#include "mbuf.h"
#include "buffered_writer.h"

/** An OmlWriter using the binary marshalling functions \ref omspbin */
typedef struct OmlBinWriter {

  /*
   * Fields from OmlWriter interface
   */

  /** \see OmlWriter::meta */
  oml_writer_meta meta;
  /** \see OmlWriter::header_done */
  oml_writer_header_done header_done;
  /** \see OmlWriter::row_start */
  oml_writer_row_start row_start;
  /** \see OmlWriter::row_end */
  oml_writer_row_end row_end;
  /** \see OmlWriter::out */
  oml_writer_out out;
  /** \see OmlWriter::close */
  oml_writer_close close;
  /** \see OmlWriter::next */
{'fraction_non_alphanumeric': 0.12087163772557032, 'fraction_numerical': 0.009533537623425264, 'mean_word_length': 4.005110732538331, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1424361', 'n_tokens_mistral': 1042, 'n_tokens_neox': 1007, 'n_words': 294}