<commit_before>/* v/term.c
**
** This file is in the public domain.
*/
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <unistd.h>
#include <setjmp.h>
#include <gmp.h>
#include <stdint.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <uv.h>
#include <errno.h>
#include <curses.h>
#include <termios.h>
#include <term.h>

#include "all.h"
#include "v/vere.h"

static void _term_read_cb(uv_stream_t*, ssize_t, uv_buf_t);

/* _term_alloc(): libuv buffer allocator.
*/
static uv_buf_t
_term_alloc(uv_handle_t* had_u, size_t len_i)
{
  return uv_buf_init(c3_malloc(len_i), len_i);
}

/* u2_term_io_init(): initialize terminal.
*/
void
u2_term_io_init()
{
  u2_utty* uty_u = c3_malloc(sizeof(u2_utty));

  if ( u2_yes == u2_Host.ops_u.dem ) {
    uty_u->fid_i = 1;

    uv_pipe_init(u2L, &(uty_u->pop_u), 0);
    uv_pipe_open(&(uty_u->pop_u), uty_u->fid_i);
  }
  else {
    //  Initialize event processing.  Rawdog it.<commit_msg>fix bogosity caused by uninitialized memory<commit_after>/* v/term.c
**
** This file is in the public domain.
*/
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <unistd.h>
#include <setjmp.h>
#include <gmp.h>
#include <stdint.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <uv.h>
#include <errno.h>
#include <curses.h>
#include <termios.h>
#include <term.h>

#include "all.h"
#include "v/vere.h"

static void _term_read_cb(uv_stream_t*, ssize_t, uv_buf_t);

/* _term_alloc(): libuv buffer allocator.
*/
static uv_buf_t
_term_alloc(uv_handle_t* had_u, size_t len_i)
{
  return uv_buf_init(c3_malloc(len_i), len_i);
}

/* u2_term_io_init(): initialize terminal.
*/
void
u2_term_io_init()
{
  u2_utty* uty_u = calloc(1, sizeof(u2_utty));

  if ( u2_yes == u2_Host.ops_u.dem ) {
    uty_u->fid_i = 1;

    uv_pipe_init(u2L, &(uty_u->pop_u), 0);
    uv_pipe_open(&(uty_u->pop_u), uty_u->fid_i);
  }
  else {
    //  Initialize event processing.  Rawdog it.
{'fraction_non_alphanumeric': 0.17127344521224086, 'fraction_numerical': 0.01085883514313919, 'mean_word_length': 4.434316353887399, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 43, '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': '993715', 'n_tokens_mistral': 941, 'n_tokens_neox': 923, 'n_words': 179}