-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtools.c
34 lines (32 loc) · 1.04 KB
/
tools.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/* NOTE: This program is free software; you can redistribute it
* and/or modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 3, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* Bugs can be reported to Yu Zhang <[email protected]>.
*
* File Name : tools.c
* Last Modified : Wed 25 Sep 2013 12:26:30 PM EDT
*/
#include "tools.h"
#define DEBUG 1
void notice(const char *file, int line, const char *func, const char *fmt, ...)
{
va_list ap;
va_start(ap,fmt);
if (DEBUG)
{
if (file) fprintf(stderr, KRED "%s ", file);
if (line) fprintf(stderr, KRED "%d ", line);
if (func) fprintf(stderr, KRED "in %s() ", func);
fprintf(stderr, KRED ": " KCYN);
}
vfprintf(stderr, fmt, ap);
va_end(ap);
fprintf(stderr, KNRM "\n");
}