]> icculus.org git repositories - icculus/xz.git/blob - src/lzma/error.h
Fixed the test that should have been fixed as part
[icculus/xz.git] / src / lzma / error.h
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 /// \file       error.c
4 /// \brief      Error message printing
5 //
6 //  Copyright (C) 2007 Lasse Collin
7 //
8 //  This program is free software; you can redistribute it and/or
9 //  modify it under the terms of the GNU Lesser General Public
10 //  License as published by the Free Software Foundation; either
11 //  version 2.1 of the License, or (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 GNU
16 //  Lesser General Public License for more details.
17 //
18 ///////////////////////////////////////////////////////////////////////////////
19
20 #ifndef ERROR_H
21 #define ERROR_H
22
23 #include "private.h"
24
25
26 typedef enum {
27         SUCCESS           = 0,
28         ERROR             = 1,
29         WARNING           = 2,
30 } exit_status_type;
31
32
33 typedef enum {
34         V_SILENT,
35         V_ERROR,
36         V_WARNING,
37         V_VERBOSE,
38         V_DEBUG,
39 } verbosity_type;
40
41
42 extern exit_status_type exit_status;
43
44 extern verbosity_type verbosity;
45
46 /// Like GNU's program_invocation_name but portable
47 extern char *argv0;
48
49 /// Once this is non-zero, all threads must shutdown and clean up incomplete
50 /// output files from the disk.
51 extern volatile sig_atomic_t user_abort;
52
53
54 extern const char * str_strm_error(lzma_ret code);
55
56 extern void errmsg(verbosity_type v, const char *fmt, ...)
57                 lzma_attribute((format(printf, 2, 3)));
58
59 extern void set_exit_status(exit_status_type new_status);
60
61 extern void my_exit(int status) lzma_attribute((noreturn));
62
63 extern void out_of_memory(void);
64
65 extern void internal_error(void);
66
67 #endif