Ejemplo n.º 1
0
int	write_args(t_arg *arg, int fd, t_label *label, int decal)
{
  if ((arg->type == 1 && write_registers(arg, fd) == 1) ||
      (arg->type == 2 && write_direct(arg, fd, label, decal) == 1) ||
      (arg->type == 3 && write_indirects(arg, fd) == 1) ||
      (arg->type == 4 && write_odds(arg, fd, label, decal) == 1))
    return (1);
  return (0);
}
Ejemplo n.º 2
0
ssize_t mailstream_write(mailstream * s, const void * buf, size_t count)
{
  int r;

  if (s == NULL)
    return -1;

  if (count + s->write_buffer_len > s->buffer_max_size) {
    r = mailstream_flush(s);
    if (r == -1)
      return -1;

    if (count > s->buffer_max_size)
      return write_direct(s, buf, count);
  }

  return write_to_internal_buffer(s, buf, count);
}