core/file: Add cache_file_init() function

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
Anna Schumaker 2016-03-31 10:55:42 -04:00
parent 12949651f7
commit b5e13af30c
2 changed files with 8 additions and 0 deletions

View File

@ -72,6 +72,13 @@ void file_init(struct file *file, const gchar *name,
file->f_name = name;
}
void cache_file_init(struct cache_file *file, gchar *subdir, gchar *name)
{
file->cf_file = NULL;
file->cf_name = name;
file->cf_subdir = subdir;
}
gchar *file_path(struct file *file)
{
if (string_length(file->f_name) != 0)

View File

@ -68,6 +68,7 @@ struct cache_file {
/* Initialize a new file object. */
void file_init(struct file *, const gchar *, unsigned int, unsigned int);
void cache_file_init(struct cache_file *, gchar *, gchar *);
/*
* Returns the full path of the file or an empty string if filename is not set.