+/* --- @remote_report@ --- *
+ *
+ * Arguments: @struct tvec_output *o@ = output sink (ignored)
+ * @unsigned level@ = message level (@TVLEV_...@)
+ * @const char *msg@, @va_list *ap@ = format string and
+ * arguments
+ *
+ * Returns: ---
+ *
+ * Use: Report a message to the user.
+ *
+ * The remote driver sends a @TVPK_REPORT@ packet to its
+ * client. If its attempt to transmit the packet fails, then
+ * the message is written to the standard error stream instead,
+ * in the hope that this will help it be noticed.
+ */
+
+static void remote_report(struct tvec_output *o, unsigned level,
+ const char *msg, va_list *ap)
+{
+ QUEUEPK(&srvtv, &srvrc, 0, TVPK_REPORT) {
+ dbuf_putu16l(&srvrc.bout, level);
+ dbuf_vputstrf16l(&srvrc.bout, msg, ap);
+ } else {
+ fprintf(stderr, "%s %s: ", QUIS, tvec_strlevel(level));
+ vfprintf(stderr, msg, *ap);
+ fputc('\n', stderr);
+ }
+}
+