]> icculus.org git repositories - icculus/xz.git/blob - src/xz/main.h
Put the interesting parts of XZ Utils into the public domain.
[icculus/xz.git] / src / xz / main.h
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 /// \file       main.h
4 /// \brief      Miscellanous declarations
5 //
6 //  Author:     Lasse Collin
7 //
8 //  This file has been put into the public domain.
9 //  You can do whatever you want with this file.
10 //
11 ///////////////////////////////////////////////////////////////////////////////
12
13 /// Possible exit status values. These are the same as used by gzip and bzip2.
14 enum exit_status_type {
15         E_SUCCESS  = 0,
16         E_ERROR    = 1,
17         E_WARNING  = 2,
18 };
19
20
21 /// Sets the exit status after a warning or error has occurred. If new_status
22 /// is EX_WARNING and the old exit status was already EX_ERROR, the exit
23 /// status is not changed.
24 extern void set_exit_status(enum exit_status_type new_status);
25
26
27 /// Exits the program using the given status. This takes care of closing
28 /// stdin, stdout, and stderr and catches possible errors. If we had got
29 /// a signal, this function will raise it so that to the parent process it
30 /// appears that we were killed by the signal sent by the user.
31 extern void my_exit(enum exit_status_type status) lzma_attribute((noreturn));