* src/toolbox/logging.h [__cplusplus]: Added extern "C".
[cacao.git] / src / toolbox / logging.h
1 /* src/toolbox/logging.h - contains logging functions
2
3    Copyright (C) 1996-2005, 2006, 2007, 2008
4    CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
5
6    This file is part of CACAO.
7
8    This program is free software; you can redistribute it and/or
9    modify it under the terms of the GNU General Public License as
10    published by the Free Software Foundation; either version 2, or (at
11    your option) any later version.
12
13    This program is distributed in the hope that it will be useful, but
14    WITHOUT ANY WARRANTY; without even the implied warranty of
15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16    General Public License for more details.
17
18    You should have received a copy of the GNU General Public License
19    along with this program; if not, write to the Free Software
20    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21    02110-1301, USA.
22
23 */
24
25
26 #ifndef _LOGGING_H
27 #define _LOGGING_H
28
29 #include "config.h"
30
31 #include <stdio.h>
32 #include <stdarg.h>
33
34 #include "vm/class.h"
35 #include "vm/method.h"
36 #include "vm/utf8.h"
37
38
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42
43 /*500 is to small for eclipse traces, (builtin_trace_args, perhaps the
44 buffer should be created there dynamically, if the text is longer,
45 instead of setting the size for all invocations that big*/
46
47 #define MAXLOGTEXT  16383 
48
49 /* function prototypes ********************************************************/
50
51 void log_init(const char *fname);
52
53 void log_start(void);
54
55 void log_vprint(const char *text, va_list ap);
56 void log_print(const char *text, ...);
57 void log_println(const char *text, ...);
58
59 void log_finish(void);
60
61
62 /* log message functions */
63 void log_message_utf(const char *msg, utf *u);
64 void log_message_class(const char *msg, classinfo *c);
65 void log_message_class_message_class(const char *msg1, classinfo *c1,
66                                                                          const char *msg2, classinfo *c2);
67 void log_message_method(const char *msg, methodinfo *m);
68
69 #define log_text(s) log_println("%s", (s))
70 #define dolog log_println
71
72 #ifdef __cplusplus
73 }
74 #endif
75
76 #endif /* _LOGGING_H */
77
78
79 /*
80  * These are local overrides for various environment variables in Emacs.
81  * Please do not remove this and leave it at the end of the file, where
82  * Emacs will automagically detect them.
83  * ---------------------------------------------------------------------
84  * Local variables:
85  * mode: c
86  * indent-tabs-mode: t
87  * c-basic-offset: 4
88  * tab-width: 4
89  * End:
90  */