diff options
author | Vincent Douillet <vincent@vdouillet.fr> | 2024-09-05 12:58:22 +0200 |
---|---|---|
committer | Vincent Douillet <vincent@vdouillet.fr> | 2024-09-06 12:22:20 +0200 |
commit | 35a145fd161fb4d4f19aa9820b50438695b94414 (patch) | |
tree | 00e9f341d5b7e0a6874efbe9fafc0500cf13cd2d /file.h | |
parent | 9b8d38ab209c6e7e747d6d420f1b105fe858c7eb (diff) |
browse: add upload button
Diffstat (limited to 'file.h')
-rw-r--r-- | file.h | 27 |
1 files changed, 19 insertions, 8 deletions
@@ -42,12 +42,11 @@ */ struct file { SLIST_ENTRY(file) files; - size_t size; - enum mime mime; - char *path; /* relative to DATA_DIR */ - char *name; - char *action_url; /* action URL for HTML page */ - bool is_dir; + size_t size; + enum mime mime; + char *path; /* relative to DATA_DIR */ + char *action_url; /* action URL for HTML page */ + bool is_dir; }; /* @@ -58,9 +57,21 @@ void file_free(struct file *); /* - * Build a new file + * Build a new file from its relative paÃth to the data dir. */ struct file * -file_new(char *, size_t, char *, size_t); +file_new(const char *); + +/* + * Get the file basename. + */ +char * +file_get_basename(const struct file *); + +/* + * Build the data path (on the filesystem) for a file. + */ +size_t +file_get_data_path(const struct file *, char *, size_t); #endif /* FILE_H */ |