]> git.decadent.org.uk Git - ion3.git/blob - libtu/errorlog.h
[svn-inject] Installing original source of ion3
[ion3.git] / libtu / errorlog.h
1 /*
2  * libtu/errorlog.h
3  *
4  * Copyright (c) Tuomo Valkonen 1999-2004. 
5  *
6  * You may distribute and modify this library under the terms of either
7  * the Clarified Artistic License or the GNU LGPL, version 2.1 or later.
8  */
9
10 #ifndef LIBTU_ERRORLOG_H
11 #define LIBTU_ERRORLOG_H
12
13 #include <stdio.h>
14
15 #include "types.h"
16 #include "obj.h"
17 #include "output.h"
18
19 #define ERRORLOG_MAX_SIZE (1024*4)
20
21 INTRSTRUCT(ErrorLog);
22 DECLSTRUCT(ErrorLog){
23     char *msgs;
24     int msgs_len;
25     FILE *file;
26     bool errors;
27     ErrorLog *prev;
28     WarnHandler *old_handler;
29 };
30
31 /* el is assumed to be uninitialised  */
32 extern void errorlog_begin(ErrorLog *el);
33 extern void errorlog_begin_file(ErrorLog *el, FILE *file);
34 /* For errorlog_end el Must be the one errorlog_begin was last called with */
35 extern bool errorlog_end(ErrorLog *el);
36 extern void errorlog_deinit(ErrorLog *el);
37
38 #endif /* LIBTU_ERRORLOG_H */