summaryrefslogtreecommitdiff
path: root/unrar
diff options
context:
space:
mode:
Diffstat (limited to 'unrar')
-rw-r--r--unrar/unrar.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/unrar/unrar.c b/unrar/unrar.c
index 5468b94..8793dc4 100644
--- a/unrar/unrar.c
+++ b/unrar/unrar.c
@@ -101,13 +101,14 @@ struct TVFSGlobs {
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////
// Basic initialization functions
-int VFSAllocNeeded()
+struct TVFSGlobs *
+VFSNew (TVFSLogFunc log_func)
{
- return sizeof(struct TVFSGlobs);
-}
+ struct TVFSGlobs * globs;
+
+ globs = (struct TVFSGlobs *) malloc (sizeof (struct TVFSGlobs));
+ memset (globs, 0, sizeof (struct TVFSGlobs));
-void VFSInit(struct TVFSGlobs *globs, TVFSLogFunc log_func)
-{
globs->block_size = DEFAULT_BLOCK_SIZE;
globs->extract_callback_data = NULL;
globs->extract_callback_func = NULL;
@@ -116,11 +117,15 @@ void VFSInit(struct TVFSGlobs *globs, TVFSLogFunc log_func)
globs->log_func = log_func;
if (globs->log_func != NULL) globs->log_func((char*)"unrar plugin: VFSInit");
+
+ return globs;
}
-void VFSDestroy(struct TVFSGlobs *globs)
+void
+VFSFree (struct TVFSGlobs *globs)
{
if (globs->log_func != NULL) globs->log_func((char*)"unrar plugin: VFSDestroy");
+ free (globs);
}
int VFSVersion()