From bfe9d91c2aa2ff3cea7754c1cd8ac36e5227edad Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Sun, 5 Oct 2008 12:25:03 +0200 Subject: Move plugin global data allocation back to the module --- gvfs/gvfs.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'gvfs/gvfs.c') diff --git a/gvfs/gvfs.c b/gvfs/gvfs.c index c9a8a7e..3f0ccd5 100644 --- a/gvfs/gvfs.c +++ b/gvfs/gvfs.c @@ -56,11 +56,6 @@ struct TVFSGlobs { }; -int -VFSAllocNeeded () -{ - return sizeof (struct TVFSGlobs); -} static TVFSResult g_error_to_TVFSResult (GError *error) @@ -206,9 +201,14 @@ vfs_handle_mount (struct TVFSGlobs *globs, GFile *file) return globs->mount_result; } -void -VFSInit (struct TVFSGlobs *globs, TVFSLogFunc log_func) +struct TVFSGlobs * +VFSNew (TVFSLogFunc log_func) { + struct TVFSGlobs * globs; + + globs = (struct TVFSGlobs *) malloc (sizeof (struct TVFSGlobs)); + memset (globs, 0, sizeof (struct TVFSGlobs)); + globs->log_func = log_func; globs->log_func ("GVFS plugin: VFSInit"); @@ -217,12 +217,15 @@ VFSInit (struct TVFSGlobs *globs, TVFSLogFunc log_func) globs->break_get_dir_size = FALSE; globs->block_size = DEFAULT_BLOCK_SIZE; + + return globs; } void -VFSDestroy (struct TVFSGlobs *globs) +VFSFree (struct TVFSGlobs *globs) { globs->log_func ("GVFS plugin: VFSDestroy"); + free (globs); } int -- cgit v1.2.3