File: shhmsg.h

package info (click to toggle)
shhmsg 1.4.1-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 148 kB
  • ctags: 78
  • sloc: ansic: 319; makefile: 134; sh: 10
file content (63 lines) | stat: -rw-r--r-- 1,542 bytes parent folder | download | duplicates (7)
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
51
52
53
54
55
56
57
58
59
60
61
62
63
/* $Id: shhmsg.h,v 1.5 1997/05/27 21:11:06 sverrehu Exp $ */
#ifndef SHHMSG_H
#define SHHMSG_H

#include <stdio.h> /* FILE */

#ifdef __cplusplus
extern "C" {
#endif

#ifdef __GNUC__
#define MSG_NORET __attribute__ ((noreturn))
#define MSG_FORMAT_1 __attribute__ ((format (printf, 1, 2)))
#define MSG_FORMAT_2 __attribute__ ((format (printf, 2, 3)))
#else
#define MSG_NORET
#define MSG_FORMAT_1
#define MSG_FORMAT_2
#endif

/* program name functions */
void msgSetName(const char *s);
char *msgGetName(void);

/* error functions */
void msgError(const char *format, ...) MSG_FORMAT_1 ;
void msgFatal(const char *format, ...) MSG_FORMAT_1 MSG_NORET ;
void msgPerror(const char *format, ...) MSG_FORMAT_1 ;
void msgFatalPerror(const char *format, ...) MSG_FORMAT_1 ;

/* message output functions */
void msgMessage(const char *format, ...) MSG_FORMAT_1 ;
void msgVerbose(int level, const char *format, ...) MSG_FORMAT_2 ;

/* output control functions */
void msgSetQuiet(int onoff);
void msgSetVerbose(int level);
void msgSetShowNameAlways(int onoff);
FILE *msgSetErrorStream(FILE *f);
FILE *msgSetVerboseStream(FILE *f);
FILE *msgSetMessageStream(FILE *f);

/* constants */
#define MSG_VERBOSE_DEFAULT -1
#define MSG_VERBOSE_NONE     0
#define MSG_ON               1
#define MSG_OFF              0
#define MSG_QUIET            1
#define MSG_OUTPUT           0

/* variables that may be changed */
extern int msgVerboseLevel;
extern int msgBeQuiet;

#undef MSG_NORET
#undef MSG_FORMAT_1
#undef MSG_FORMAT_2

#ifdef __cplusplus
}
#endif

#endif