aboutsummaryrefslogtreecommitdiff
path: root/include/list_management.h
diff options
context:
space:
mode:
authorThorsten Töpper <atsutane@freethoughts.de>2025-06-16 20:20:20 +0200
committerThorsten Töpper <atsutane@freethoughts.de>2025-06-16 20:20:20 +0200
commitbe8f8a9f4caa883e3de98b276cdad55d4fc65c0d (patch)
tree40148ab39566cfa614ca9a5e64049ff54cdd1e84 /include/list_management.h
parent62e45906f1ffcaa2e3039a4306c01465c3eadfd8 (diff)
downloaddir_monitor-be8f8a9f4caa883e3de98b276cdad55d4fc65c0d.tar.gz
dir_monitor-be8f8a9f4caa883e3de98b276cdad55d4fc65c0d.tar.bz2
CMakeLists: hardening flags
Diffstat (limited to 'include/list_management.h')
-rw-r--r--include/list_management.h12
1 files changed, 8 insertions, 4 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);