libarchive_read_read_cb (struct archive  *ar_read,
                         void            *client_data,
                         const void     **buffer)
{
  AutoarExtractor *self;
  gssize read_size;

  g_debug ("libarchive_read_read_cb: called");

  self = AUTOAR_EXTRACTOR (client_data);

  if (self->error != NULL || self->istream == NULL)
    return -1;

  *buffer = self->buffer;
  read_size = g_input_stream_read (self->istream,
                                   self->buffer,
                                   self->buffer_size,
                                   self->cancellable,
                                   &(self->error));
  if (self->error != NULL)
    return -1;

  g_debug ("libarchive_read_read_cb: %" G_GSSIZE_FORMAT, read_size);
  return read_size;
}
libarchive_read_read_cb (struct archive  *ar_read,
                         void            *client_data,
                         const void     **buffer)
{
  AutoarExtractor *self;
  gssize read_size;

  g_debug ("libarchive_read_read_cb: called");

  self = AUTOAR_EXTRACTOR (client_data);

  if (self->error != NULL || self->istream == NULL)
    return -1;

  *buffer = self->buffer;
  read_size = g_input_stream_read (self->istream,
                                   self->buffer,
                                   self->buffer_size,
                                   self->cancellable,
                                   &(self->error));
  if (self->error != NULL)
    return -1;

  g_debug ("libarchive_read_read_cb: %" G_GSSIZE_FORMAT, read_size);
  return read_size;
}