Ejemplo n.º 1
0
/* _term_it_write_old(): write buffer, transferring pointer.
*/
static void
_term_it_write_old(u2_utty* uty_u,
                   u2_ubuf* old_u)
{
#if 1
  if ( !uty_u->tou_u ) {
    uty_u->out_u = uty_u->tou_u = old_u;
  }
  else {
    uty_u->tou_u->nex_u = old_u;
    uty_u->tou_u = old_u;
  }
#else
  uv_buf_t buf_u;

  //  XX extra copy here due to old code.  Use hbod as base directly.
  //
  {
    c3_y* buf_y = malloc(old_u->len_w);

    memcpy(buf_y, old_u->hun_y, old_u->len_w);
    buf_u = uv_buf_init((c3_c*)buf_y, old_u->len_w);

    free(old_u);
  }
  _term_it_write_buf(uty_u, buf_u);
#endif
}
Ejemplo n.º 2
0
Archivo: term.c Proyecto: laanwj/urbit
/* _term_it_write_old(): write buffer, transferring pointer.
*/
static void
_term_it_write_old(u3_utty* uty_u,
                   u3_ubuf* old_u)
{
  uv_buf_t buf_u;

  //  XX extra copy here due to old code.  Use hbod as base directly.
  //
  {
    c3_y* buf_y = c3_malloc(old_u->len_w);

    memcpy(buf_y, old_u->hun_y, old_u->len_w);
    buf_u = uv_buf_init((c3_c*)buf_y, old_u->len_w);

    free(old_u);
  }
  _term_it_write_buf(uty_u, buf_u);
}