<commit_before>/* See LICENSE file for copyright and license details. */
#include <errno.h>
#include <stdio.h>
#include <string.h>
#include <sys/statvfs.h>

#include "../util.h"

const char *
disk_free(const char *mnt)
{
	struct statvfs fs;

	if (statvfs(mnt, &fs) < 0) {
		fprintf(stderr, "statvfs '%s': %s\n", mnt, strerror(errno));
		return NULL;
	}

	return bprintf("%f",
	               (float)fs.f_bsize * (float)fs.f_bfree / 1024 / 1024 / 1024);
}

const char *
disk_perc(const char *mnt)
{
	struct statvfs fs;

	if (statvfs(mnt, &fs) < 0) {
		fprintf(stderr, "statvfs '%s': %s\n", mnt, strerror(errno));
		return NULL;
	}

	return bprintf("%d", (int)(100 *
				   (1.0f - ((float)fs.f_bfree / (float)fs.f_blocks))));
}

const char *
disk_total(const char *mnt)
{
	struct statvfs fs;

	if (statvfs(mnt, &fs) < 0) {
		fprintf(stderr, "statvfs '%s': %s\n", mnt, strerror(errno));
		return NULL;
	}

	return bprintf("%f",
	               (float)fs.f_bsize * (float)fs.f_blocks / 1024 / 1024 / 1024);
}

const char *<commit_msg>Fix indents (spaces for alignment)<commit_after>/* See LICENSE file for copyright and license details. */
#include <errno.h>
#include <stdio.h>
#include <string.h>
#include <sys/statvfs.h>

#include "../util.h"

const char *
disk_free(const char *mnt)
{
	struct statvfs fs;

	if (statvfs(mnt, &fs) < 0) {
		fprintf(stderr, "statvfs '%s': %s\n", mnt, strerror(errno));
		return NULL;
	}

	return bprintf("%f",
	               (float)fs.f_bsize * (float)fs.f_bfree / 1024 / 1024 / 1024);
}

const char *
disk_perc(const char *mnt)
{
	struct statvfs fs;

	if (statvfs(mnt, &fs) < 0) {
		fprintf(stderr, "statvfs '%s': %s\n", mnt, strerror(errno));
		return NULL;
	}

	return bprintf("%d", (int)(100 *
	               (1.0f - ((float)fs.f_bfree / (float)fs.f_blocks))));
}

const char *
disk_total(const char *mnt)
{
	struct statvfs fs;

	if (statvfs(mnt, &fs) < 0) {
		fprintf(stderr, "statvfs '%s': %s\n", mnt, strerror(errno));
		return NULL;
	}

	return bprintf("%f",
	               (float)fs.f_bsize * (float)fs.f_blocks / 1024 / 1024 / 1024);
}

const char *
{'fraction_non_alphanumeric': 0.1835564053537285, 'fraction_numerical': 0.030592734225621414, 'mean_word_length': 3.324380165289256, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7174287', 'n_tokens_mistral': 946, 'n_tokens_neox': 856, 'n_words': 206}