diff options
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 */ |