]> icculus.org git repositories - icculus/xz.git/blob - src/xz/suffix.h
Various code cleanups the the xz command line tool.
[icculus/xz.git] / src / xz / suffix.h
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 /// \file       suffix.h
4 /// \brief      Checks filename suffix and creates the destination filename
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 /// \brief      Get the name of the destination file
21 ///
22 /// Depending on the global variable opt_mode, this tries to find a matching
23 /// counterpart for src_name. If the name can be constructed, it is allocated
24 /// and returned (caller must free it). On error, a message is printed and
25 /// NULL is returned.
26 extern char *suffix_get_dest_name(const char *src_name);
27
28
29 /// \brief      Set a custom filename suffix
30 ///
31 /// This function calls xstrdup() for the given suffix, thus the caller
32 /// doesn't need to keep the memory allocated. There can be only one custom
33 /// suffix, thus if this is called multiple times, the old suffixes are freed
34 /// and forgotten.
35 extern void suffix_set(const char *suffix);