Subversion Repositories Kolibri OS

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
8335 maxcodehac 1
 
2
   GNU UnRTF, a command-line program to convert RTF documents to other formats.
3
   Copyright (C) 2000,2001 Zachary Thayer Smith
4
5
 
6
   it under the terms of the GNU General Public License as published by
7
   the Free Software Foundation; either version 2 of the License, or
8
   (at your option) any later version.
9
10
 
11
   but WITHOUT ANY WARRANTY; without even the implied warranty of
12
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
   GNU General Public License for more details.
14
15
 
16
   along with this program; if not, write to the Free Software
17
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18
19
 
20
=============================================================================*/
21
22
 
23
 
24
 * Module name:    error
25
 * Author name:    Zach Smith
26
 * Create date:    01 Sep 00
27
 * Purpose:        Management of errors and warnings, when reporting
28
 *                 the source code file/line is not necessary.
29
 *----------------------------------------------------------------------
30
 * Changes
31
 * 10 Oct 00, tuorfa@yahoo.com: added usage()
32
 * 15 Oct 00, tuorfa@yahoo.com: improved output readability
33
 * 22 Sep 01, tuorfa@yahoo.com: removed mention of line number in handlers
34
 * 22 Sep 01, tuorfa@yahoo.com: added function-level comment blocks
35
 *--------------------------------------------------------------------*/
36
37
 
38
 
39
#include 
40
41
 
42
#include "main.h"
43
44
 
45
 
46
 
47
 * Name:	usage
48
 * Purpose:	Prints usage information and exits with an error.
49
 * Args:	None.
50
 * Returns:	None.
51
 *=======================================================================*/
52
53
 
54
usage ()
55
{
56
	fprintf (stdout, "Usage: %s\n", USAGE);
57
	exit(0);
58
}
59
60
 
61
 
62
 
63
 * Name:	error_handler
64
 * Purpose:	Prints error message and other useful info, then exits.
65
 * Args:	Message.
66
 * Returns:	None.
67
 *=======================================================================*/
68
69
 
70
error_handler (char* message)
71
{
72
	fprintf (stderr, "Error: %s\n", message);
73
	exit(10);
74
}
75
76
 
77
 
78
 * Name:	warning_handler
79
 * Purpose:	Prints useful info to stderr, but doesn't exit.
80
 * Args:	Message.
81
 * Returns:	None.
82
 *=======================================================================*/
83
84
 
85
warning_handler (char* message)
86
{
87
	fprintf (stderr, "Warning: %s\n", message);
88
}
89