"Fossies" - the Fresh Open Source Software Archive 
Member "qdiff-0.9.1/terror.cc" (21 Oct 2008, 2185 Bytes) of package /linux/privat/old/qdiff-0.9.1.tar.gz:
As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style:
standard) with prefixed line numbers and
code folding option.
Alternatively you can here
view or
download the uninterpreted source code file.
For more information about "terror.cc" see the
Fossies "Dox" file reference documentation.
1 /*GPL*START*
2 * terror - error handling and reporting for a tapplication
3 *
4 * Copyright (C) 1998 by Johannes Overmann <overmann@iname.com>
5 * Copyright (C) 2008 by Tong Sun <suntong001@users.sourceforge.net>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 * *GPL*END*/
21
22
23
24 #include <stdarg.h>
25 #include <stdio.h>
26 #include <stdlib.h>
27 #define _in_terror_cc_
28 #include "terror.h"
29
30 // history:
31 // 1999:
32 // 14:06 15 Feb terror.cc derived from tobject.cc
33 // 21:12 25 Aug noreturn hack for gcc2.95.1
34 // 2008-10-19 Fix missing #include for gcc 4.3
35
36
37 // global data:
38
39 // application name set by TAppconfig:
40 //const char *terrorApplicationName = 0;
41
42
43 /*
44 void userWarning(const char *message, ...) {
45 va_list ap;
46
47 va_start(ap, message);
48 if(terrorApplicationName) fprintf(stderr, "\r%s warning: ", terrorApplicationName);
49 else fprintf(stderr, "\rwarning: ");
50 vfprintf(stderr, message, ap);
51 va_end(ap);
52 }
53
54 void userError(const char *message, ...) {
55 va_list ap;
56
57 va_start(ap, message);
58 if(terrorApplicationName) fprintf(stderr, "\r%s: ", terrorApplicationName);
59 else fprintf(stderr, "\rerror: ");
60 vfprintf(stderr, message, ap);
61 va_end(ap);
62 exit(1);
63 }
64 */
65
66 void fatalError_func2(const char *message, ...) {
67 va_list ap;
68
69 va_start(ap, message);
70 vfprintf(stderr, message, ap);
71 va_end(ap);
72 exit(1);
73 }
74
75
76 void fatalError_func1(const char *file, int line, const char *function) {
77 fprintf(stderr, "%s(%d): fatal error in function '%s':\n", file, line, function);
78 }
79
80