Add NEWS for 5.6.3
[xz.git] / src / xz / suffix.h
blobf59e3123ca8dbf04f21c864499c3fc37d692c8e4
1 // SPDX-License-Identifier: 0BSD
3 ///////////////////////////////////////////////////////////////////////////////
4 //
5 /// \file suffix.h
6 /// \brief Checks filename suffix and creates the destination filename
7 //
8 // Author: Lasse Collin
9 //
10 ///////////////////////////////////////////////////////////////////////////////
12 /// \brief Get the name of the destination file
13 ///
14 /// Depending on the global variable opt_mode, this tries to find a matching
15 /// counterpart for src_name. If the name can be constructed, it is allocated
16 /// and returned (caller must free it). On error, a message is printed and
17 /// NULL is returned.
18 extern char *suffix_get_dest_name(const char *src_name);
21 /// \brief Set a custom filename suffix
22 ///
23 /// This function calls xstrdup() for the given suffix, thus the caller
24 /// doesn't need to keep the memory allocated. There can be only one custom
25 /// suffix, thus if this is called multiple times, the old suffixes are freed
26 /// and forgotten.
27 extern void suffix_set(const char *suffix);
30 /// \brief Check if a custom suffix has been set
31 ///
32 /// Returns true if the internal tracking of the suffix string has been set
33 /// and false if the string has not been set. This will keep the suffix
34 /// string encapsulated instead of extern-ing the variable.
35 extern bool suffix_is_set(void);