Parolin 0.7.9 6796
Console (soon DLLs) to do a tar like job
Loading...
Searching...
No Matches
suffix.c File Reference

Checks filename suffix and creates the destination filename. More...

#include "private.h"

Macros

#define suffix_strcmp   strcmp
 

Functions

char * suffix_get_dest_name (const char *src_name)
 Get the name of the destination file.
 
void suffix_set (const char *suffix)
 Set a custom filename suffix.
 
bool suffix_is_set (void)
 Check if a custom suffix has been set.
 

Detailed Description

Checks filename suffix and creates the destination filename.

Macro Definition Documentation

◆ suffix_strcmp

#define suffix_strcmp   strcmp

Function Documentation

◆ suffix_get_dest_name()

char * suffix_get_dest_name ( const char * src_name)
extern

Get the name of the destination file.

Depending on the global variable opt_mode, this tries to find a matching counterpart for src_name. If the name can be constructed, it is allocated and returned (caller must free it). On error, a message is printed and NULL is returned.

◆ suffix_is_set()

bool suffix_is_set ( void )
extern

Check if a custom suffix has been set.

Returns true if the internal tracking of the suffix string has been set and false if the string has not been set. This will keep the suffix string encapsulated instead of extern-ing the variable.

◆ suffix_set()

void suffix_set ( const char * suffix)
extern

Set a custom filename suffix.

This function calls xstrdup() for the given suffix, thus the caller doesn't need to keep the memory allocated. There can be only one custom suffix, thus if this is called multiple times, the old suffixes are freed and forgotten.