paragui-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[paragui-cvs] CVS: paragui/src/physfs/archivers Makefile.am,1.1.1.1.6.1,


From: Alexander Pipelka <address@hidden>
Subject: [paragui-cvs] CVS: paragui/src/physfs/archivers Makefile.am,1.1.1.1.6.1,1.1.1.1.6.2 dir.c,1.1.1.1.6.1,1.1.1.1.6.2 grp.c,1.1.1.1.6.1,1.1.1.1.6.2 unzip.c,1.1.1.1.6.1,1.1.1.1.6.2 zip.c,1.1.1.1.6.1,1.1.1.1.6.2
Date: Fri, 21 Jun 2002 16:07:55 -0400

Update of /cvsroot/paragui/paragui/src/physfs/archivers
In directory subversions:/tmp/cvs-serv22775/archivers

Modified Files:
      Tag: devel-1-0
        Makefile.am dir.c grp.c unzip.c zip.c 
Log Message:
updated phyfs part 1



Index: Makefile.am
===================================================================
RCS file: /cvsroot/paragui/paragui/src/physfs/archivers/Makefile.am,v
retrieving revision 1.1.1.1.6.1
retrieving revision 1.1.1.1.6.2
diff -C2 -r1.1.1.1.6.1 -r1.1.1.1.6.2
*** Makefile.am 3 May 2002 10:15:33 -0000       1.1.1.1.6.1
--- Makefile.am 21 Jun 2002 20:07:52 -0000      1.1.1.1.6.2
***************
*** 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,10 ----
! noinst_LTLIBRARIES = libarchivers.la
  
  libarchivers_la_SOURCES = \
        dir.c \
+       grp.c \
        unzip.c \
        zip.c
  
  EXTRA_DIST = \
        unzip.h

Index: dir.c
===================================================================
RCS file: /cvsroot/paragui/paragui/src/physfs/archivers/dir.c,v
retrieving revision 1.1.1.1.6.1
retrieving revision 1.1.1.1.6.2
diff -C2 -r1.1.1.1.6.1 -r1.1.1.1.6.2
*** dir.c       3 May 2002 10:15:33 -0000       1.1.1.1.6.1
--- dir.c       21 Jun 2002 20:07:52 -0000      1.1.1.1.6.2
***************
*** 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.1.1.1.6.1
retrieving revision 1.1.1.1.6.2
diff -C2 -r1.1.1.1.6.1 -r1.1.1.1.6.2
*** grp.c       3 May 2002 10:15:33 -0000       1.1.1.1.6.1
--- grp.c       21 Jun 2002 20:07:52 -0000      1.1.1.1.6.2
***************
*** 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.1.1.1.6.1
retrieving revision 1.1.1.1.6.2
diff -C2 -r1.1.1.1.6.1 -r1.1.1.1.6.2
*** unzip.c     3 May 2002 10:15:33 -0000       1.1.1.1.6.1
--- unzip.c     21 Jun 2002 20:07:52 -0000      1.1.1.1.6.2
***************
*** 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.1.1.1.6.1
retrieving revision 1.1.1.1.6.2
diff -C2 -r1.1.1.1.6.1 -r1.1.1.1.6.2
*** zip.c       3 May 2002 10:15:33 -0000       1.1.1.1.6.1
--- zip.c       21 Jun 2002 20:07:52 -0000      1.1.1.1.6.2
***************
*** 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 ... */




reply via email to

[Prev in Thread] Current Thread [Next in Thread]