summaryrefslogtreecommitdiff
path: root/unrar/unrar.c
diff options
context:
space:
mode:
authorTomas Bzatek <tbzatek@users.sourceforge.net>2009-11-29 13:32:03 +0100
committerTomas Bzatek <tbzatek@users.sourceforge.net>2009-11-29 13:32:03 +0100
commit736d90da1b6cee6333889912513c634d55004d90 (patch)
tree020ebaad508bf80f69bce17026d729a26f69f1e4 /unrar/unrar.c
parentae2be16f015cb0db7c5b6bd1669baaf53be702d1 (diff)
downloadtuxcmd-modules-736d90da1b6cee6333889912513c634d55004d90.tar.xz
Introduce inode_no property
Diffstat (limited to 'unrar/unrar.c')
-rw-r--r--unrar/unrar.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/unrar/unrar.c b/unrar/unrar.c
index f24aca5..f804ff2 100644
--- a/unrar/unrar.c
+++ b/unrar/unrar.c
@@ -326,6 +326,7 @@ VFSOpenArchive (struct TVFSGlobs *globs, const char *sName)
TVFSResult Result;
HANDLE PASCAL handle;
struct RAROpenArchiveDataEx *archive_data;
+ guint64 inode_no;
Result = cVFS_OK;
@@ -336,6 +337,7 @@ VFSOpenArchive (struct TVFSGlobs *globs, const char *sName)
globs->total_size = 0;
globs->failed_passwd_callback = FALSE;
globs->volume_missing_abort = FALSE;
+ inode_no = 0;
fprintf (stderr, "(--) VFSOpenArchive: trying to open archive '%s'...\n", globs->archive_path);
/* WARNING: do not use g_malloc0() here, leads to memory corruption */
@@ -372,11 +374,14 @@ VFSOpenArchive (struct TVFSGlobs *globs, const char *sName)
while ((res = RARReadHeaderEx(handle, header)) == 0) {
// printf(" header->FileName = '%s', Flags = 0x%x\n", header->FileName, header->Flags);
+ inode_no++;
+
/* Create a TVFSItem entry and fill all info */
struct TVFSItem *item = g_malloc0 (sizeof (struct TVFSItem));
item->iSize = (guint64)((guint64)(header->UnpSizeHigh * 0x100000000) + (guint64)header->UnpSize);
item->iPackedSize = (guint64)((guint64)(header->PackSizeHigh * 0x100000000) + (guint64)header->PackSize);
+ item->inode_no = inode_no;
globs->total_size += item->iSize;
if ((header->Flags & 0x00e0 /* LHD_WINDOWMASK */ ) == 0x00e0 /* LHD_DIRECTORY */)
item->ItemType = vDirectory;
@@ -416,7 +421,7 @@ VFSOpenArchive (struct TVFSGlobs *globs, const char *sName)
// g_print (" ansi = '%s'\n wide = '%ls'\n utf8 = '%s'\n", header->FileName, header->FileNameW, s);
// Add item to the global list and continue with next file
- filelist_tree_add_item (globs->files, s, item, header->FileName, 0);
+ filelist_tree_add_item (globs->files, s, item, header->FileName, inode_no);
g_free (s);
int PASCAL res2 = RARProcessFile (handle, RAR_SKIP, NULL, NULL);