Check out the latest version of Routino: svn co http://routino.org/svn/trunk routino
Contents of /trunk/src/logging.h
Parent Directory
|
Revision Log
Revision 804 -
(show annotations)
(download)
(as text)
Sun Jul 3 09:06:06 2011 UTC (13 years, 9 months ago) by amb
File MIME type: text/x-chdr
File size: 2302 byte(s)
Sun Jul 3 09:06:06 2011 UTC (13 years, 9 months ago) by amb
File MIME type: text/x-chdr
File size: 2302 byte(s)
Add framework for logging error during OSM parsing and subsequent processing.
1 | /*************************************** |
2 | Header file for logging function prototypes |
3 | |
4 | Part of the Routino routing software. |
5 | ******************/ /****************** |
6 | This file Copyright 2008-2011 Andrew M. Bishop |
7 | |
8 | This program is free software: you can redistribute it and/or modify |
9 | it under the terms of the GNU Affero General Public License as published by |
10 | the Free Software Foundation, either version 3 of the License, or |
11 | (at your option) any later version. |
12 | |
13 | This program is distributed in the hope that it will be useful, |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | GNU Affero General Public License for more details. |
17 | |
18 | You should have received a copy of the GNU Affero General Public License |
19 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
20 | ***************************************/ |
21 | |
22 | |
23 | #ifndef LOGGING_H |
24 | #define LOGGING_H /*+ To stop multiple inclusions. +*/ |
25 | |
26 | #include <stdio.h> |
27 | |
28 | |
29 | /* Variables */ |
30 | |
31 | extern int option_loggable; |
32 | |
33 | |
34 | /* Runtime progress logging functions in logging.c */ |
35 | |
36 | #ifdef __GNUC__ |
37 | |
38 | void printf_first(const char *format, ...) __attribute__ ((format (printf, 1, 2))); |
39 | void printf_middle(const char *format, ...) __attribute__ ((format (printf, 1, 2))); |
40 | void printf_last(const char *format, ...) __attribute__ ((format (printf, 1, 2))); |
41 | |
42 | void fprintf_first(FILE *file,const char *format, ...) __attribute__ ((format (printf, 2, 3))); |
43 | void fprintf_middle(FILE *file,const char *format, ...) __attribute__ ((format (printf, 2, 3))); |
44 | void fprintf_last(FILE *file,const char *format, ...) __attribute__ ((format (printf, 2, 3))); |
45 | |
46 | #else |
47 | |
48 | void printf_first(const char *format, ...); |
49 | void printf_middle(const char *format, ...); |
50 | void printf_last(const char *format, ...); |
51 | |
52 | void fprintf_first(FILE *file,const char *format, ...); |
53 | void fprintf_middle(FILE *file,const char *format, ...); |
54 | void fprintf_last(FILE *file,const char *format, ...); |
55 | |
56 | #endif |
57 | |
58 | |
59 | /* Parsing/processing error logging functions in logging.c */ |
60 | |
61 | void open_errorlog(const char *filename,int append); |
62 | void close_errorlog(void); |
63 | |
64 | #ifdef __GNUC__ |
65 | |
66 | void logerror(const char *format, ...) __attribute__ ((format (printf, 1, 2))); |
67 | |
68 | #else |
69 | |
70 | void logerror(const char *format, ...); |
71 | |
72 | #endif |
73 | |
74 | |
75 | #endif /* LOGGING_H */ |