1 ///////////////////////////////////////////////////////////////////////////////
4 /// \brief Checks filename suffix and creates the destination filename
6 // Author: Lasse Collin
8 // This file has been put into the public domain.
9 // You can do whatever you want with this file.
11 ///////////////////////////////////////////////////////////////////////////////
13 /// \brief Get the name of the destination file
15 /// Depending on the global variable opt_mode, this tries to find a matching
16 /// counterpart for src_name. If the name can be constructed, it is allocated
17 /// and returned (caller must free it). On error, a message is printed and
19 extern char *suffix_get_dest_name(const char *src_name
);
22 /// \brief Set a custom filename suffix
24 /// This function calls xstrdup() for the given suffix, thus the caller
25 /// doesn't need to keep the memory allocated. There can be only one custom
26 /// suffix, thus if this is called multiple times, the old suffixes are freed
28 extern void suffix_set(const char *suffix
);
31 /// \brief Check if a custom suffix has been set
33 /// Returns true if the internal tracking of the suffix string has been set
34 /// and false if the string has not been set. This will keep the suffix
35 /// string encapsulated instead of extern-ing the variable.
36 extern bool suffix_is_set(void);