aboutsummaryrefslogtreecommitdiff
path: root/include/options.h
blob: 27dbb7c71f4355e38319b7fa426a66c973424a0a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/* SPDX-License-Identifier: Apache-2.0 */

/* Copyright 2026 Thorsten Töpper
 *
 * vim:ts=4:sw=4:expandtab
 */

#ifndef OPTIONS_H
#define OPTIONS_H

#include <stdbool.h>

/* === DEFINITIONS === */
/* TODO: if ported to other platforms, those precompiler checks need to be extended */
#ifndef PATH_SEP
#define PATH_SEP '/'
#endif


/* === GLOBAL VARIABLES === */

enum operation_modes {
    MODE_SCAN,
    MODE_ANALYZE_DB,
    MODE_DUMP,
    MODE_DEV_MESSED_UP
};

extern bool option_quiet;
extern bool option_show_hidden_entries;
extern bool option_show_non_duplicates;
extern bool option_clean_kv;
extern char *option_gdbm_db_name;
extern char *option_sqlite_db_name;
extern enum operation_modes option_mode;

int parse_arguments(int argc, char **argv);
void set_option(const char *option_name, char *option_argument);
void usage(char *executable);

#endif