OSDN Git Service

Change source files headings to meet FSF recommendations.
[android-x86/external-exfat.git] / libexfat / log.c
1 /*
2         log.c (02.09.09)
3         exFAT file system implementation library.
4
5         Copyright (C) 2009, 2010  Andrew Nayenko
6
7         This program is free software: you can redistribute it and/or modify
8         it under the terms of the GNU General Public License as published by
9         the Free Software Foundation, either version 3 of the License, or
10         (at your option) any later version.
11
12         This program is distributed in the hope that it will be useful,
13         but WITHOUT ANY WARRANTY; without even the implied warranty of
14         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15         GNU General Public License for more details.
16
17         You should have received a copy of the GNU General Public License
18         along with this program.  If not, see <http://www.gnu.org/licenses/>.
19 */
20
21 #include "exfat.h"
22 #include <stdarg.h>
23
24 int exfat_errors;
25
26 /*
27  * This message means an internal bug in exFAT implementation.
28  */
29 void exfat_bug(const char* format, ...)
30 {
31         va_list ap;
32
33         fflush(stdout);
34         fputs("BUG: ", stderr);
35         va_start(ap, format);
36         vfprintf(stderr, format, ap);
37         va_end(ap);
38         fputs(".\n", stderr);
39         exit(1);
40 }
41
42 /*
43  * This message means an error in exFAT file system.
44  */
45 void exfat_error(const char* format, ...)
46 {
47         va_list ap;
48
49         exfat_errors++;
50         fflush(stdout);
51         fputs("ERROR: ", stderr);
52         va_start(ap, format);
53         vfprintf(stderr, format, ap);
54         va_end(ap);
55         fputs(".\n", stderr);
56 }
57
58 /*
59  * This message means that there is something unexpected in exFAT file system
60  * that can be a potential problem.
61  */
62 void exfat_warn(const char* format, ...)
63 {
64         va_list ap;
65
66         fflush(stdout);
67         fputs("WARN: ", stderr);
68         va_start(ap, format);
69         vfprintf(stderr, format, ap);
70         va_end(ap);
71         fputs(".\n", stderr);
72 }
73
74 /*
75  * Just debug message. Disabled by default.
76  */
77 void exfat_debug(const char* format, ...)
78 {
79         va_list ap;
80
81         fflush(stdout);
82         fputs("DEBUG: ", stderr);
83         va_start(ap, format);
84         vfprintf(stderr, format, ap);
85         va_end(ap);
86         fputs(".\n", stderr);
87 }