4 * This source code is part of
8 * GROningen MAchine for Chemical Simulations
11 * Copyright (c) 1991-2001, University of Groningen, The Netherlands
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * If you want to redistribute modifications, please consider that
18 * scientific software is very special. Version control is crucial -
19 * bugs must be traceable. We will be happy to consider code for
20 * inclusion in the official distribution, but derived work must not
21 * be called official GROMACS. Details are found in the README & COPYING
22 * files - if they are missing, get the official version at www.gromacs.org.
24 * To help us fund GROMACS development, we humbly ask that you cite
25 * the papers on the package - you can find them in the top README file.
27 * For more info, check our website at http://www.gromacs.org
48 extern void _where(char *file
,int line
);
49 #define where() _where(__FILE__,__LINE__)
50 /* Prints filename and line to stdlog and only on amba memvail */
52 extern void _halt(char *file
,int line
,char *reason
);
53 #define HALT(reason) _halt(__FILE__,__LINE__,reason)
54 /* Halts the program with an error message */
56 extern void _set_fatal_tmp_file(char *fn
, char *file
, int line
);
57 #define set_fatal_tmp_file(fn) _set_fatal_tmp_file(fn,__FILE__,__LINE__)
58 /* set filename to be removed when fatal_error is called */
60 extern void _unset_fatal_tmp_file(char *fn
, char *file
, int line
);
61 #define unset_fatal_tmp_file(fn) _unset_fatal_tmp_file(fn,__FILE__,__LINE__)
62 /* unsets filename to be removed */
64 extern void fatal_error(int fatal_errno
,char *fmt
,...);
66 * Routine fatal_error prints
68 * "fatal error file %s line %s \n\t "
70 * followed by the string specified by fmt and supplied parameters. If
71 * errno is 0, only the message and arguments are printed. If errno is
72 * a legal system errno or -1, a perror like message is printed after the
73 * first message, if errno is -1, the last system errno will be used.
74 * The format of fmt is that like printf etc, only %d, %x, %c, %f and %s
75 * are allowed as format specifiers.
78 /* This include must not be moved upwards, to prevent compilation problems */
81 extern void init_warning(int maxwarning
);
82 /* Set the max number of warnings */
84 extern void set_warning_line(char *fn
,int line
);
85 /* Set filename and linenumber for the warning */
87 extern int get_warning_line(void);
88 /* Get linenumber for the warning */
90 extern char *get_warning_file(void);
91 /* Get filename for the warning */
93 extern char warn_buf
[1024];
94 /* Warning buffer of 1024 bytes, which can be used to print messages to */
96 extern void warning(char *s
);
97 /* Issue a warning, with the string s. If s == NULL, then warn_buf
98 * will be printed instead.
101 extern void print_warn_num(void);
102 /* Print the total number of warnings, if larger than 0 */
104 extern void _too_few(char *fn
,int line
);
105 #define too_few() _too_few(__FILE__,__LINE__)
106 /* Issue a warning stating 'Too few parameters' */
108 extern void _invalid_case(char *fn
,int line
);
109 #define invalid_case() _invalid_case(__FILE__,__LINE__)
110 /* Issue a warning stating 'Invalid case in switch' */
112 extern void _unexpected_eof(char *fn
,int line
,char *srcfn
,int srcline
);
113 #define unexpected_eof(fn,line) _unexpected_eof(fn,line,__FILE__,__LINE__)
116 * Functions can write to this file for debug info
117 * Before writing to it, it should be checked whether
119 * if (debug) fprintf(debug,"%s","Hallo");
123 void init_debug (char *dbgfile
);
125 extern bool bDebugMode(void);
126 /* Return TRUE when the program was started in debug mode */
128 #if (defined __sgi && defined USE_SGI_FPE)
129 extern void doexceptions(void);
130 /* Set exception handlers for debugging */
137 #endif /* _fatal_h */