123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- #ifndef CONFIRM_SOURCE
- #define CONFIRM_SOURCE
- #include <stdio.h>
- #include <stdarg.h>
- #include "../plc/plc.h"
- #include "../tools/memory.h"
- #include "../tools/flags.h"
- #ifdef __GNUC__
- __attribute__ ((format (printf, 2, 3)))
- #endif
- void Confirm (struct plc * plc, char const *format, ...)
- {
- if (_allclr (plc->flags, PLC_SILENCE))
- {
- char address [ETHER_ADDR_LEN * 3];
- struct channel * channel = (struct channel *)(plc->channel);
- struct message * message = (struct message *)(plc->message);
- hexdecode (message->ethernet.OSA, sizeof (message->ethernet.OSA), address, sizeof (address));
- fprintf (stderr, "%s %s ", channel->ifname, address);
- if ((format) && (*format))
- {
- va_list arglist;
- va_start (arglist, format);
- vfprintf (stderr, format, arglist);
- va_end (arglist);
- }
- fprintf (stderr, "\n");
- }
- return;
- }
- #endif
|