<commit_before>/* -*- C++ -*- */

/**
 * @file   ProcessBuf.cpp
 * @author <NAME>
 * @date   Sun May 21 13:22:23 2006
 * 
 * @brief  
 * 
 * 
 */

#include "dlvhex/ProcessBuf.h"

#include <sstream>
#include <cerrno>
#include <cstdio>
#include <csignal>
#include <sys/types.h>
#include <sys/wait.h>



ProcessBuf::ProcessBuf()
  : std::streambuf(),
    bufsize(256)
{
  // ignore SIGPIPE
  struct sigaction sa;
  sa.sa_handler = SIG_IGN;
  sa.sa_flags = 0;
  ::sigemptyset(&sa.sa_mask);

  if (::sigaction(SIGPIPE, &sa, 0))
    {
      ::perror("sigaction");
      ::exit(1);
    }

  initBuffers(); // don't call virtual methods in the ctor
}


ProcessBuf::ProcessBuf(const ProcessBuf& sb)
  : std::streambuf(),<commit_msg>(ProcessBuf): sigemptyset() is a macro on macosx.<commit_after>/* -*- C++ -*- */

/**
 * @file   ProcessBuf.cpp
 * @author <NAME>
 * @date   Sun May 21 13:22:23 2006
 * 
 * @brief  
 * 
 * 
 */

#include "dlvhex/ProcessBuf.h"

#include <sstream>
#include <cerrno>
#include <cstdio>
#include <csignal>
#include <sys/types.h>
#include <sys/wait.h>



ProcessBuf::ProcessBuf()
  : std::streambuf(),
    bufsize(256)
{
  // ignore SIGPIPE
  struct sigaction sa;
  sa.sa_handler = SIG_IGN;
  sa.sa_flags = 0;
  sigemptyset(&sa.sa_mask);

  if (::sigaction(SIGPIPE, &sa, 0))
    {
      ::perror("sigaction");
      ::exit(1);
    }

  initBuffers(); // don't call virtual methods in the ctor
}


ProcessBuf::ProcessBuf(const ProcessBuf& sb)
  : std::streambuf(),
{'fraction_non_alphanumeric': 0.18243243243243243, 'fraction_numerical': 0.024324324324324326, 'mean_word_length': 3.2557471264367814, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, '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': '88328', 'n_tokens_mistral': 615, 'n_tokens_neox': 567, 'n_words': 121}