From b5e13af30cb5a75da6500fd901de877b48869b27 Mon Sep 17 00:00:00 2001 From: Anna Schumaker Date: Thu, 31 Mar 2016 10:55:42 -0400 Subject: [PATCH] core/file: Add cache_file_init() function Signed-off-by: Anna Schumaker --- core/file.c | 7 +++++++ include/core/file.h | 1 + 2 files changed, 8 insertions(+) diff --git a/core/file.c b/core/file.c index 3f272a0b..6e088f59 100644 --- a/core/file.c +++ b/core/file.c @@ -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) diff --git a/include/core/file.h b/include/core/file.h index b3d06121..76fc93d7 100644 --- a/include/core/file.h +++ b/include/core/file.h @@ -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.