Defines | |
#define | xmalloc(size) xrealloc(NULL, size) |
Safe malloc() that never returns NULL. | |
Functions | |
void * | xrealloc (void *ptr, size_t size) |
Safe realloc() that never returns NULL. | |
char * | xstrdup (const char *src) |
Safe strdup() that never returns NULL. | |
uint64_t | str_to_uint64 (const char *name, const char *value, uint64_t min, uint64_t max) |
Fancy version of strtoull(). | |
bool | is_empty_filename (const char *filename) |
Check if filename is empty and print an error message. | |
bool | is_tty_stdin (void) |
Test if stdin is a terminal. | |
bool | is_tty_stdout (void) |
Test if stdout is a terminal. |
#define xmalloc | ( | size | ) | xrealloc(NULL, size) |
Safe malloc() that never returns NULL.
Referenced by compressed_name(), options_delta(), options_lzma(), options_subblock(), uncompressed_name(), and xstrdup().
void* xrealloc | ( | void * | ptr, | |
size_t | size | |||
) |
Safe realloc() that never returns NULL.
char* xstrdup | ( | const char * | src | ) |
Safe strdup() that never returns NULL.
References xmalloc.
Referenced by parse_options(), and suffix_set().
uint64_t str_to_uint64 | ( | const char * | name, | |
const char * | value, | |||
uint64_t | min, | |||
uint64_t | max | |||
) |
Fancy version of strtoull().
name | Name of the option to show in case of an error | |
value | String containing the number to be parsed; may contain suffixes "k", "M", "G", "Ki", "Mi", or "Gi" | |
min | Minimum valid value | |
max | Maximum valid value |
References V_ERROR.
Referenced by parse_options().
bool is_empty_filename | ( | const char * | filename | ) |
bool is_tty_stdin | ( | void | ) |
Test if stdin is a terminal.
If stdin is a terminal, an error message is printed and exit status set to EXIT_ERROR.
bool is_tty_stdout | ( | void | ) |
Test if stdout is a terminal.
If stdout is a terminal, an error message is printed and exit status set to EXIT_ERROR.