File: error.h

package info (click to toggle)
kdebase 2%3A980312-8
  • links: PTS
  • area: contrib
  • in suites: hamm
  • size: 16,500 kB
  • ctags: 11,017
  • sloc: cpp: 77,278; ansic: 14,050; makefile: 2,643; sh: 2,151; perl: 844
file content (36 lines) | stat: -rw-r--r-- 641 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
// Error management class
//
// contains error status and last error (at least I will one day)
//
// Copyright (C) Martin R. Jones 1995
//

#ifndef __ERROR_H__
#define __ERROR_H__

#define ERR_NONE		0
#define ERR_FATAL		1
#define ERR_WARNING		2

void DefHandler(int type, const char *theMsg);

// ============================================================================
class cError
{
	int type;
	const char *desc;
	void (*handler)(int, const char *);

public:
	cError();

	void Set(int theType, const char *theDesc);

	void SetHandler(void (*theHandler)(int, const char *))
		{	handler = theHandler; }
};

extern cError Error;

#endif