diff options
| author | Tomas Bzatek <tbzatek@users.sourceforge.net> | 2009-10-04 16:30:10 +0200 |
|---|---|---|
| committer | Tomas Bzatek <tbzatek@users.sourceforge.net> | 2009-10-04 16:30:10 +0200 |
| commit | 7baf84f22bcf68f0c4a14a5ff404119aafe2666a (patch) | |
| tree | 260be56a2da98ab48a2cc6d7ddbb36b4adbe3074 /libarchive | |
| parent | 88ce42250dc9cd1b69eb734b88226a5bd408c4d5 (diff) | |
| download | tuxcmd-modules-0.6.66.tar.xz | |
Consolidate VFS memory managementv0.6.66
Diffstat (limited to 'libarchive')
| -rw-r--r-- | libarchive/libarchive.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/libarchive/libarchive.c b/libarchive/libarchive.c index bb6c1ac..b6dd955 100644 --- a/libarchive/libarchive.c +++ b/libarchive/libarchive.c @@ -104,7 +104,7 @@ VFSNew (TVFSLogFunc log_func) globs->callback_progress = NULL; globs->log_func = log_func; - if (globs->log_func != NULL) globs->log_func((char*)"libarchive plugin: VFSInit"); + if (globs->log_func != NULL) globs->log_func("libarchive plugin: VFSInit"); return globs; } @@ -125,7 +125,7 @@ VFSSetCallbacks (struct TVFSGlobs *globs, void VFSFree (struct TVFSGlobs *globs) { - if (globs->log_func != NULL) globs->log_func((char*)"libarchive plugin: VFSDestroy"); + if (globs->log_func != NULL) globs->log_func("libarchive plugin: VFSDestroy"); free (globs); } @@ -134,30 +134,29 @@ int VFSVersion() return cVFSVersion; } -struct TVFSInfo VFSGetInfo() +struct TVFSInfo * +VFSGetInfo() { - struct TVFSInfo module_info; - module_info.ID = "libarchive_plugin"; - module_info.Name = "libarchive plugin"; - char *s = (char*)malloc(255); - snprintf(s, 255, "version %s, build date: %s\nusing %s\n", - VERSION, BUILD_DATE, ARCHIVE_LIBRARY_VERSION); - module_info.About = strdup(s); - free(s); - s = (char*)malloc(255); - snprintf(s, 255, "Plugin Copyright (C) 2008-2009 Tomáš Bžatek\nlibarchive sources Copyright (c) 2003-2007 Tim Kientzle"); - module_info.Copyright = strdup(s); + struct TVFSInfo *module_info = g_malloc0 (sizeof (struct TVFSInfo)); + + module_info->ID = g_strdup ("libarchive_plugin"); + module_info->Name = g_strdup ("libarchive plugin"); + module_info->About = g_strdup_printf ("version %s, build date: %s\nusing %s\n", VERSION, BUILD_DATE, ARCHIVE_LIBRARY_VERSION); + module_info->Copyright = g_strdup ("Plugin Copyright (C) 2008-2009 Tomáš Bžatek\nlibarchive sources Copyright (c) 2003-2007 Tim Kientzle"); + return module_info; } -char *VFSGetPrefix(struct TVFSGlobs *globs) +char * +VFSGetPrefix (struct TVFSGlobs *globs) { - return globs->archive_path; + return g_strdup (globs->archive_path); } -char *VFSGetExts() +char * +VFSGetExts () { - return (char*)"tar;tar.gz;tar.bz2;tgz;tbz2;cpio;iso;a;deb"; + return g_strdup ("tar;tar.gz;tar.bz2;tgz;tbz2;cpio;iso;a;deb"); } @@ -302,9 +301,10 @@ TVFSResult VFSClose(struct TVFSGlobs *globs) return cVFS_OK; } -char *VFSGetPath(struct TVFSGlobs *globs) +char * +VFSGetPath (struct TVFSGlobs *globs) { - return include_trailing_path_sep(globs->curr_dir); + return include_trailing_path_sep (globs->curr_dir); } u_int64_t VFSGetFileSystemFree(struct TVFSGlobs *globs, char *APath) |
