<commit_before>#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <getopt.h>
#include <errno.h>
#include <signal.h>
#include <netdb.h>
#include <unistd.h>
#include <sys/socket.h>
#include <sys/un.h>

const char *version = "nethub version 1.0\n";

const char *usage =
    "Usage: nethub --help\n"
    "       nethub [-v] -u SOCKET\n"
    "       nethub [-v] [-46] [-l ADDRESS] -p PORT\n";

const char *help =
    "Options:\n"
    "  -h, --help           print this help\n"
    "  -v, --verbose        no need to explain\n"
    "  -n, --slots NUM      specify the maximum number of clients\n"
    "  -u, --socket PATH    create a Unix domain socket\n"
    "  -p, --port PORT      open a TCP server\n"
    "  -4, --ipv4           force IPv4\n"
    "  -6, --ipv6           force IPv6\n"
    "  -l, --bind ADDRESS   specify the address to bind (TCP)\n";

int print_help = 0;
int verbose = 0;
int slots = 32;
char *socket_path = NULL;
char *port = NULL;
char *bind_address = NULL;
int family = AF_UNSPEC;

int server = 0;
int *clients = NULL;

static struct option options[] = {
    {"help", no_argument, 0, 'h'},
    {"verbose", no_argument, 0, 'v'},
    {"socket", required_argument, 0, 'u'},
    {"port", required_argument, 0, 'p'},
    {"bind", required_argument, 0, 'l'},
    {"ipv4", no_argument, 0, '4'},
    {"ipv6", no_argument, 0, '6'},
    {"slots", required_argument, 0, 'n'},
    {0, 0, 0, 0}
};

int parse_args(int argc, char **argv){
    char c;
    while((c = getopt_long(argc, argv, "hvu:p:l:n:46", options, NULL)) != -1){
        switch(c){
            case 'h':
                print_help = 1;
                return 1;
            case 'v':
                verbose = 1;
                break;
            case 'u':
                socket_path = optarg;
                break;
            case 'p':
                port = optarg;
                break;
            case 'l':
                bind_address = optarg;
                break;
            case 'n':
                slots = atoi(optarg);
                if(slots <= 0){
                    fprintf(stderr, "invalid number of slots: %s\n", optarg);
                    return 0;<commit_msg>fix potential warning<commit_after>#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <getopt.h>
#include <errno.h>
#include <signal.h>
#include <netdb.h>
#include <unistd.h>
#include <sys/socket.h>
#include <sys/un.h>

const char *version = "nethub version 1.0\n";

const char *usage =
    "Usage: nethub --help\n"
    "       nethub [-v] -u SOCKET\n"
    "       nethub [-v] [-46] [-l ADDRESS] -p PORT\n";

const char *help =
    "Options:\n"
    "  -h, --help           print this help\n"
    "  -v, --verbose        no need to explain\n"
    "  -n, --slots NUM      specify the maximum number of clients\n"
    "  -u, --socket PATH    create a Unix domain socket\n"
    "  -p, --port PORT      open a TCP server\n"
    "  -4, --ipv4           force IPv4\n"
    "  -6, --ipv6           force IPv6\n"
    "  -l, --bind ADDRESS   specify the address to bind (TCP)\n";

int print_help = 0;
int verbose = 0;
int slots = 32;
char *socket_path = NULL;
char *port = NULL;
char *bind_address = NULL;
int family = AF_UNSPEC;

int server = 0;
int *clients = NULL;

static struct option options[] = {
    {"help", no_argument, 0, 'h'},
    {"verbose", no_argument, 0, 'v'},
    {"socket", required_argument, 0, 'u'},
    {"port", required_argument, 0, 'p'},
    {"bind", required_argument, 0, 'l'},
    {"ipv4", no_argument, 0, '4'},
    {"ipv6", no_argument, 0, '6'},
    {"slots", required_argument, 0, 'n'},
    {0, 0, 0, 0}
};

int parse_args(int argc, char **argv){
    int c;
    while((c = getopt_long(argc, argv, "hvu:p:l:n:46", options, NULL)) != -1){
        switch(c){
            case 'h':
                print_help = 1;
                return 1;
            case 'v':
                verbose = 1;
                break;
            case 'u':
                socket_path = optarg;
                break;
            case 'p':
                port = optarg;
                break;
            case 'l':
                bind_address = optarg;
                break;
            case 'n':
                slots = atoi(optarg);
                if(slots <= 0){
                    fprintf(stderr, "invalid number of slots: %s\n", optarg);
                    return 0;
{'fraction_non_alphanumeric': 0.15723126289250516, 'fraction_numerical': 0.01787760715104286, 'mean_word_length': 1.7292057535959975, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 23, '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': '1229144', 'n_tokens_mistral': 1585, 'n_tokens_neox': 1509, 'n_words': 445}