1 /************************* toolbox/loging.h ************************************
3 Copyright (c) 1997 A. Krall, R. Grafl, M. Gschwind, M. Probst
5 See file COPYRIGHT for information on usage and disclaimer of warranties
7 Stellt Funktionen f"urs Logging zur Verf"ugung
9 Authors: Reinhard Grafl EMAIL: cacao@complang.tuwien.ac.at
11 Last Change: $Id: loging.h 65 1998-11-11 21:12:27Z phil $
13 *******************************************************************************/
15 #define PANICIF(when,txt) if(when)panic(txt)
18 * Just added the LOG macro, so we our code becomes a little more
19 * readable, again. --phil.
21 #define LOG(args...) sprintf(logtext, ## args); dolog();
23 #define MAXLOGTEXT 500
24 extern char logtext[MAXLOGTEXT];
26 void log_init(char *fname);
27 void log_text(char *txt);
33 void panic(char *txt);
35 long int getcputime();
40 -------------------------- Schnittstellenbeschreibung -------------------------
42 log_init .... Initialisiert das Logfile-System
43 fname ....... Dateiname f"ur die Protokollierungsdatei
44 keepfile .... 1, wenn die alte Datei nicht gel"oscht werden soll
45 echostdout .. 1, wenn auch auf stdout ausgegeben werden soll
47 log_text .... Gibt einen Text auf das Logfile aus
48 log_cputime . Gibt eine Information "uber die verbrauchte CPU-Zeit aus
49 dolog ....... Gibt den Inhalt von logtext aus
50 error ....... Gibt den Inhalt von logtext aus, und stoppt das System
51 panic ....... Gibt eine Text auf das Logfile aus
53 logtext ..... dieses globale Array mu"s vor Benutzung der Funktionen 'log'
54 oder 'error' mit dem auszugebenen Text bef"ullt werden.
56 getcputimew . gibt die vom Programm verbrauchte CPU-Zeit in