aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/list_management.h12
-rw-r--r--include/options.h10
-rw-r--r--include/output.h3
3 files changed, 13 insertions, 12 deletions
diff --git a/include/list_management.h b/include/list_management.h
index 0a887c7..a62fe45 100644
--- a/include/list_management.h
+++ b/include/list_management.h
@@ -2,8 +2,6 @@
/* Copyright 2025 Thorsten Töpper
*
- * list_management - data handling related code
- *
* vim:ts=4:sw=4:expandtab
*/
@@ -13,9 +11,15 @@
#include <time.h>
/* === DEFINITIONS === */
+
+/* off_t is defined in different headers, on Linux with glibc,
+ * stdio.h, unistd.h and types.h
+ * output.h requires this struct definition therefore off_t
+ * becomes implicitly defined through stdio.h as every source
+ * file includes output.h */
struct list_node {
struct list_node *next;
- size_t fsize;
+ off_t fsize;
char fname[256];
time_t ftime; /* can be creation, access or modification */
};
@@ -24,7 +28,7 @@ struct list_head {
struct list_node *first;
};
-struct list_node *create_node(char *fname, size_t fsize, time_t ftime);
+struct list_node *create_node(char *fname, long int fsize, time_t ftime);
struct list_head *create_list_sort_reversed(struct list_head *list);
void destroy_list(struct list_head *list);
int insert_sorted_by_size(struct list_head *list, struct list_node *node);
diff --git a/include/options.h b/include/options.h
index 70f22e4..7f26f4d 100644
--- a/include/options.h
+++ b/include/options.h
@@ -2,9 +2,6 @@
/* 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
*/
@@ -19,12 +16,16 @@
/* === DEFINITIONS === */
+/* TODO: if ported to other platforms, those precompiler checks need to be extended */
+#ifndef PATH_SEP
#define PATH_SEP '/'
+#endif
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;
@@ -37,8 +38,5 @@ void set_option(const char *option_name, char *option_argument);
* containing the options in options.c */
void usage(char *executable);
-
-
-
#endif
diff --git a/include/output.h b/include/output.h
index 22f3885..beb9559 100644
--- a/include/output.h
+++ b/include/output.h
@@ -2,8 +2,6 @@
/* Copyright 2025 Thorsten Töpper
*
- * output related functions and definitions
- *
* vim:ts=4:sw=4:expandtab
*/
#ifndef OUTPUT_H
@@ -25,5 +23,6 @@
int fputc_all_cols(char c, FILE *fdout);
int fputc_width_x(char c, size_t x, FILE *fdout);
void print_list(struct list_head *list);
+
#endif