// XXX for now, all IO is going in-process to stdout/err
-#define _stp_warn(fmt, ...) fprintf(stderr, WARN_STRING fmt "\n", ##__VA_ARGS__)
-#define _stp_error(fmt, ...) fprintf(stderr, ERR_STRING fmt "\n", ##__VA_ARGS__)
-#define _stp_softerror(fmt, ...) fprintf(stderr, ERR_STRING fmt "\n", ##__VA_ARGS__)
-#define _stp_dbug(func, line, fmt, ...) \
- fprintf(stderr, "%s:%d: " fmt "\n", (func), (line), ##__VA_ARGS__)
+/** Prints warning.
+ * This function sends a warning message immediately to staprun. It
+ * will also be sent over the bulk transport (relayfs) if it is
+ * being used. If the last character is not a newline, then one
+ * is added.
+ * @param fmt A variable number of args.
+ */
+static void _stp_warn (const char *fmt, ...)
+{
+ va_list args;
+ va_start(args, fmt);
+ fprintf(stderr, WARN_STRING);
+ vfprintf(stderr, fmt, args);
+ fprintf(stderr, "\n");
+ va_end(args);
+}
+
+
+/** Prints error message and exits.
+ * This function sends an error message immediately to staprun. It
+ * will also be sent over the bulk transport (relayfs) if it is
+ * being used. If the last character is not a newline, then one
+ * is added.
+ *
+ * After the error message is displayed, the module will be unloaded.
+ * @param fmt A variable number of args.
+ * @sa _stp_exit().
+ */
+static void _stp_error (const char *fmt, ...)
+{
+ va_list args;
+ va_start(args, fmt);
+ fprintf(stderr, ERR_STRING);
+ vfprintf(stderr, fmt, args);
+ fprintf(stderr, "\n");
+ va_end(args);
+// FIXME: need to exit here...
+// _stp_exit();
+}
+
+
+/** Prints error message.
+ * This function sends an error message immediately to staprun. It
+ * will also be sent over the bulk transport (relayfs) if it is
+ * being used. If the last character is not a newline, then one
+ * is added.
+ *
+ * @param fmt A variable number of args.
+ * @sa _stp_error
+ */
+static void _stp_softerror (const char *fmt, ...)
+{
+ va_list args;
+ va_start(args, fmt);
+ fprintf(stderr, ERR_STRING);
+ vfprintf(stderr, fmt, args);
+ fprintf(stderr, "\n");
+ va_end(args);
+}
+
+
+static void _stp_dbug (const char *func, int line, const char *fmt, ...)
+{
+ va_list args;
+ va_start(args, fmt);
+ fprintf(stderr, "%s:%d: ", func, line);
+ vfprintf(stderr, fmt, args);
+ fprintf(stderr, "\n");
+ va_end(args);
+}
#define _stp_exit() do { } while (0) // no transport, no action yet