[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[paragui-cvs] CVS: paragui/src/physfs/archivers Makefile.am,1.2,1.3 dir.
From: |
Alexander Pipelka <address@hidden> |
Subject: |
[paragui-cvs] CVS: paragui/src/physfs/archivers Makefile.am,1.2,1.3 dir.c,1.2,1.3 grp.c,1.2,1.3 unzip.c,1.2,1.3 zip.c,1.2,1.3 |
Date: |
Wed, 26 Jun 2002 04:30:14 -0400 |
Update of /cvsroot/paragui/paragui/src/physfs/archivers
In directory subversions:/tmp/cvs-serv6214/src/physfs/archivers
Modified Files:
Makefile.am dir.c grp.c unzip.c zip.c
Log Message:
updated physfs
Index: Makefile.am
===================================================================
RCS file: /cvsroot/paragui/paragui/src/physfs/archivers/Makefile.am,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** Makefile.am 27 Apr 2002 16:06:26 -0000 1.2
--- Makefile.am 26 Jun 2002 08:30:11 -0000 1.3
***************
*** 1,12 ****
! noinst_LTLIBRARIES=libarchivers.la
libarchivers_la_SOURCES = \
dir.c \
unzip.c \
zip.c
- INCLUDES=-I$(top_srcdir)/src/physfs -DPHYSFS_SUPPORTS_ZIP
-
EXTRA_DIST = \
- grp.c \
unzip.h
--- 1,12 ----
! noinst_LTLIBRARIES = libarchivers.la
libarchivers_la_SOURCES = \
dir.c \
+ grp.c \
unzip.c \
zip.c
EXTRA_DIST = \
unzip.h
+
+ INCLUDES = -I$(top_srcdir)
Index: dir.c
===================================================================
RCS file: /cvsroot/paragui/paragui/src/physfs/archivers/dir.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** dir.c 27 Apr 2002 16:06:26 -0000 1.2
--- dir.c 26 Jun 2002 08:30:11 -0000 1.3
***************
*** 7,10 ****
--- 7,14 ----
*/
+ #if HAVE_CONFIG_H
+ # include <config.h>
+ #endif
+
#include <stdio.h>
#include <stdlib.h>
***************
*** 35,38 ****
--- 39,43 ----
static int DIR_isSymLink(DirHandle *h, const char *name);
static FileHandle *DIR_openRead(DirHandle *h, const char *filename);
+ static PHYSFS_sint64 DIR_getLastModTime(DirHandle *h, const char *name);
static FileHandle *DIR_openWrite(DirHandle *h, const char *filename);
static FileHandle *DIR_openAppend(DirHandle *h, const char *filename);
***************
*** 74,77 ****
--- 79,83 ----
DIR_isDirectory, /* isDirectory() method */
DIR_isSymLink, /* isSymLink() method */
+ DIR_getLastModTime, /* getLastModTime() method */
DIR_openRead, /* openRead() method */
DIR_openWrite, /* openWrite() method */
***************
*** 231,239 ****
int retval;
! BAIL_IF_MACRO(f == NULL, NULL, 0); /* !!! might be a problem. */
retval = __PHYSFS_platformIsSymLink(f);
free(f);
return(retval);
} /* DIR_isSymLink */
--- 237,257 ----
int retval;
! BAIL_IF_MACRO(f == NULL, NULL, 0);
retval = __PHYSFS_platformIsSymLink(f);
free(f);
return(retval);
} /* DIR_isSymLink */
+
+
+ static PHYSFS_sint64 DIR_getLastModTime(DirHandle *h, const char *name)
+ {
+ char *d = __PHYSFS_platformCvtToDependent((char *)(h->opaque), name,
NULL);
+ PHYSFS_sint64 retval;
+
+ BAIL_IF_MACRO(d == NULL, NULL, 0);
+ retval = __PHYSFS_platformGetLastModTime(d);
+ free(d);
+ return(retval);
+ } /* DIR_getLastModTime */
Index: grp.c
===================================================================
RCS file: /cvsroot/paragui/paragui/src/physfs/archivers/grp.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** grp.c 27 Apr 2002 16:06:26 -0000 1.2
--- grp.c 26 Jun 2002 08:30:11 -0000 1.3
***************
*** 29,32 ****
--- 29,38 ----
*/
+ #if HAVE_CONFIG_H
+ # include <config.h>
+ #endif
+
+ #if (defined PHYSFS_SUPPORTS_GRP)
+
#include <stdio.h>
#include <stdlib.h>
***************
*** 40,47 ****
#include "physfs_internal.h"
- #if (!defined PHYSFS_SUPPORTS_GRP)
- #error PHYSFS_SUPPORTS_GRP must be defined.
- #endif
-
typedef struct
{
--- 46,49 ----
***************
*** 75,78 ****
--- 77,81 ----
static int GRP_isDirectory(DirHandle *h, const char *name);
static int GRP_isSymLink(DirHandle *h, const char *name);
+ static PHYSFS_sint64 GRP_getLastModTime(DirHandle *h, const char *name);
static FileHandle *GRP_openRead(DirHandle *h, const char *name);
***************
*** 97,100 ****
--- 100,104 ----
GRP_isDirectory, /* isDirectory() method */
GRP_isSymLink, /* isSymLink() method */
+ GRP_getLastModTime, /* getLastModTime() method */
GRP_openRead, /* openRead() method */
NULL, /* openWrite() method */
***************
*** 402,405 ****
--- 406,416 ----
+ static PHYSFS_sint64 GRP_getLastModTime(DirHandle *h, const char *name)
+ {
+ /* Just return the time of the GRP itself in the physical filesystem. */
+ return(__PHYSFS_platformGetLastModTime(((GRPinfo *)
h->opaque)->filename));
+ } /* GRP_getLastModTime */
+
+
static FileHandle *GRP_openRead(DirHandle *h, const char *name)
{
***************
*** 438,441 ****
--- 449,454 ----
return(retval);
} /* GRP_openRead */
+
+ #endif /* defined PHYSFS_SUPPORTS_GRP */
/* end of grp.c ... */
Index: unzip.c
===================================================================
RCS file: /cvsroot/paragui/paragui/src/physfs/archivers/unzip.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** unzip.c 27 Apr 2002 16:06:26 -0000 1.2
--- unzip.c 26 Jun 2002 08:30:11 -0000 1.3
***************
*** 5,8 ****
--- 5,13 ----
*/
+ #if HAVE_CONFIG_H
+ # include <config.h>
+ #endif
+
+ #if (defined PHYSFS_SUPPORTS_ZIP)
#include <stdio.h>
***************
*** 15,22 ****
#include "physfs_internal.h"
- #if (!defined PHYSFS_SUPPORTS_ZIP)
- #error PHYSFS_SUPPORTS_ZIP must be defined.
- #endif
-
#ifdef STDC
# include <stddef.h>
--- 20,23 ----
***************
*** 1317,1319 ****
--- 1318,1324 ----
return (int)uReadThis;
}
+
+ #endif /* defined PHYSFS_SUPPORTS_ZIP */
+
+ /* end of unzip.c ... */
Index: zip.c
===================================================================
RCS file: /cvsroot/paragui/paragui/src/physfs/archivers/zip.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** zip.c 27 Apr 2002 16:06:26 -0000 1.2
--- zip.c 26 Jun 2002 08:30:11 -0000 1.3
***************
*** 7,10 ****
--- 7,16 ----
*/
+ #if HAVE_CONFIG_H
+ # include <config.h>
+ #endif
+
+ #if (defined PHYSFS_SUPPORTS_ZIP)
+
/*
* !!! FIXME: overall design bugs.
***************
*** 21,24 ****
--- 27,31 ----
#include <string.h>
#include <assert.h>
+ #include <time.h>
#include "physfs.h"
#include "unzip.h"
***************
*** 28,35 ****
#include "physfs_internal.h"
- #if (!defined PHYSFS_SUPPORTS_ZIP)
- #error PHYSFS_SUPPORTS_ZIP must be defined.
- #endif
-
#define MAXZIPENTRYSIZE 256
--- 35,38 ----
***************
*** 74,77 ****
--- 77,81 ----
static int ZIP_isDirectory(DirHandle *h, const char *name);
static int ZIP_isSymLink(DirHandle *h, const char *name);
+ static PHYSFS_sint64 ZIP_getLastModTime(DirHandle *h, const char *name);
static FileHandle *ZIP_openRead(DirHandle *h, const char *filename);
static void ZIP_dirClose(DirHandle *h);
***************
*** 98,101 ****
--- 102,106 ----
ZIP_isDirectory, /* isDirectory() method */
ZIP_isSymLink, /* isSymLink() method */
+ ZIP_getLastModTime, /* getLastModTime() method */
ZIP_openRead, /* openRead() method */
NULL, /* openWrite() method */
***************
*** 579,582 ****
--- 584,613 ----
+ static PHYSFS_sint64 ZIP_getLastModTime(DirHandle *h, const char *name)
+ {
+ ZIPinfo *zi = (ZIPinfo *) (h->opaque);
+ int pos = ZIP_exists_symcheck(h, name, SYMLINK_RECURSE_COUNT);
+ ZIPentry *entry;
+ struct tm t;
+
+ if (pos == -1)
+ return(0);
+
+ entry = &zi->entries[pos];
+
+ /* if it's a symlink, then we ran into a possible symlink loop. */
+ BAIL_IF_MACRO(entry->symlink != NULL, ERR_TOO_MANY_SYMLINKS, 0);
+
+ memset(&t, '\0', sizeof (t));
+ t.tm_year = entry->info.tmu_date.tm_year - 1900;
+ t.tm_mon = entry->info.tmu_date.tm_mon;
+ t.tm_mday = entry->info.tmu_date.tm_mday;
+ t.tm_hour = entry->info.tmu_date.tm_hour;
+ t.tm_min = entry->info.tmu_date.tm_min;
+ t.tm_sec = entry->info.tmu_date.tm_sec;
+ return((PHYSFS_sint64) mktime(&t));
+ } /* ZIP_getLastModTime */
+
+
static int ZIP_isDirectory(DirHandle *h, const char *name)
{
***************
*** 670,673 ****
--- 701,706 ----
free(h);
} /* ZIP_dirClose */
+
+ #endif /* defined PHYSFS_SUPPORTS_ZIP */
/* end of zip.c ... */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [paragui-cvs] CVS: paragui/src/physfs/archivers Makefile.am,1.2,1.3 dir.c,1.2,1.3 grp.c,1.2,1.3 unzip.c,1.2,1.3 zip.c,1.2,1.3,
Alexander Pipelka <address@hidden> <=
- Prev by Date:
[paragui-cvs] CVS: paragui/src/physfs/test .cvsignore,1.1,1.2 Makefile.am,1.1,1.2 test_physfs.c,1.1,1.2
- Next by Date:
[paragui-cvs] CVS: paragui/src/physfs/platform beos.cpp,1.1,1.2 posix.c,1.1,1.2 Makefile.am,1.2,1.3 macclassic.c,1.1,1.2 skeleton.c,1.1,1.2 unix.c,1.2,1.3 win32.c,1.2,1.3
- Previous by thread:
[paragui-cvs] CVS: paragui/src/physfs/test .cvsignore,1.1,1.2 Makefile.am,1.1,1.2 test_physfs.c,1.1,1.2
- Next by thread:
[paragui-cvs] CVS: paragui/src/physfs/platform beos.cpp,1.1,1.2 posix.c,1.1,1.2 Makefile.am,1.2,1.3 macclassic.c,1.1,1.2 skeleton.c,1.1,1.2 unix.c,1.2,1.3 win32.c,1.2,1.3
- Index(es):