|
| iMatix home page | << | < | > | >> |
SMTVersion 2.81 |
#include "smtlib.h" int sendfmt (const QID *to_queue, char *name, char *format, ...)
Sends a text message to the specified queue. The caller can specify a printf()-type format string and insertion values. Return values are the same as for event send().
sendfmt (&console, "INFO", "Error accessing %s file", filename);
{
static char
formatted [4096]; /* Formatted string */
va_list
argptr; /* Argument list pointer */
#if (defined (SMT_TRACE))
trace ("sendfmt: name=%s format=%s", name, format);
#endif
va_start (argptr, format); /* Start variable args processing */
#if (defined (DOES_SNPRINTF))
vsnprintf (formatted, 4096, format, argptr);
#else
vsprintf (formatted, format, argptr);
#endif
va_end (argptr); /* End variable args processing */
return (event send (
to_queue, /* Send to specified queue */
NULL, /* No queue for reply */
name, /* Name of event to send */
(byte *) formatted, /* Event body to send */
strlen (formatted) + 1, /* Event body size, including null */
NULL, NULL, NULL, /* No response events */
0)); /* No timeout */
}
| | << | < | > | >> |
|