Last change
on this file since 88e890 was e6a122, checked in by Frederik Heber <heber@…>, 17 years ago |
Error(): Idea and code taken from TREMOLO, now prints line number and sourc file name
|
-
Property mode
set to
100644
|
File size:
1.4 KB
|
Rev | Line | |
---|
[a0bcf1] | 1 | #ifndef errors_h
|
---|
| 2 | #define errors_h
|
---|
| 3 |
|
---|
| 4 | /** \file errors.h
|
---|
| 5 | * Header file for \ref errors.c
|
---|
| 6 | *
|
---|
| 7 | * Contains declarations of the functions implemented in \ref errors.c and
|
---|
| 8 | * the enumeration of the error class Errors.
|
---|
| 9 | *
|
---|
| 10 | Project: ParallelCarParrinello
|
---|
| 11 | Jan Hamaekers
|
---|
| 12 | 2000
|
---|
| 13 |
|
---|
| 14 | File: errors.h
|
---|
| 15 | $Id: errors.h,v 1.7 2006/03/30 22:19:52 foo Exp $
|
---|
| 16 | */
|
---|
| 17 |
|
---|
[e6a122] | 18 | // taken out of TREMOLO
|
---|
| 19 | /*@-namechecks@*/
|
---|
| 20 | #ifndef __GNUC__
|
---|
| 21 | # undef __attribute__
|
---|
| 22 | # define __attribute__(x)
|
---|
| 23 | #endif
|
---|
| 24 | /*@=namechecks@*/
|
---|
[a0bcf1] | 25 |
|
---|
| 26 | /* Verschiedene Fehlertypen */
|
---|
| 27 | enum Errors { SomeError, //!< some unclassified error
|
---|
| 28 | FileOpenParams, //!< Error opening parameter file
|
---|
| 29 | InitReading, //!< Error parsing parameter file
|
---|
| 30 | MallocError //!< Error while allocating memory
|
---|
| 31 | };
|
---|
| 32 | /* SomeError: Falls man noch zu faul ist */
|
---|
| 33 |
|
---|
[e6a122] | 34 |
|
---|
[a0bcf1] | 35 | /* Behandelt aufgetretene Fehler. error ist der Fehlertyp(enum Errors)
|
---|
| 36 | void *SpecialData ist ein untypisierter Zeiger auf Spezielle Daten zur Fehlerbehandlung.
|
---|
| 37 | Man koennte auch noch einen Zeiger auf eine Funktion uebergeben */
|
---|
[e6a122] | 38 | extern void /*@exits@*/ Error(enum Errors error, /*@null@*/ const void *SpecialData)
|
---|
| 39 | __attribute__ ((__noreturn__));
|
---|
| 40 | #define Error(err, data) Error_in((err), (data), __FILE__, __LINE__)
|
---|
| 41 |
|
---|
| 42 | extern void /*@exits@*/ Error_in(enum Errors error, /*@null@*/ const void *SpecialData,
|
---|
| 43 | const char *file, const int line)
|
---|
| 44 | __attribute__ ((__noreturn__));
|
---|
[a0bcf1] | 45 |
|
---|
| 46 | #endif
|
---|
| 47 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.