static int qtm_read_input(struct qtm_stream *qtm) {
  int nread = qtm->read_cb ? qtm->read_cb(qtm->file, &qtm->inbuf[0], (int)qtm->inbuf_size) : cli_readn(qtm->fd, &qtm->inbuf[0], (int)qtm->inbuf_size);
  if (nread < 0) {
    if (qtm->file->error == CL_BREAK)
      return qtm->error = CL_BREAK;
    else
      return qtm->error = CL_EFORMAT;
  }

  qtm->i_ptr = &qtm->inbuf[0];
  qtm->i_end = &qtm->inbuf[nread];
  return CL_SUCCESS;
}
static int qtm_read_input(struct qtm_stream *qtm) {
  int nread = qtm->read_cb ? qtm->read_cb(qtm->file, &qtm->inbuf[0], (int)qtm->inbuf_size) : cli_readn(qtm->fd, &qtm->inbuf[0], (int)qtm->inbuf_size);
  if (nread < 0) {
    if (qtm->file->error == CL_BREAK)
      return qtm->error = CL_BREAK;
    else
      return qtm->error = CL_EFORMAT;
  }

  qtm->i_ptr = &qtm->inbuf[0];
  qtm->i_end = &qtm->inbuf[nread];
  return CL_SUCCESS;
}