<commit_before>#include <getopt.h>
#include <signal.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/wait.h>
#include <unistd.h>

#include "config.h"

#define DFL_INTERVAL 60
#define DFL_THRESHOLD 2
#define DFL_WARN_THRESHOLD 5

enum batstat {
	CHARGING = 1,
	DISCHARGING
};

enum typenotify {
	WARN = 1,
	NAG
};

void main_loop(int threshold, int warn_threshold, int interval,
	       int notify_terminals);
int get_battery_capacity(void);
int get_battery_status(void);
int nag(int notify_terminals, int threshold);
int warn(int notify_terminals);
void wall(int type);

inline void usage(void)
{
	fprintf(stderr,
		"Low battery indicator using i3-nagbar.\n\n"
		"Usage:\n"
		"  batnag [options]\n\n"
		"Options:\n"
		"  -d --daemon         Run in daemon mode\n"
		"  -h --help           Show this\n"
		"  -i --interval=<n>   Interval to check battery status\n"
		"  -n --no-wall        Do not notify TTYs\n"
		"  -t --threshold=<n>  Critical battery level\n"
		"  -v --version        Print version\n"
		"  -w --warn=[<n>]     Send additional warning\n");
	exit(0);
}

inline void version(void)
{
	fprintf(stderr, "%s\n", PACKAGE_STRING);
	exit(0);
}

int main(int argc, char *argv[])
{
	int c = 0;
	bool daemon_mode = false;
	bool notify_terminals = true;
	int option_index = 0;
	int threshold = DFL_THRESHOLD;
	int interval = DFL_INTERVAL;
	int warn_threshold = 0;
	pid_t pid = 0;
	struct option long_options[] = {
		{"daemon", no_argument, 0, 'd'},
		{"help", no_argument, 0, 'h'},
		{"interval", required_argument, 0, 'i'},
		{"no-wall", no_argument, 0, 'n'},
		{"threshold", required_argument, 0, 't'},
		{"version", no_argument, 0, 'v'},
		{"warn", optional_argument, 0, 'w'},
		{0, 0, 0, 0}
	};
<commit_msg>fix clang error by using static inline<commit_after>#include <getopt.h>
#include <signal.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/wait.h>
#include <unistd.h>

#include "config.h"

#define DFL_INTERVAL 60
#define DFL_THRESHOLD 2
#define DFL_WARN_THRESHOLD 5

enum batstat {
	CHARGING = 1,
	DISCHARGING
};

enum typenotify {
	WARN = 1,
	NAG
};

void main_loop(int threshold, int warn_threshold, int interval,
	       int notify_terminals);
int get_battery_capacity(void);
int get_battery_status(void);
int nag(int notify_terminals, int threshold);
int warn(int notify_terminals);
void wall(int type);

static inline void usage(void)
{
	fprintf(stderr,
		"Low battery indicator using i3-nagbar.\n\n"
		"Usage:\n"
		"  batnag [options]\n\n"
		"Options:\n"
		"  -d --daemon         Run in daemon mode\n"
		"  -h --help           Show this\n"
		"  -i --interval=<n>   Interval to check battery status\n"
		"  -n --no-wall        Do not notify TTYs\n"
		"  -t --threshold=<n>  Critical battery level\n"
		"  -v --version        Print version\n"
		"  -w --warn=[<n>]     Send additional warning\n");
	exit(0);
}

static inline void version(void)
{
	fprintf(stderr, "%s\n", PACKAGE_STRING);
	exit(0);
}

int main(int argc, char *argv[])
{
	int c = 0;
	bool daemon_mode = false;
	bool notify_terminals = true;
	int option_index = 0;
	int threshold = DFL_THRESHOLD;
	int interval = DFL_INTERVAL;
	int warn_threshold = 0;
	pid_t pid = 0;
	struct option long_options[] = {
		{"daemon", no_argument, 0, 'd'},
		{"help", no_argument, 0, 'h'},
		{"interval", required_argument, 0, 'i'},
		{"no-wall", no_argument, 0, 'n'},
		{"threshold", required_argument, 0, 't'},
		{"version", no_argument, 0, 'v'},
		{"warn", optional_argument, 0, 'w'},
		{0, 0, 0, 0}
	};

{'fraction_non_alphanumeric': 0.15773224810552905, 'fraction_numerical': 0.013471793432500701, 'mean_word_length': 3.622568093385214, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, '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': '5160583', 'n_tokens_mistral': 1478, 'n_tokens_neox': 1393, 'n_words': 374}