File: warnmsg.c

package info (click to toggle)
garlic 1.6-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 4,516 kB
  • sloc: ansic: 52,465; makefile: 2,254
file content (49 lines) | stat: -rw-r--r-- 1,381 bytes parent folder | download | duplicates (6)
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/* Copyright (C) 2000 Damir Zucic */

/*=============================================================================

				warnmsg.c

Purpose:
	Print warning message.

Input:
	(1) Program name.
	(2) Name of the function where something strange happened.
	(3) Name of the file which caused trouble, if file caused trouble.
	(4) \
	(5)  \   ... Warning message, split into four strings.
	(6)  /       Don't forget to put newline somewhere!
	(7) /

Output:
	(1) Warning message written to stdout.

Return value:
	No return value.

========includes:============================================================*/

#include <stdio.h>
#include <string.h>

/*======print warning message:===============================================*/

/* Note: there is no newline in the last four fprintf! */

void WarningMessage_ (char *module, char *function, char *filename,
		      char *s1, char *s2, char *s3, char *s4)
{
fprintf (stdout, "WARNING>");
fprintf (stdout, " module: %s, function: %s", module, function);
if (strlen (filename) != 0) fprintf (stdout, ", file: %s", filename);
fprintf (stdout, "\n");
if (strlen (s1) != 0) fprintf (stdout, "%s", s1);
if (strlen (s2) != 0) fprintf (stdout, "%s", s2);
if (strlen (s3) != 0) fprintf (stdout, "%s", s3);
if (strlen (s4) != 0) fprintf (stdout, "%s", s4);
}

/*===========================================================================*/