~ubuntu-branches/ubuntu/breezy/garlic/breezy

« back to all changes in this revision

Viewing changes to errmsg.c

  • Committer: Bazaar Package Importer
  • Author(s): zhaoway
  • Date: 2001-04-24 07:09:13 UTC
  • Revision ID: james.westby@ubuntu.com-20010424070913-uzpupnwdfhmliebz
Tags: upstream-1.1
ImportĀ upstreamĀ versionĀ 1.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright (C) 2000 Damir Zucic */
 
2
 
 
3
/*=============================================================================
 
4
 
 
5
                                errmsg.c
 
6
 
 
7
Purpose:
 
8
        Print error message.
 
9
 
 
10
Input:
 
11
        (1) Program name.
 
12
        (2) Name of the function where error occured.
 
13
        (3) Name of the file which caused trouble, if file caused trouble.
 
14
        (4) \
 
15
        (5)  \   ... Error message, split into four strings.
 
16
        (6)  /       Don't forget to put newline somewhere!
 
17
        (7) /
 
18
 
 
19
Output:
 
20
        (1) Error message written to stderr.
 
21
 
 
22
Return value:
 
23
        No return value.
 
24
 
 
25
========includes:============================================================*/
 
26
 
 
27
#include <stdio.h>
 
28
#include <string.h>
 
29
 
 
30
/*======print error message:=================================================*/
 
31
 
 
32
/* Note: there is no newline in the last four fprintf! */
 
33
 
 
34
void ErrorMessage_ (char *module, char *function, char *filename,
 
35
                    char *s1, char *s2, char *s3, char *s4)
 
36
{
 
37
fprintf (stderr, "\nERROR>");
 
38
fprintf (stderr, " module: %s, function: %s", module, function);
 
39
if (strlen (filename) != 0) fprintf (stderr, ", file: %s", filename);
 
40
fprintf (stderr, "\n");
 
41
if (strlen (s1) != 0) fprintf (stderr, "%s", s1);
 
42
if (strlen (s2) != 0) fprintf (stderr, "%s", s2);
 
43
if (strlen (s3) != 0) fprintf (stderr, "%s", s3);
 
44
if (strlen (s4) != 0) fprintf (stderr, "%s", s4);
 
45
}
 
46
 
 
47
/*===========================================================================*/
 
48
 
 
49