38 lines
946 B
C
38 lines
946 B
C
#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
|