errorlog.h

Mon, 20 Apr 2020 10:14:32 -0500

author
Tuomo Valkonen <tuomov@iki.fi>
date
Mon, 20 Apr 2020 10:14:32 -0500
changeset 119
87e3bb5086e8
parent 62
aae5facf9fc5
permissions
-rw-r--r--

Convert README to markdown

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

mercurial