Some minor fixes and cleanups.
authorRyan C. Gordon <icculus@icculus.org>
Tue, 11 Apr 2006 15:01:15 +0000
changeset 775 a8cc6b8a8e9c
parent 774 916c2e81e77f
child 776 b97a646252d9
Some minor fixes and cleanups.
archivers/lzma.c
archivers/zip.c
configure.in
lzma/7zAlloc.h
lzma/7zDecode.c
lzma/LzmaStateDecode.h
physfs_internal.h
--- a/archivers/lzma.c	Tue Apr 11 14:33:48 2006 +0000
+++ b/archivers/lzma.c	Tue Apr 11 15:01:15 2006 +0000
@@ -543,7 +543,7 @@
     if ((folder->NumPackStreams != 1) || (folder->NumCoders != 1))
     {
         LZMA_fileClose(entry);
-        BAIL_MACRO(ERR_LZMA_NOTIMPL, NULL);
+        BAIL_MACRO(ERR_NOT_IMPLEMENTED, NULL);
     } /* if */
 
     if (lzma_err(LzmaDecodeProperties(&entry->state.Properties, coder->Properties.Items, coder->Properties.Capacity)) != LZMA_RESULT_OK)
--- a/archivers/zip.c	Tue Apr 11 14:33:48 2006 +0000
+++ b/archivers/zip.c	Tue Apr 11 15:01:15 2006 +0000
@@ -154,12 +154,12 @@
 #ifndef _WIN32_WCE
         case Z_ERRNO: return(strerror(errno));
 #endif
-        case Z_NEED_DICT: return(ERR_ZLIB_NEED_DICT);
-        case Z_DATA_ERROR: return(ERR_ZLIB_DATA_ERROR);
-        case Z_MEM_ERROR: return(ERR_ZLIB_MEMORY_ERROR);
-        case Z_BUF_ERROR: return(ERR_ZLIB_BUFFER_ERROR);
-        case Z_VERSION_ERROR: return(ERR_ZLIB_VERSION_ERROR);
-        default: return(ERR_ZLIB_UNKNOWN_ERROR);
+        case Z_NEED_DICT: return(ERR_NEED_DICT);
+        case Z_DATA_ERROR: return(ERR_DATA_ERROR);
+        case Z_MEM_ERROR: return(ERR_MEMORY_ERROR);
+        case Z_BUF_ERROR: return(ERR_BUFFER_ERROR);
+        case Z_VERSION_ERROR: return(ERR_VERSION_ERROR);
+        default: return(ERR_UNKNOWN_ERROR);
     } /* switch */
 
     return(NULL);
--- a/configure.in	Tue Apr 11 14:33:48 2006 +0000
+++ b/configure.in	Tue Apr 11 15:01:15 2006 +0000
@@ -143,7 +143,7 @@
  
 dnl Check for lzma archiver inclusion...
 AC_ARG_ENABLE(lzma,
-[  --enable-lzma               enable lzma support [default=yes]],
+[  --enable-lzma              enable lzma support [default=yes]],
                 , enable_lzma=yes)
 if test x$enable_lzma = xyes; then
   AC_DEFINE([PHYSFS_SUPPORTS_LZMA], 1, [define if lzma support is enabled])
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lzma/7zAlloc.h	Tue Apr 11 15:01:15 2006 +0000
@@ -0,0 +1,21 @@
+/* 7zAlloc.h */
+
+#ifndef __7Z_ALLOC_H
+#define __7Z_ALLOC_H
+
+#include <stddef.h>
+
+typedef struct _ISzAlloc
+{
+  void *(*Alloc)(size_t size);
+  void (*Free)(void *address); /* address can be 0 */
+} ISzAlloc;
+
+void *SzAlloc(size_t size);
+void SzFree(void *address);
+
+void *SzAllocTemp(size_t size);
+void SzFreeTemp(void *address);
+
+#endif
+
--- a/lzma/7zDecode.c	Tue Apr 11 14:33:48 2006 +0000
+++ b/lzma/7zDecode.c	Tue Apr 11 15:01:15 2006 +0000
@@ -1,7 +1,7 @@
 /* 7zDecode.c */
 
 #include "7zDecode.h"
-#include "LzmaStateDecode.h" // NOTE : Modified to use LzmaStateDecode(.c,.h) instead of LzmaDecode(.c,.h) and hardcoded _SZ_ONE_DIRECTORY behaviour
+#include "LzmaStateDecode.h" /* NOTE : Modified to use LzmaStateDecode(.c,.h) instead of LzmaDecode(.c,.h) and hardcoded _SZ_ONE_DIRECTORY behaviour */
 
 CMethodID k_Copy = { { 0x0 }, 1 };
 CMethodID k_LZMA = { { 0x3, 0x1, 0x1 }, 3 };
@@ -131,7 +131,7 @@
         inBuffer, (size_t)inSize, &inProcessed,
         #endif
         outBuffer, (size_t)outSize, &outSizeProcessedLoc,
-	1); // NOTE : Added by Dennis Schridde to make SzDecode be compatible with LzmaStateDecode(.c,.h)
+	1); /* NOTE : Added by Dennis Schridde to make SzDecode be compatible with LzmaStateDecode(.c,.h) */
     *outSizeProcessed = (size_t)outSizeProcessedLoc;
     allocMain->Free(state.Probs);
     #ifdef _LZMA_OUT_READ
--- a/lzma/LzmaStateDecode.h	Tue Apr 11 14:33:48 2006 +0000
+++ b/lzma/LzmaStateDecode.h	Tue Apr 11 15:01:15 2006 +0000
@@ -38,7 +38,7 @@
 #endif
 #endif
 
-// NOTE : Hardcoded _LZMA_SYSTEM_SIZE_T behaviour by Dennis Schridde
+/* NOTE : Hardcoded _LZMA_SYSTEM_SIZE_T behaviour by Dennis Schridde */
 #include <stddef.h>
 
 #ifdef _LZMA_PROB32
--- a/physfs_internal.h	Tue Apr 11 14:33:48 2006 +0000
+++ b/physfs_internal.h	Tue Apr 11 15:01:15 2006 +0000
@@ -56,8 +56,8 @@
  #define MVL_ARCHIVE_DESCRIPTION  "Descent II Movielib format"
  #define QPAK_ARCHIVE_DESCRIPTION "Quake I/II format"
  #define ZIP_ARCHIVE_DESCRIPTION  "PkZip/WinZip/Info-Zip compatible"
+ #define WAD_ARCHIVE_DESCRIPTION  "DOOM engine format"
  #define LZMA_ARCHIVE_DESCRIPTION "LZMA (7zip) format"
- #define WAD_ARCHIVE_DESCRIPTION  "DOOM engine format"
 
  #define ERR_IS_INITIALIZED       "Already initialized"
  #define ERR_NOT_INITIALIZED      "Not initialized"
@@ -155,7 +155,8 @@
  #define MVL_ARCHIVE_DESCRIPTION  "Descent II Movielib format"
  #define QPAK_ARCHIVE_DESCRIPTION "Quake I/II format"
  #define ZIP_ARCHIVE_DESCRIPTION  "PkZip/WinZip/Info-Zip kompatibel"
- #define WAD_ARCHIVE_DESCRIPTION  "DOOM engine format"
+ #define WAD_ARCHIVE_DESCRIPTION  "DOOM engine format" /* !!! FIXME: translate this line if needed */
+ #define LZMA_ARCHIVE_DESCRIPTION "LZMA (7zip) format" /* !!! FIXME: translate this line if needed */
 
  #define ERR_IS_INITIALIZED       "Bereits initialisiert"
  #define ERR_NOT_INITIALIZED      "Nicht initialisiert"
@@ -190,12 +191,12 @@
  #define ERR_BAD_FILENAME         "Unzulssiger Dateiname"
  #define ERR_PHYSFS_BAD_OS_CALL   "(BUG) PhysicsFS verursachte einen ungltigen Systemaufruf"
  #define ERR_ARGV0_IS_NULL        "argv0 ist NULL"
- #define ERR_NEED_DICT       "brauche Wrterbuch"
- #define ERR_DATA_ERROR      "Datenfehler"
- #define ERR_MEMORY_ERROR    "Speicherfehler"
- #define ERR_BUFFER_ERROR    "Bufferfehler"
- #define ERR_VERSION_ERROR   "Versionskonflikt"
- #define ERR_UNKNOWN_ERROR   "Unbekannter Fehler"
+ #define ERR_NEED_DICT            "brauche Wrterbuch"
+ #define ERR_DATA_ERROR           "Datenfehler"
+ #define ERR_MEMORY_ERROR         "Speicherfehler"
+ #define ERR_BUFFER_ERROR         "Bufferfehler"
+ #define ERR_VERSION_ERROR        "Versionskonflikt"
+ #define ERR_UNKNOWN_ERROR        "Unbekannter Fehler"
  #define ERR_SEARCHPATH_TRUNC     "Suchpfad war abgeschnitten"
  #define ERR_GETMODFN_TRUNC       "GetModuleFileName() war abgeschnitten"
  #define ERR_GETMODFN_NO_DIR      "GetModuleFileName() bekam kein Verzeichnis"
@@ -252,7 +253,8 @@
  #define HOG_ARCHIVE_DESCRIPTION  "Descent I/II HOG file format"
  #define MVL_ARCHIVE_DESCRIPTION  "Descent II Movielib format"
  #define ZIP_ARCHIVE_DESCRIPTION  "PkZip/WinZip/Info-Zip "
- #define WAD_ARCHIVE_DESCRIPTION  "DOOM engine format" // !!! FIXME: translate this line if needed
+ #define WAD_ARCHIVE_DESCRIPTION  "DOOM engine format" /* !!! FIXME: translate this line if needed */
+ #define LZMA_ARCHIVE_DESCRIPTION "LZMA (7zip) format" /* !!! FIXME: translate this line if needed */
 
  #define ERR_IS_INITIALIZED       " "
  #define ERR_NOT_INITIALIZED      " "
@@ -287,12 +289,12 @@
  #define ERR_BAD_FILENAME         "  "
  #define ERR_PHYSFS_BAD_OS_CALL   "(BUG) PhysicsFS    "
  #define ERR_ARGV0_IS_NULL        "argv0 is NULL"
- #define ERR_NEED_DICT       " "
- #define ERR_DATA_ERROR      " "
- #define ERR_MEMORY_ERROR    " "
- #define ERR_BUFFER_ERROR    " "
- #define ERR_VERSION_ERROR   " "
- #define ERR_UNKNOWN_ERROR   " "
+ #define ERR_NEED_DICT            " "
+ #define ERR_DATA_ERROR           " "
+ #define ERR_MEMORY_ERROR         " "
+ #define ERR_BUFFER_ERROR         " "
+ #define ERR_VERSION_ERROR        " "
+ #define ERR_UNKNOWN_ERROR        " "
  #define ERR_SEARCHPATH_TRUNC     "  "
  #define ERR_GETMODFN_TRUNC       "GetModuleFileName() "
  #define ERR_GETMODFN_NO_DIR      "GetModuleFileName()   "
@@ -349,7 +351,8 @@
  #define HOG_ARCHIVE_DESCRIPTION  "Descent I/II HOG file format"
  #define MVL_ARCHIVE_DESCRIPTION  "Descent II Movielib format"
  #define ZIP_ARCHIVE_DESCRIPTION  "PkZip/WinZip/Info-Zip "
- #define WAD_ARCHIVE_DESCRIPTION  "DOOM engine format" // FIXME: translate this line if needed
+ #define WAD_ARCHIVE_DESCRIPTION  "DOOM engine format" /* !!! FIXME: translate this line if needed */
+ #define LZMA_ARCHIVE_DESCRIPTION "LZMA (7zip) format" /* !!! FIXME: translate this line if needed */
 
  #define ERR_IS_INITIALIZED       " "
  #define ERR_NOT_INITIALIZED      " "
@@ -384,12 +387,12 @@
  #define ERR_BAD_FILENAME         "  "
  #define ERR_PHYSFS_BAD_OS_CALL   "(BUG) PhysicsFS    "
  #define ERR_ARGV0_IS_NULL        "argv0 is NULL"
- #define ERR_NEED_DICT       " "
- #define ERR_DATA_ERROR      " "
- #define ERR_MEMORY_ERROR    " "
- #define ERR_BUFFER_ERROR    " "
- #define ERR_VERSION_ERROR   " "
- #define ERR_UNKNOWN_ERROR   " "
+ #define ERR_NEED_DICT            " "
+ #define ERR_DATA_ERROR           " "
+ #define ERR_MEMORY_ERROR         " "
+ #define ERR_BUFFER_ERROR         " "
+ #define ERR_VERSION_ERROR        " "
+ #define ERR_UNKNOWN_ERROR        " "
  #define ERR_SEARCHPATH_TRUNC     "  "
  #define ERR_GETMODFN_TRUNC       "GetModuleFileName() "
  #define ERR_GETMODFN_NO_DIR      "GetModuleFileName()   "
@@ -446,7 +449,8 @@
  #define HOG_ARCHIVE_DESCRIPTION  "Descent I/II HOG file format"
  #define MVL_ARCHIVE_DESCRIPTION  "Descent II Movielib format"
  #define ZIP_ARCHIVE_DESCRIPTION  "PkZip/WinZip/Info-Zip ᮢ⨬"
- #define WAD_ARCHIVE_DESCRIPTION  "DOOM engine format" // FIXME: Translate this line if needed
+ #define WAD_ARCHIVE_DESCRIPTION  "DOOM engine format" /* !!! FIXME: translate this line if needed */
+ #define LZMA_ARCHIVE_DESCRIPTION "LZMA (7zip) format" /* !!! FIXME: translate this line if needed */
 
  #define ERR_IS_INITIALIZED       " 樠஢"
  #define ERR_NOT_INITIALIZED      " 樠஢"
@@ -481,12 +485,12 @@
  #define ERR_BAD_FILENAME         "୮  䠩"
  #define ERR_PHYSFS_BAD_OS_CALL   "(BUG) PhysicsFS 믮  ⥬ 맮"
  #define ERR_ARGV0_IS_NULL        "argv0 is NULL"
- #define ERR_NEED_DICT       "㦥 ᫮"
- #define ERR_DATA_ERROR      "訡 "
- #define ERR_MEMORY_ERROR    "訡 "
- #define ERR_BUFFER_ERROR    "訡 "
- #define ERR_VERSION_ERROR   "訡 ᨨ"
- #define ERR_UNKNOWN_ERROR   "⭠ 訡"
+ #define ERR_NEED_DICT            "㦥 ᫮"
+ #define ERR_DATA_ERROR           "訡 "
+ #define ERR_MEMORY_ERROR         "訡 "
+ #define ERR_BUFFER_ERROR         "訡 "
+ #define ERR_VERSION_ERROR        "訡 ᨨ"
+ #define ERR_UNKNOWN_ERROR        "⭠ 訡"
  #define ERR_SEARCHPATH_TRUNC     " ᪠ १"
  #define ERR_GETMODFN_TRUNC       "GetModuleFileName() १"
  #define ERR_GETMODFN_NO_DIR      "GetModuleFileName()  稫 ⠫"
@@ -543,7 +547,8 @@
  #define HOG_ARCHIVE_DESCRIPTION  "Descent I/II HOG file format"
  #define MVL_ARCHIVE_DESCRIPTION  "Descent II Movielib format"
  #define ZIP_ARCHIVE_DESCRIPTION  "PkZip/WinZip/Info-Zip "
- #define WAD_ARCHIVE_DESCRIPTION  "DOOM engine format"  // FIXME: translate this line if needed
+ #define WAD_ARCHIVE_DESCRIPTION  "DOOM engine format" /* !!! FIXME: translate this line if needed */
+ #define LZMA_ARCHIVE_DESCRIPTION "LZMA (7zip) format" /* !!! FIXME: translate this line if needed */
 
  #define ERR_IS_INITIALIZED       " "
  #define ERR_NOT_INITIALIZED      " "
@@ -578,12 +583,12 @@
  #define ERR_BAD_FILENAME         "  "
  #define ERR_PHYSFS_BAD_OS_CALL   "(BUG) PhysicsFS    "
  #define ERR_ARGV0_IS_NULL        "argv0 is NULL"
- #define ERR_NEED_DICT       " "
- #define ERR_DATA_ERROR      " "
- #define ERR_MEMORY_ERROR    " "
- #define ERR_BUFFER_ERROR    " "
- #define ERR_VERSION_ERROR   " "
- #define ERR_UNKNOWN_ERROR   " "
+ #define ERR_NEED_DICT            " "
+ #define ERR_DATA_ERROR           " "
+ #define ERR_MEMORY_ERROR         " "
+ #define ERR_BUFFER_ERROR         " "
+ #define ERR_VERSION_ERROR        " "
+ #define ERR_UNKNOWN_ERROR        " "
  #define ERR_SEARCHPATH_TRUNC     "  "
  #define ERR_GETMODFN_TRUNC       "GetModuleFileName() "
  #define ERR_GETMODFN_NO_DIR      "GetModuleFileName()   "
@@ -643,6 +648,7 @@
  #define QPAK_ARCHIVE_DESCRIPTION "Quake I/II format"
  #define ZIP_ARCHIVE_DESCRIPTION  "Compatible PkZip/WinZip/Info-Zip"
  #define WAD_ARCHIVE_DESCRIPTION  "Format WAD du moteur DOOM"
+ #define LZMA_ARCHIVE_DESCRIPTION "LZMA (7zip) format" /* !!! FIXME: translate this line if needed */
 
  #define ERR_IS_INITIALIZED       "Dj initialis"
  #define ERR_NOT_INITIALIZED      "Non initialis"
@@ -677,12 +683,12 @@
  #define ERR_BAD_FILENAME         "Mauvais nom de fichier"
  #define ERR_PHYSFS_BAD_OS_CALL   "(BOGUE) PhysicsFS a fait un mauvais appel systme, le salaud"
  #define ERR_ARGV0_IS_NULL        "argv0 est NULL"
- #define ERR_NEED_DICT       "a besoin du dico"
- #define ERR_DATA_ERROR      "erreur de donnes"
- #define ERR_MEMORY_ERROR    "erreur mmoire"
- #define ERR_BUFFER_ERROR    "erreur tampon"
- #define ERR_VERSION_ERROR   "erreur de version"
- #define ERR_UNKNOWN_ERROR   "erreur inconnue"
+ #define ERR_NEED_DICT            "a besoin du dico"
+ #define ERR_DATA_ERROR           "erreur de donnes"
+ #define ERR_MEMORY_ERROR         "erreur mmoire"
+ #define ERR_BUFFER_ERROR         "erreur tampon"
+ #define ERR_VERSION_ERROR        "erreur de version"
+ #define ERR_UNKNOWN_ERROR        "erreur inconnue"
  #define ERR_SEARCHPATH_TRUNC     "Le chemin de recherche a t tronqu"
  #define ERR_GETMODFN_TRUNC       "GetModuleFileName() a t tronqu"
  #define ERR_GETMODFN_NO_DIR      "GetModuleFileName() n'a pas de rpertoire"
@@ -741,6 +747,8 @@
  #define QPAK_ARCHIVE_DESCRIPTION "Formato Quake I/II"
  #define ZIP_ARCHIVE_DESCRIPTION  "Formato compatvel PkZip/WinZip/Info-Zip"
  #define WAD_ARCHIVE_DESCRIPTION  "Formato WAD do engine DOOM"
+ #define WAD_ARCHIVE_DESCRIPTION  "DOOM engine format" /* !!! FIXME: translate this line if needed */
+ #define LZMA_ARCHIVE_DESCRIPTION "LZMA (7zip) format" /* !!! FIXME: translate this line if needed */
 
  #define ERR_IS_INITIALIZED       "J inicializado"
  #define ERR_NOT_INITIALIZED      "No inicializado"
@@ -775,12 +783,12 @@
  #define ERR_BAD_FILENAME         "Nome de arquivo invlido"
  #define ERR_PHYSFS_BAD_OS_CALL   "(BUG) PhysicsFS realizou uma chamada de sistema invlida"
  #define ERR_ARGV0_IS_NULL        "argv0  NULL"
- #define ERR_NEED_DICT       "precisa de diretrio"
- #define ERR_DATA_ERROR      "erro nos dados"
- #define ERR_MEMORY_ERROR    "erro de memria"
- #define ERR_BUFFER_ERROR    "erro de buffer"
- #define ERR_VERSION_ERROR   "erro na version"
- #define ERR_UNKNOWN_ERROR   "erro desconhecido"
+ #define ERR_NEED_DICT            "precisa de diretrio"
+ #define ERR_DATA_ERROR           "erro nos dados"
+ #define ERR_MEMORY_ERROR         "erro de memria"
+ #define ERR_BUFFER_ERROR         "erro de buffer"
+ #define ERR_VERSION_ERROR        "erro na version"
+ #define ERR_UNKNOWN_ERROR        "erro desconhecido"
  #define ERR_SEARCHPATH_TRUNC     "Caminho de procura quebrado"
  #define ERR_GETMODFN_TRUNC       "GetModuleFileName() foi quebrado"
  #define ERR_GETMODFN_NO_DIR      "GetModuleFileName() nao teve diretrio"
@@ -838,6 +846,8 @@
  #define MVL_ARCHIVE_DESCRIPTION  "Formato Descent II Movielib"
  #define QPAK_ARCHIVE_DESCRIPTION "Formato Quake I/II"
  #define ZIP_ARCHIVE_DESCRIPTION  "Compatible con PkZip/WinZip/Info-Zip"
+ #define WAD_ARCHIVE_DESCRIPTION  "DOOM engine format" /* !!! FIXME: translate this line if needed */
+ #define LZMA_ARCHIVE_DESCRIPTION "LZMA (7zip) format" /* !!! FIXME: translate this line if needed */
 
  #define ERR_IS_INITIALIZED       "Ya estaba inicializado"
  #define ERR_NOT_INITIALIZED      "No est inicializado"
@@ -872,12 +882,12 @@
  #define ERR_BAD_FILENAME         "Nombre de archivo incorrecto"
  #define ERR_PHYSFS_BAD_OS_CALL   "(BUG) PhysicsFS ha hecho una llamada incorrecta al sistema"
  #define ERR_ARGV0_IS_NULL        "argv0 es NULL"
- #define ERR_NEED_DICT       "necesito diccionario"
- #define ERR_DATA_ERROR      "error de datos"
- #define ERR_MEMORY_ERROR    "error de memoria"
- #define ERR_BUFFER_ERROR    "error de buffer"
- #define ERR_VERSION_ERROR   "error de versin"
- #define ERR_UNKNOWN_ERROR   "error desconocido"
+ #define ERR_NEED_DICT            "necesito diccionario"
+ #define ERR_DATA_ERROR           "error de datos"
+ #define ERR_MEMORY_ERROR         "error de memoria"
+ #define ERR_BUFFER_ERROR         "error de buffer"
+ #define ERR_VERSION_ERROR        "error de versin"
+ #define ERR_UNKNOWN_ERROR        "error desconocido"
  #define ERR_SEARCHPATH_TRUNC     "La ruta de bsqueda ha sido truncada"
  #define ERR_GETMODFN_TRUNC       "GetModuleFileName() ha sido truncado"
  #define ERR_GETMODFN_NO_DIR      "GetModuleFileName() no tenia directorio"