система модулей

This commit is contained in:
2026-07-24 02:38:57 +08:00
parent 349ea7e91e
commit 30504ce9f4
24 changed files with 1260 additions and 10 deletions

37
src/fs.h Normal file
View File

@@ -0,0 +1,37 @@
#ifndef FS_H
#define FS_H
#include <time.h>
typedef struct {
char name[256];
int is_dir;
long size;
char icon[8];
char encoded_path[1024];
char file_url[1024];
int is_protected;
time_t mtime;
int file_count;
long long dir_size;
} entry_t;
typedef struct {
char sort_by[16];
int sort_order;
char search[256];
int recursive;
} query_params_t;
extern query_params_t g_params;
int is_safe_path(const char *path);
void safe_path_join(char *result, size_t result_size, const char *base, const char *path);
int count_files_in_dir(const char *path);
long long get_dir_size(const char *path);
const char* get_file_icon(const char* filename);
int is_previewable(const char* filename);
void search_recursive(const char *base_path, const char *display_path, const char *search_term, entry_t *results, int *count, int max_results);
int compare_entries_sorted(const void *a, const void *b);
#endif