File: error.c

package info (click to toggle)
shhmsg 1.3.4-1.1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 104 kB
  • ctags: 72
  • sloc: ansic: 276; makefile: 123
file content (50 lines) | stat: -rw-r--r-- 1,623 bytes parent folder | download
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
50
/* $Id: error.c,v 1.5 1998/07/05 16:57:03 sverrehu Exp $ */
/**************************************************************************
 *
 *  FILE            error.c
 *  MODULE OF       shhmsg - library for displaying messages.
 *
 *  DESCRIPTION     Function for displaying a simple error message.
 *
 *  WRITTEN BY      Sverre H. Huseby <sverrehu@online.no>
 *
 **************************************************************************/

#include <stdio.h>
#include <stdarg.h>

#include "internal.h"
#include "shhmsg.h"

/**************************************************************************
 *                                                                        *
 *                    P U B L I C    F U N C T I O N S                    *
 *                                                                        *
 **************************************************************************/

/*-------------------------------------------------------------------------
 *
 *  NAME          msgError
 *
 *  FUNCTION      Show given message on the _msgErrorStream.
 *
 *  SYNOPSIS      #include "shhmsg.h"
 *                void msgError(const char *format, ...);
 *
 *  INPUT         format, ...
 *                        Arguments used as with printf().
 *
 *  DESCRIPTION   Prints the name of this program followed by ": " and the
 *                given message on the _msgErrorStream.
 */
void
msgError(const char *format, ...)
{
    va_list ap;

    fflush(stdout);
    fprintf(_msgErrorStream, "%s: ", msgGetName());
    va_start(ap, format);
    vfprintf(_msgErrorStream, format, ap);
    va_end(ap);
}