* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The name(s) of the authors of this software must not be used to
+ * 2. The name(s) of the authors of this software must not be used to
* endorse or promote products derived from this software without
* prior written permission.
*
- * 4. Redistributions of any form whatsoever must retain the following
+ * 3. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by Paul Mackerras
* <paulus@samba.org>".
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#define RCSID "$Id: utils.c,v 1.23 2004/01/13 04:13:08 paulus Exp $"
+#define RCSID "$Id: utils.c,v 1.25 2008/06/03 12:06:37 paulus Exp $"
#include <stdio.h>
#include <ctype.h>
static void logit __P((int, char *, va_list));
static void log_write __P((int, char *));
static void vslp_printer __P((void *, char *, ...));
-static void format_packet __P((u_char *, int, void (*) (void *, char *, ...),
- void *));
+static void format_packet __P((u_char *, int, printer_func, void *));
struct buffer_info {
char *ptr;
base = 10;
break;
default:
- *buf++ = '%'; --buflen;
- *buf++ = 'l'; --buflen;
+ OUTCHAR('%');
+ OUTCHAR('l');
--fmt; /* so %lz outputs %lz etc. */
continue;
}
format_packet(p, len, printer, arg)
u_char *p;
int len;
- void (*printer) __P((void *, char *, ...));
+ printer_func printer;
void *arg;
{
int i, n;
void
init_pr_log(prefix, level)
- char *prefix;
+ const char *prefix;
int level;
{
linep = line;
print_string(p, len, printer, arg)
char *p;
int len;
- void (*printer) __P((void *, char *, ...));
+ printer_func printer;
void *arg;
{
int c;
char *fmt;
va_list args;
{
- int n;
char buf[1024];
- n = vslprintf(buf, sizeof(buf), fmt, args);
+ vslprintf(buf, sizeof(buf), fmt, args);
log_write(level, buf);
}