summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorTomas Bzatek <tbzatek@users.sourceforge.net>2009-10-04 16:30:10 +0200
committerTomas Bzatek <tbzatek@users.sourceforge.net>2009-10-04 16:30:10 +0200
commit7baf84f22bcf68f0c4a14a5ff404119aafe2666a (patch)
tree260be56a2da98ab48a2cc6d7ddbb36b4adbe3074 /common
parent88ce42250dc9cd1b69eb734b88226a5bd408c4d5 (diff)
downloadtuxcmd-modules-0.6.66.tar.xz
Consolidate VFS memory managementv0.6.66
Diffstat (limited to 'common')
-rw-r--r--common/vfs_types.h10
-rw-r--r--common/vfsutils.c28
2 files changed, 20 insertions, 18 deletions
diff --git a/common/vfs_types.h b/common/vfs_types.h
index 658c639..071b666 100644
--- a/common/vfs_types.h
+++ b/common/vfs_types.h
@@ -49,7 +49,7 @@ typedef enum {
} TVFSPasswordSave;
-typedef void (* TVFSLogFunc)(char *s);
+typedef void (* TVFSLogFunc)(const char *s);
typedef void *TVFSFileDes;
@@ -152,10 +152,10 @@ struct TVFSItem {
};
struct TVFSInfo {
- const char *ID; // unique identifier, not shown in GUI
- const char *Name; // plugin name, GUI string (UTF-8)
- const char *About; // GUI string (UTF-8)
- const char *Copyright; // GUI string (UTF-8)
+ char *ID; // unique identifier, not shown in GUI
+ char *Name; // plugin name, GUI string (UTF-8)
+ char *About; // GUI string (UTF-8)
+ char *Copyright; // GUI string (UTF-8)
};
diff --git a/common/vfsutils.c b/common/vfsutils.c
index 71080eb..173c0df 100644
--- a/common/vfsutils.c
+++ b/common/vfsutils.c
@@ -30,28 +30,30 @@
void copy_vfs_item(struct TVFSItem *src, struct TVFSItem *dst)
{
-/*
- dst->ItemType = src->ItemType;
+ dst->FName = g_strdup (src->FName);
+ dst->FDisplayName = g_strdup (src->FDisplayName);
+ dst->iSize = src->iSize;
+ dst->iPackedSize = src->iPackedSize;
+ dst->m_time = src->m_time;
dst->a_time = src->a_time;
dst->c_time = src->c_time;
- dst->iGID = src->iGID;
dst->iMode = src->iMode;
- dst->iSize = src->iSize;
+ dst->sLinkTo = g_strdup (src->sLinkTo);
dst->iUID = src->iUID;
- dst->m_time = src->m_time;
- dst->sFileName = src->sFileName;
- dst->sLinkTo = src->sLinkTo;
- */
- memcpy(dst, src, sizeof(struct TVFSItem));
+ dst->iGID = src->iGID;
+ dst->ItemType = src->ItemType;
}
void free_vfs_item(struct TVFSItem *item)
{
if (item) {
- if (item->FName) free(item->FName);
- if (item->FDisplayName) free(item->FDisplayName);
- if (item->sLinkTo) free(item->sLinkTo);
- free(item);
+ if (item->FName)
+ free(item->FName);
+ if (item->FDisplayName)
+ free(item->FDisplayName);
+ if (item->sLinkTo)
+ free(item->sLinkTo);
+ free(item);
}
}