diff options
| author | Thorsten Töpper <atsutane@freethoughts.de> | 2025-06-21 16:42:49 +0200 |
|---|---|---|
| committer | Thorsten Töpper <atsutane@freethoughts.de> | 2025-06-21 16:42:49 +0200 |
| commit | f6ca4ed80a79408ab55b4a27b73eaa0f32a86410 (patch) | |
| tree | a504db4f580ff44380c0d0c790557320e13e5db7 /include/data_management.h | |
| parent | 744eb2a2a571fa21a5524812b60ca8ebf9a65fe8 (diff) | |
| download | dir_monitor-f6ca4ed80a79408ab55b4a27b73eaa0f32a86410.tar.gz dir_monitor-f6ca4ed80a79408ab55b4a27b73eaa0f32a86410.tar.bz2 | |
Rename list_management to data_management
Diffstat (limited to 'include/data_management.h')
| -rw-r--r-- | include/data_management.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/include/data_management.h b/include/data_management.h new file mode 100644 index 0000000..e5d1581 --- /dev/null +++ b/include/data_management.h @@ -0,0 +1,35 @@ +/* SPDX-License-Identifier: Apache-2.0 */ + +/* Copyright 2025 Thorsten Töpper + * + * vim:ts=4:sw=4:expandtab + */ + +#ifndef LIST_MANAGEMENT_H +#define LIST_MANAGEMENT_H + +#include <sys/stat.h> + +/* === DEFINITIONS === */ + +struct list_node { + struct list_node *next; + char fname[256]; + struct stat ln_stat; +}; + +struct list_head { + struct list_node *first; +}; + +struct list_node *create_node(char *fname, struct stat *ln_stat); +struct list_head *create_list_sort_reversed(struct list_head *list); +void destroy_list(struct list_head *list); + +struct list_head *get_data_from_directory(char *path); +int insert_sorted_by_size(struct list_head *list, struct list_node *node); +int insert_sorted_by_time(struct list_head *list, struct list_node *node); + + +#endif + |
