diff options
| author | Tomas Bzatek <tbzatek@users.sourceforge.net> | 2008-10-05 12:25:03 +0200 |
|---|---|---|
| committer | Tomas Bzatek <tbzatek@users.sourceforge.net> | 2008-10-05 12:25:03 +0200 |
| commit | bfe9d91c2aa2ff3cea7754c1cd8ac36e5227edad (patch) | |
| tree | 2fafe098dd9579b0f7277a4d418b39923ae8bb42 /unrar/unrar.c | |
| parent | d0caac91ac0a03e021d50d1de978733e11ba2ccd (diff) | |
| download | tuxcmd-modules-bfe9d91c2aa2ff3cea7754c1cd8ac36e5227edad.tar.xz | |
Move plugin global data allocation back to the module
Diffstat (limited to 'unrar/unrar.c')
| -rw-r--r-- | unrar/unrar.c | 17 |
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() |
