core/file: Add cache_file_init() function
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
parent
12949651f7
commit
b5e13af30c
|
@ -72,6 +72,13 @@ void file_init(struct file *file, const gchar *name,
|
||||||
file->f_name = 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)
|
gchar *file_path(struct file *file)
|
||||||
{
|
{
|
||||||
if (string_length(file->f_name) != 0)
|
if (string_length(file->f_name) != 0)
|
||||||
|
|
|
@ -68,6 +68,7 @@ struct cache_file {
|
||||||
|
|
||||||
/* Initialize a new file object. */
|
/* Initialize a new file object. */
|
||||||
void file_init(struct file *, const gchar *, unsigned int, unsigned int);
|
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.
|
* Returns the full path of the file or an empty string if filename is not set.
|
||||||
|
|
Loading…
Reference in New Issue