summaryrefslogtreecommitdiff
path: root/file.h
diff options
context:
space:
mode:
authorVincent Douillet <vincent@vdouillet.fr>2024-09-05 12:58:22 +0200
committerVincent Douillet <vincent@vdouillet.fr>2024-09-06 12:22:20 +0200
commit35a145fd161fb4d4f19aa9820b50438695b94414 (patch)
tree00e9f341d5b7e0a6874efbe9fafc0500cf13cd2d /file.h
parent9b8d38ab209c6e7e747d6d420f1b105fe858c7eb (diff)
browse: add upload button
Diffstat (limited to 'file.h')
-rw-r--r--file.h27
1 files changed, 19 insertions, 8 deletions
diff --git a/file.h b/file.h
index f6dd5f7..38ca06e 100644
--- a/file.h
+++ b/file.h
@@ -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 */