aboutsummaryrefslogtreecommitdiff
path: root/include/options.h
diff options
context:
space:
mode:
authorThorsten Töpper <atsutane@freethoughts.de>2025-06-15 23:55:47 +0200
committerThorsten Töpper <atsutane@freethoughts.de>2025-06-15 23:55:47 +0200
commit62e45906f1ffcaa2e3039a4306c01465c3eadfd8 (patch)
tree4e388adaa1893807829c3714ea88ac8beb2dfcf7 /include/options.h
parent633e1ea568b5f9608319bbbe32c8fcdbf195c47d (diff)
downloaddir_monitor-62e45906f1ffcaa2e3039a4306c01465c3eadfd8.tar.gz
dir_monitor-62e45906f1ffcaa2e3039a4306c01465c3eadfd8.tar.bz2
Spread code into multiple files.
Diffstat (limited to 'include/options.h')
-rw-r--r--include/options.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/include/options.h b/include/options.h
new file mode 100644
index 0000000..70f22e4
--- /dev/null
+++ b/include/options.h
@@ -0,0 +1,44 @@
+/* SPDX-License-Identifier: Apache-2.0 */
+
+/* Copyright 2025 Thorsten Töpper
+ *
+ * dir_monitor - print specified stat() information from entries of a given
+ * directory to stdout. Call it via watch for repeated output to a terminal.
+ *
+ * vim:ts=4:sw=4:expandtab
+ */
+
+#ifndef OPTIONS_H
+#define OPTIONS_H
+
+#include <stdbool.h>
+
+#include "output.h"
+#include "list_management.h"
+
+
+
+/* === DEFINITIONS === */
+#define PATH_SEP '/'
+
+enum esort_type { SORT_BY_SIZE, SORT_BY_TIME };
+
+
+/* === GLOBAL VARIABLES === */
+extern bool option_sort_reverse_order;
+extern enum esort_type option_sort_type;
+extern bool option_show_hidden_entries;
+extern bool option_timestamp_long;
+
+
+int parse_arguments(int argc, char **argv);
+void set_option(const char *option_name, char *option_argument);
+/* In theory a part of output, but it's easier to place it near the struct
+ * containing the options in options.c */
+void usage(char *executable);
+
+
+
+
+#endif
+