Merge branch 'upstream'
[routino] / src / logging.h
1 /***************************************
2  $Header: /home/amb/routino/src/RCS/logging.h,v 1.2 2010/11/13 14:50:33 amb Exp $
3
4  Header file for logging function prototypes
5
6  Part of the Routino routing software.
7  ******************/ /******************
8  This file Copyright 2008-2010 Andrew M. Bishop
9
10  This program is free software: you can redistribute it and/or modify
11  it under the terms of the GNU Affero General Public License as published by
12  the Free Software Foundation, either version 3 of the License, or
13  (at your option) any later version.
14
15  This program is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  GNU Affero General Public License for more details.
19
20  You should have received a copy of the GNU Affero General Public License
21  along with this program.  If not, see <http://www.gnu.org/licenses/>.
22  ***************************************/
23
24
25 #ifndef LOGGING_H
26 #define LOGGING_H    /*+ To stop multiple inclusions. +*/
27
28 #include <stdio.h>
29
30
31 /* Variables */
32
33 extern int option_loggable;
34
35
36 /* In logging.c */
37
38 #ifdef __GNUC__
39
40 void printf_first(const char *format, ...) __attribute__ ((format (printf, 1, 2)));
41 void printf_middle(const char *format, ...) __attribute__ ((format (printf, 1, 2)));
42 void printf_last(const char *format, ...) __attribute__ ((format (printf, 1, 2)));
43
44 void fprintf_first(FILE *file,const char *format, ...) __attribute__ ((format (printf, 2, 3)));
45 void fprintf_middle(FILE *file,const char *format, ...) __attribute__ ((format (printf, 2, 3)));
46 void fprintf_last(FILE *file,const char *format, ...) __attribute__ ((format (printf, 2, 3)));
47
48 #else
49
50 void printf_first(const char *format, ...);
51 void printf_middle(const char *format, ...);
52 void printf_last(const char *format, ...);
53
54 void fprintf_first(FILE *file,const char *format, ...);
55 void fprintf_middle(FILE *file,const char *format, ...);
56 void fprintf_last(FILE *file,const char *format, ...);
57
58 #endif
59
60
61 #endif /* LOGGING_H */