print.c (133359) | print.c (139368) |
---|---|
1/* 2 * Copyright (c) Ian F. Darwin 1986-1995. 3 * Software written by Ian F. Darwin and others; 4 * maintained 1995-present by Christos Zoulas and others. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: 9 * 1. Redistributions of source code must retain the above copyright 10 * notice immediately at the beginning of the file, without modification, 11 * this list of conditions, and the following disclaimer. 12 * 2. Redistributions in binary form must reproduce the above copyright 13 * notice, this list of conditions and the following disclaimer in the 14 * documentation and/or other materials provided with the distribution. | 1/* 2 * Copyright (c) Ian F. Darwin 1986-1995. 3 * Software written by Ian F. Darwin and others; 4 * maintained 1995-present by Christos Zoulas and others. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: 9 * 1. Redistributions of source code must retain the above copyright 10 * notice immediately at the beginning of the file, without modification, 11 * this list of conditions, and the following disclaimer. 12 * 2. Redistributions in binary form must reproduce the above copyright 13 * notice, this list of conditions and the following disclaimer in the 14 * documentation and/or other materials provided with the distribution. |
15 * 3. All advertising materials mentioning features or use of this software 16 * must display the following acknowledgement: 17 * This product includes software developed by Ian F. Darwin and others. 18 * 4. The name of the author may not be used to endorse or promote products 19 * derived from this software without specific prior written permission. | |
20 * 21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR 25 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) --- 13 unchanged lines hidden (view full) --- 41#include <stdarg.h> 42#include <stdlib.h> 43#ifdef HAVE_UNISTD_H 44#include <unistd.h> 45#endif 46#include <time.h> 47 48#ifndef lint | 15 * 16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 17 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR 20 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) --- 13 unchanged lines hidden (view full) --- 36#include <stdarg.h> 37#include <stdlib.h> 38#ifdef HAVE_UNISTD_H 39#include <unistd.h> 40#endif 41#include <time.h> 42 43#ifndef lint |
49FILE_RCSID("@(#)$Id: print.c,v 1.44 2003/09/12 19:39:44 christos Exp $") | 44FILE_RCSID("@(#)$Id: print.c,v 1.46 2004/11/13 08:11:39 christos Exp $") |
50#endif /* lint */ 51 52#define SZOF(a) (sizeof(a) / sizeof(a[0])) 53 54#ifndef COMPILE_ONLY 55protected void 56file_mdump(struct magic *m) 57{ --- 79 unchanged lines hidden (view full) --- 137 } 138 } 139 (void) fprintf(stderr, ",\"%s\"]\n", m->desc); 140} 141#endif 142 143/*VARARGS*/ 144protected void | 45#endif /* lint */ 46 47#define SZOF(a) (sizeof(a) / sizeof(a[0])) 48 49#ifndef COMPILE_ONLY 50protected void 51file_mdump(struct magic *m) 52{ --- 79 unchanged lines hidden (view full) --- 132 } 133 } 134 (void) fprintf(stderr, ",\"%s\"]\n", m->desc); 135} 136#endif 137 138/*VARARGS*/ 139protected void |
145file_magwarn(const char *f, ...) | 140file_magwarn(struct magic_set *ms, const char *f, ...) |
146{ 147 va_list va; 148 va_start(va, f); 149 150 /* cuz we use stdout for most, stderr here */ 151 (void) fflush(stdout); 152 | 141{ 142 va_list va; 143 va_start(va, f); 144 145 /* cuz we use stdout for most, stderr here */ 146 (void) fflush(stdout); 147 |
153 (void) fprintf(stderr, "WARNING: "); | 148 (void) fprintf(stderr, "%s, %lu: Warning ", ms->file, 149 (unsigned long)ms->line); |
154 (void) vfprintf(stderr, f, va); 155 va_end(va); 156 fputc('\n', stderr); 157} 158 159protected char * 160file_fmttime(uint32_t v, int local) 161{ --- 30 unchanged lines hidden --- | 150 (void) vfprintf(stderr, f, va); 151 va_end(va); 152 fputc('\n', stderr); 153} 154 155protected char * 156file_fmttime(uint32_t v, int local) 157{ --- 30 unchanged lines hidden --- |