#ifndef errors_h #define errors_h /** \file errors.h * Header file for \ref errors.c * * Contains declarations of the functions implemented in \ref errors.c and * the enumeration of the error class Errors. * Project: ParallelCarParrinello Jan Hamaekers 2000 File: errors.h $Id: errors.h,v 1.7 2006/03/30 22:19:52 foo Exp $ */ // taken out of TREMOLO /*@-namechecks@*/ #ifndef __GNUC__ # undef __attribute__ # define __attribute__(x) #endif /*@=namechecks@*/ /* Verschiedene Fehlertypen */ enum Errors { SomeError, //!< some unclassified error FileOpenParams, //!< Error opening parameter file InitReading, //!< Error parsing parameter file MallocError //!< Error while allocating memory }; /* SomeError: Falls man noch zu faul ist */ /* Behandelt aufgetretene Fehler. error ist der Fehlertyp(enum Errors) void *SpecialData ist ein untypisierter Zeiger auf Spezielle Daten zur Fehlerbehandlung. Man koennte auch noch einen Zeiger auf eine Funktion uebergeben */ extern void /*@exits@*/ Error(enum Errors error, /*@null@*/ const void *SpecialData) __attribute__ ((__noreturn__)); #define Error(err, data) Error_in((err), (data), __FILE__, __LINE__) extern void /*@exits@*/ Error_in(enum Errors error, /*@null@*/ const void *SpecialData, const char *file, const int line) __attribute__ ((__noreturn__)); #endif