if (v == 0) {
printf("Unset cache size limit\n");
} else {
- char *s = format_size(v);
+ char *s = format_human_readable_size(v);
printf("Set cache size limit to %s\n", s);
free(s);
}
char *remove_extension(const char *path);
size_t file_size(struct stat *st);
int safe_create_wronly(const char *fname);
-char *format_size(size_t v);
+char *format_human_readable_size(size_t v);
bool parse_size_with_suffix(const char *str, size_t *size);
char *x_realpath(const char *path);
char *gnu_getcwd(void);
static void
display_size(size_t v)
{
- char *s = format_size(v);
+ char *s = format_human_readable_size(v);
printf("%15s", s);
free(s);
}
/* Format a size (in KiB) as a human-readable string. Caller frees. */
char *
-format_size(size_t v)
+format_human_readable_size(size_t v)
{
char *s;
if (v >= 1024*1024) {