1 ///////////////////////////////////////////////////////////////////////////////
2 // Copyright (c) 2000-2015 Ericsson Telecom AB
3 // All rights reserved. This program and the accompanying materials
4 // are made available under the terms of the Eclipse Public License v1.0
5 // which accompanies this distribution, and is available at
6 // http://www.eclipse.org/legal/epl-v10.html
7 ///////////////////////////////////////////////////////////////////////////////
13 unsigned verb_level
=0x0007; /* default value */
15 const char *argv0
; /* the programname :) */
17 void fatal_error(const char *filename
, int lineno
, const char *fmt
, ...)
20 fprintf(stderr
, "FATAL ERROR: %s: In line %d of %s: ",
21 argv0
, lineno
, filename
);
22 va_start(parameters
, fmt
);
23 vfprintf(stderr
, fmt
, parameters
);
25 fprintf(stderr
, "\n");
30 void ERROR(const char *fmt
, ...)
32 fprintf(stderr
, "%s: error: ", argv0
);
34 va_start(parameters
, fmt
);
35 vfprintf(stderr
, fmt
, parameters
);
37 fprintf(stderr
, "\n");
41 void WARNING(const char *fmt
, ...)
43 if(!(verb_level
& 2)) return;
44 fprintf(stderr
, "%s: warning: ", argv0
);
46 va_start(parameters
, fmt
);
47 vfprintf(stderr
, fmt
, parameters
);
49 fprintf(stderr
, "\n");
53 void NOTSUPP(const char *fmt
, ...)
55 if(!(verb_level
& 1)) return;
56 fprintf(stderr
, "%s: warning: not supported: ", argv0
);
58 va_start(parameters
, fmt
);
59 vfprintf(stderr
, fmt
, parameters
);
61 fprintf(stderr
, "\n");
65 void NOTIFY(const char *fmt
, ...)
67 if(!(verb_level
& 4)) return;
68 fprintf(stderr
, "Notify: ");
70 va_start(parameters
, fmt
);
71 vfprintf(stderr
, fmt
, parameters
);
73 fprintf(stderr
, "\n");
77 void DEBUG(unsigned level
, const char *fmt
, ...)
79 if((level
>7?7:level
)>((verb_level
>>3)&0x07)) return;
80 fprintf(stderr
, "%*sDebug: ", level
, "");
82 va_start(parameters
, fmt
);
83 vfprintf(stderr
, fmt
, parameters
);
85 fprintf(stderr
, "\n");
This page took 0.034381 seconds and 5 git commands to generate.