Example #1
0
int pr_netio_printf(pr_netio_stream_t *nstrm, const char *fmt, ...) {
  int res;
  va_list msg;

  if (!nstrm) {
    errno = EINVAL;
    return -1;
  }

  va_start(msg, fmt);
  res = pr_netio_vprintf(nstrm, fmt, msg);
  va_end(msg);

  return res;
}
Example #2
0
int proxy_netio_printf(pr_netio_stream_t *nstrm, const char *fmt, ...) {
  int res, xerrno;
  va_list msg;
  pr_netio_t *curr_netio = NULL;

  if (nstrm == NULL) {
    errno = EINVAL;
    return -1;
  }

  curr_netio = proxy_netio_unset(nstrm->strm_type, "netio_printf");
  va_start(msg, fmt);
  res = pr_netio_vprintf(nstrm, fmt, msg);
  xerrno = errno;
  va_end(msg);
  proxy_netio_set(nstrm->strm_type, curr_netio);

  errno = xerrno;
  return res;
}