From: <gnu...@li...> - 2001-06-03 10:01:28
|
GNUpdate CVS committal Author : chipx86 Module : libcomprex Path : / Log Message: Initial import into CVS Status: Vendor Tag: chipx86 Release Tags: start N libcomprex/configure.in N libcomprex/AUTHORS N libcomprex/COPYING N libcomprex/ChangeLog N libcomprex/INSTALL N libcomprex/NEWS N libcomprex/README N libcomprex/autogen.sh N libcomprex/acconfig.h N libcomprex/Makefile.am N libcomprex/.cvsignore N libcomprex/TODO N libcomprex/libcomprex.spec.in N libcomprex/comprex-config.in N libcomprex/comprex.m4.in N libcomprex/comprex.h N libcomprex/libcomprex/Makefile.am N libcomprex/libcomprex/fileio.h N libcomprex/libcomprex/module.c N libcomprex/libcomprex/fileio.c N libcomprex/libcomprex/module.h N libcomprex/libcomprex/internal.c N libcomprex/libcomprex/internal.h N libcomprex/libcomprex/comprex.h N libcomprex/libcomprex/utils.h N libcomprex/libcomprex/utils.c N libcomprex/libcomprex/.cvsignore N libcomprex/libcomprex/status.h N libcomprex/modules/Makefile.am N libcomprex/modules/.cvsignore N libcomprex/modules/file/Makefile.am N libcomprex/modules/file/.cvsignore N libcomprex/modules/file/zlib/Makefile.am N libcomprex/modules/file/zlib/zlib.c N libcomprex/modules/file/zlib/.cvsignore N libcomprex/modules/scheme/Makefile.am N libcomprex/modules/scheme/.cvsignore N libcomprex/modules/scheme/curl/Makefile.am N libcomprex/modules/scheme/curl/curl.c N libcomprex/modules/scheme/curl/.cvsignore N libcomprex/tests/Makefile.am N libcomprex/tests/test1.c N libcomprex/tests/file1.txt N libcomprex/tests/file2.txt.gz N libcomprex/tests/test2.c N libcomprex/tests/.cvsignore N libcomprex/tests/test3.c N libcomprex/libltdl/.cvsignore No conflicts created by this import |
From: <gnu...@li...> - 2001-06-03 10:15:54
|
GNUpdate CVS committal Author : chipx86 Module : libcomprex Path : / Modified Files: autogen.sh configure.in Log Message: The libltdl directory is now generated when running autogen.sh. =================================================================== RCS file: /cvsroot/gnupdate/libcomprex/autogen.sh,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -3 -r1.1.1.1 -r1.2 --- autogen.sh 2001/06/03 09:47:20 1.1.1.1 +++ autogen.sh 2001/06/03 10:00:32 1.2 @@ -1,6 +1,6 @@ #!/bin/sh # Run this to generate all the initial makefiles, etc. -# $Id: autogen.sh,v 1.1.1.1 2001/06/03 09:47:20 chipx86 Exp $ +# $Id: autogen.sh,v 1.2 2001/06/03 10:00:32 chipx86 Exp $ DIE=0 @@ -32,8 +32,8 @@ [ $DIE -eq 1 ] && exit 1; -echo " libtoolize --copy --force" -libtoolize --copy --force +echo " libtoolize --copy --force --ltdl" +libtoolize --copy --force --ltdl echo " aclocal $ACLOCAL_FLAGS" aclocal $ACLOCAL_FLAGS echo " autoheader" =================================================================== RCS file: /cvsroot/gnupdate/libcomprex/configure.in,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -3 -r1.1.1.1 -r1.2 --- configure.in 2001/06/03 09:47:11 1.1.1.1 +++ configure.in 2001/06/03 10:00:32 1.2 @@ -1,4 +1,5 @@ dnl Process this file with autoconf to create configure. +dnl $Id: configure.in,v 1.2 2001/06/03 10:00:32 chipx86 Exp $ AC_INIT(config.h.in) |
From: <gnu...@li...> - 2001-06-04 07:07:50
|
GNUpdate CVS committal Author : chipx86 Module : libcomprex Path : /docs/api/html Added Files: .cvsignore Log Message: Forgot these. |
From: <gnu...@li...> - 2001-06-04 07:07:51
|
GNUpdate CVS committal Author : chipx86 Module : libcomprex Path : /docs/api Added Files: .cvsignore Log Message: Forgot these. |
From: <gnu...@li...> - 2001-06-04 07:08:09
|
GNUpdate CVS committal Author : chipx86 Module : libcomprex Path : /docs Added Files: .cvsignore Log Message: Forgot these. |
From: <gnu...@li...> - 2001-06-04 07:31:50
|
GNUpdate CVS committal Author : chipx86 Module : libcomprex Path : /docs/api/html Log Message: Directory /cvsroot/gnupdate/libcomprex/docs/api/html added to the repository |
From: <gnu...@li...> - 2001-06-04 07:34:10
|
GNUpdate CVS committal Author : chipx86 Module : libcomprex Path : /modules/file/zlib Modified Files: zlib.c Log Message: Added some basic API documentation. =================================================================== RCS file: /cvsroot/gnupdate/libcomprex/modules/file/zlib/zlib.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -3 -r1.1.1.1 -r1.2 --- zlib.c 2001/06/03 09:47:38 1.1.1.1 +++ zlib.c 2001/06/04 06:47:32 1.2 @@ -1,7 +1,7 @@ /** * @file zlib.c Zlib module * - * $Id: zlib.c,v 1.1.1.1 2001/06/03 09:47:38 chipx86 Exp $ + * $Id: zlib.c,v 1.2 2001/06/04 06:47:32 chipx86 Exp $ * * @Copyright (C) 1999-2001 The GNUpdate Project. * @@ -39,7 +39,7 @@ char *newPath; char *temp; char *c; - char buffer[BUFSIZ]; + char buffer[BUFSIZ]; fp = gzopen(batch->storedPath, "rb"); |
From: <gnu...@li...> - 2001-06-04 07:34:10
|
GNUpdate CVS committal Author : chipx86 Module : libcomprex Path : /docs/api Added Files: Makefile.am Log Message: Added some basic API documentation. |
From: <gnu...@li...> - 2001-06-04 07:34:11
|
GNUpdate CVS committal Author : chipx86 Module : libcomprex Path : /docs Added Files: Makefile.am Log Message: Added some basic API documentation. |
From: <gnu...@li...> - 2001-06-04 07:34:11
|
GNUpdate CVS committal Author : chipx86 Module : libcomprex Path : /docs/api/html Added Files: Makefile.am annotated.html classes.html comprex_8h-source.html comprex_8h.html doxygen.css doxygen.gif fileio_8h-source.html fileio_8h.html files.html functions.html globals.html graph_legend.html index.html module_8h-source.html module_8h.html pages.html status_8h-source.html status_8h.html struct__CxFile.html struct__CxFileBatch.html struct__CxFileOps.html struct__CxModule.html struct__CxSchemeOps.html todo.html utils_8h-source.html utils_8h.html Log Message: Added some basic API documentation. |
From: <gnu...@li...> - 2001-06-04 07:42:00
|
GNUpdate CVS committal Author : chipx86 Module : libcomprex Path : /docs/api Log Message: Directory /cvsroot/gnupdate/libcomprex/docs/api added to the repository |
From: <gnu...@li...> - 2001-06-04 09:00:59
|
GNUpdate CVS committal Author : chipx86 Module : libcomprex Path : /docs Log Message: Directory /cvsroot/gnupdate/libcomprex/docs added to the repository |
From: <gnu...@li...> - 2001-06-04 09:02:06
|
GNUpdate CVS committal Author : chipx86 Module : libcomprex Path : /libcomprex Modified Files: fileio.h module.h status.h Log Message: Added some basic API documentation. =================================================================== RCS file: /cvsroot/gnupdate/libcomprex/libcomprex/fileio.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -3 -r1.1.1.1 -r1.2 --- fileio.h 2001/06/03 09:47:25 1.1.1.1 +++ fileio.h 2001/06/04 06:47:32 1.2 @@ -1,7 +1,7 @@ /** * @file fileio.h File input/output API * - * $Id: fileio.h,v 1.1.1.1 2001/06/03 09:47:25 chipx86 Exp $ + * $Id: fileio.h,v 1.2 2001/06/04 06:47:32 chipx86 Exp $ * * @Copyright (C) 1999-2001 The GNUpdate Project. * @@ -27,13 +27,20 @@ extern "C" { #endif -typedef enum _CxDepth CxDepth; -typedef struct _CxFile CxFile; -typedef struct _CxFileBatch CxFileBatch; +typedef enum _CxDepth CxDepth; /**< Decompression depth. */ +typedef struct _CxFile CxFile; /**< A single file. */ +typedef struct _CxFileBatch CxFileBatch; /**< A group of files. */ #include <libcomprex/module.h> #include <stdio.h> +/** + * @enum _CxDepth fileio.h libcomprex/fileio.h + * + * A depth of decompression. + * + * @see cxOpen() + */ enum _CxDepth { CX_DEPTH_NONE, /**< Don't recurse at all. */ @@ -41,36 +48,83 @@ CX_DEPTH_ALL /**< Decompress recursively. */ }; +/** + * @struct _CxFile fileio.h libcomprex/fileio.h + * + * A single file. + * + * @see CxFileBatch + */ struct _CxFile { + /** + * The name of the file, including the path stored in the + * archive (if any). + */ char *filename; + + /** + * The full path name where this file is located. + * + * @todo This should be renamed and split. + */ char *storedPath; + + /** + * The file pointer. + * + * This should never be manipulated directly. Use the libcomprex + * API for working with file input/output. + */ FILE *fp; - CxFileBatch *batch; + CxFileBatch *batch; /**< The owner file batch. */ - CxFile *prev; - CxFile *next; + CxFile *prev; /**< The previous file in the list. */ + CxFile *next; /**< The next file in the list. */ }; +/** + * A batch of files. + * + * Every CxFile must have one of these attached to it. Even individual + * files have CxFileBatch's attached. + * + * @see CxFile + */ struct _CxFileBatch { - unsigned int fileCount; + unsigned int fileCount; /**< The number of files in this batch. */ + /** + * The name of the archive, or if it's an individual file, the name + * of the file. + */ char *filename; + + /** + * The full path name where this archive or file is located. + * + * @todo This should be renamed and split. + */ char *storedPath; - /* + /** + * Specifies whether or not this archive should be deleted when + * closed. + * * If this is not 0, this file can be removed when the structure * is freed. + * + * Note: This should never be touched outside of libcomprex! * - * It may be a good idea to find an alternative method later, but - * this works for now. + * @todo It may be a good idea to find an alternative method + * later, but this works for now. */ char discardable; - CxFile *firstFile; - CxFile *lastFile; + CxFile *firstFile; /**< The first file in the batch. */ + CxFile *lastFile; /**< The last file in the batch. */ }; CxFile *cxOpen(const char *path, const char *mode, CxDepth depth); =================================================================== RCS file: /cvsroot/gnupdate/libcomprex/libcomprex/module.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -3 -r1.1.1.1 -r1.2 --- module.h 2001/06/03 09:47:31 1.1.1.1 +++ module.h 2001/06/04 06:47:32 1.2 @@ -1,7 +1,7 @@ /** * @file module.h Module API * - * $Id: module.h,v 1.1.1.1 2001/06/03 09:47:31 chipx86 Exp $ + * $Id: module.h,v 1.2 2001/06/04 06:47:32 chipx86 Exp $ * * @Copyright (C) 1999-2001 The GNUpdate Project. * @@ -27,66 +27,198 @@ extern "C" { #endif -typedef enum _CxModuleType CxModuleType; -typedef struct _CxModule CxModule; +typedef enum _CxModuleType CxModuleType; /**< Module types. */ +typedef struct _CxFileOps CxFileOps; /**< File operations. */ +typedef struct _CxSchemeOps CxSchemeOps; /**< URI scheme operations. */ +typedef struct _CxModule CxModule; /**< A loadable module. */ #include <ltdl.h> #include <libcomprex/status.h> #include <libcomprex/fileio.h> +/** + * A module type. + * + * These are the types of modules that libcomprex can dynamically load. + */ enum _CxModuleType { CX_MODULE_FILE, /**< File handler module. */ - CX_MODULE_SCHEME /**< URI Scheme module. */ + CX_MODULE_SCHEME /**< URI scheme module. */ }; -typedef struct +/** + * @struct _CxFileOps module.h libcomprex/module.h + * + * File operations structure. + * + * This structure is to be filled out by all modules that handle + * comression/decompression of files. + * + * @see CxModuleType + * @see CxSchemeOps + */ +struct _CxFileOps { + /** + * Compresses a file or batch of files. + * + * @param batch The file batch to compress. + * @param outFilename The new filename of the compressed archive. + * + * @return The status of the oepration. + * + * @see CxStatus + */ CxStatus (*compress)(CxFileBatch *batch, const char *outFilename); + + /** + * Decompresses an archive and returns a file batch. + * + * @param batch The file batch to fill out. + * @param outPath The directory to decompress to. + * + * @return The status of the operation. + * + * @see CxStatus + */ CxStatus (*decompress)(CxFileBatch *batch, const char *outPath); + /** + * Determines if the module supports the specified file extension. + * + * This should just give a best guess. All string comparisons should + * be case-insensitive. + * + * @param ext The extension (without the leading '.') + * + * @return 1 if the extension is supported; 0 otherwise. + */ char (*supportsExtension)(const char *ext); - -} CxFileOps; +}; -typedef struct +/** + * @struct _CxSchemeOps module.h libcomprex/module.h + * + * Scheme operations structure. + * + * This structure is to be filled out by all modules that handle + * the retrieval of files from non-local locations. + * + * @see CxModuleType + * @see CxFileOps + */ +struct _CxSchemeOps { + /** + * Retrieves a file from a non-local source. + * + * @param scheme The scheme part of the URI. + * @param path The path part of the URI. + * @param outFilename The destination filename. + * + * @return The status of the operation. + */ CxStatus (*get)(const char *scheme, const char *path, const char *outFilename); + /** + * Determines if the module supports the specified scheme. + * + * @param scheme The URI scheme to check. + * + * @return 1 if the scheme is supported; 0 otherwise. + */ char (*supports)(const char *scheme); - -} CxSchemeOps; +}; +/** + * @struct _CxModule module.h libcomprex/module.h + * + * A file or scheme module. + * + * @see CxModuleType + * @see CxFileOps + * @see CxSchemeOps + */ struct _CxModule { - CxModuleType type; + CxModuleType type; /**< The type of module. */ - char *filename; /**< The filename of this module. */ - char *name; - lt_dlhandle handle; /**< The libtool handle. */ + char *filename; /**< The filename of the module. */ + char *name; /**< The name of the module. */ + lt_dlhandle handle; /**< The libtool handle. */ - unsigned int refCount; /**< The module's reference count. */ + unsigned int refCount; /**< The module's reference count. */ union { - CxFileOps *file; /**< File operations. */ - CxSchemeOps *scheme; /**< Scheme operations. */ + CxFileOps *file; /**< File operations. */ + CxSchemeOps *scheme; /**< Scheme operations. */ - } ops; + } ops; /**< Operations. */ - CxModule *prev; - CxModule *next; + CxModule *prev; /**< The previous module in the list. */ + CxModule *next; /**< The next module in the list. */ }; +/** + * Loads the module of the specified name and type. + * + * @param name The name of the module (without ".so") + * @param type The type of module. + * + * @return A CxModule structure representing the module. + */ CxModule *cxLoadModule(const char *name, CxModuleType type); + +/** + * Unloads the specified module. + * + * @param module The module to unload. + */ void cxUnloadModule(CxModule *module); +/** + * Returns the specified module. + * + * The module + * + * @param name The name of the module. + * @param type The type of the module. + * + * @return A CxModule structure representing the module. + */ CxModule *cxGetModule(const char *name, CxModuleType type); + +/** + * Returns the first module in the list. + * + * This will probably only be useful inside libcomprex. + * + * @param type The type of module. + * + * @return The first module in the list. + */ +CxModule *cxGetFirstModule(CxModuleType type); -CxModule *cxGetFirstModule(); +/** + * Returns the next module in the list. + * + * This will probably only be good inside libcomprex. + * + * @param module The current module. + * + * @return The next module in the list. + */ CxModule *cxGetNextModule(CxModule *module); +/** + * Unloads all modules. + * + * This should only be called when you are absolutely done with + * this library. + */ void cxCleanupModules(); #ifdef __cplusplus =================================================================== RCS file: /cvsroot/gnupdate/libcomprex/libcomprex/status.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -3 -r1.1.1.1 -r1.2 --- status.h 2001/06/03 09:47:36 1.1.1.1 +++ status.h 2001/06/04 06:47:32 1.2 @@ -1,7 +1,7 @@ /** - * @file module.h Module API + * @file status.h Operation status API * - * $Id: status.h,v 1.1.1.1 2001/06/03 09:47:36 chipx86 Exp $ + * $Id: status.h,v 1.2 2001/06/04 06:47:32 chipx86 Exp $ * * @Copyright (C) 1999-2001 The GNUpdate Project. * @@ -27,14 +27,19 @@ extern "C" { #endif -typedef enum _CxStatus +typedef enum _CxStatus CxStatus; /**< A status result. */ + +/** + * A status result. + */ +enum _CxStatus { CX_SUCCESS, /**< Operation completed successfully. */ CX_INVALID_FORMAT, /**< Invalid file format. */ CX_ERROR, /**< Fatal error. */ CX_FILE_NOT_FOUND /**< File not found. */ -} CxStatus; +}; #ifdef __cplusplus } |
From: <gnu...@li...> - 2001-06-04 09:02:06
|
GNUpdate CVS committal Author : chipx86 Module : libcomprex Path : / Modified Files: ChangeLog Makefile.am configure.in Added Files: Doxyfile.in Log Message: Added some basic API documentation. =================================================================== RCS file: /cvsroot/gnupdate/libcomprex/ChangeLog,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -3 -r1.1.1.1 -r1.2 --- ChangeLog 2001/06/03 09:47:20 1.1.1.1 +++ ChangeLog 2001/06/04 06:47:31 1.2 @@ -0,0 +1,4 @@ +Sun Jun 03 23:45:29 PDT 2001 Christian Hammond <ch...@po...> + + * Added some basic API documentation. + =================================================================== RCS file: /cvsroot/gnupdate/libcomprex/Makefile.am,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -3 -r1.1.1.1 -r1.2 --- Makefile.am 2001/06/03 09:47:20 1.1.1.1 +++ Makefile.am 2001/06/04 06:47:31 1.2 @@ -1,6 +1,6 @@ -# $Id: Makefile.am,v 1.1.1.1 2001/06/03 09:47:20 chipx86 Exp $ +# $Id: Makefile.am,v 1.2 2001/06/04 06:47:31 chipx86 Exp $ -SUBDIRS = libltdl libcomprex modules tests +SUBDIRS = docs libltdl libcomprex modules tests include_HEADERS = comprex.h =================================================================== RCS file: /cvsroot/gnupdate/libcomprex/configure.in,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- configure.in 2001/06/03 10:00:32 1.2 +++ configure.in 2001/06/04 06:47:31 1.3 @@ -1,5 +1,5 @@ dnl Process this file with autoconf to create configure. -dnl $Id: configure.in,v 1.2 2001/06/03 10:00:32 chipx86 Exp $ +dnl $Id: configure.in,v 1.3 2001/06/04 06:47:31 chipx86 Exp $ AC_INIT(config.h.in) @@ -128,7 +128,11 @@ comprex-config comprex.m4 libcomprex.spec +Doxyfile Makefile +docs/Makefile +docs/api/Makefile +docs/api/html/Makefile libcomprex/Makefile modules/Makefile modules/file/Makefile |
From: <gnu...@li...> - 2001-06-04 22:58:29
|
GNUpdate CVS committal Author : chipx86 Module : libcomprex Path : / Modified Files: configure.in Log Message: Oops, typo. That's what I get for attempting to type complete sentences at 03:00 in the morning. =================================================================== RCS file: /cvsroot/gnupdate/libcomprex/configure.in,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- configure.in 2001/06/04 21:18:20 1.4 +++ configure.in 2001/06/04 21:31:31 1.5 @@ -1,5 +1,5 @@ dnl Process this file with autoconf to create configure. -dnl $Id: configure.in,v 1.4 2001/06/04 21:18:20 gjj Exp $ +dnl $Id: configure.in,v 1.5 2001/06/04 21:31:31 chipx86 Exp $ AC_INIT(config.h.in) @@ -101,7 +101,7 @@ AC_CHECK_LIB(z, gzread, , [ - AC_MSG_ERROR([You need zlib for compression. Please downlaod from http://www.gzip.org/]) + AC_MSG_ERROR([You need zlib for compression. Please download from http://www.gzip.org/]) ]) AC_CHECK_LIB(curl, curl_formparse, ac_curl_support=yes) |
From: <gnu...@li...> - 2001-06-06 01:48:49
|
GNUpdate CVS committal Author : chipx86 Module : libcomprex Path : /libcomprex Modified Files: fileio.c Log Message: Bug fixes, optimizations. =================================================================== RCS file: /cvsroot/gnupdate/libcomprex/libcomprex/fileio.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -3 -r1.1.1.1 -r1.2 --- fileio.c 2001/06/03 09:47:31 1.1.1.1 +++ fileio.c 2001/06/06 01:48:48 1.2 @@ -1,7 +1,7 @@ /** * @file fileio.c File input/output API * - * $Id: fileio.c,v 1.1.1.1 2001/06/03 09:47:31 chipx86 Exp $ + * $Id: fileio.c,v 1.2 2001/06/06 01:48:48 chipx86 Exp $ * * @Copyright (C) 1999-2001 The GNUpdate Project. * @@ -70,13 +70,14 @@ cxOpen(const char *path, const char *mode, CxDepth depth) { CxFileBatch *batch; - CxModule *schemeModule; - CxModule *fileModule; + CxModule *schemeModule = NULL; + CxModule *fileModule = NULL; CxStatus status; char *scheme, *newPath; char *outFilename, *outPath; char *baseName; - char discardable = 1; + char *ext; + char discardable; /* TODO: Remvoe this when writing is supported. */ if (strcmp(mode, "r")) @@ -110,10 +111,12 @@ if (!strcmp(scheme, "file")) { outFilename = strdup(path); - discardable = 1; + discardable = 0; } else { + discardable = 1; + /* Find the scheme module we'll use to get the file with. */ for (schemeModule = cxGetFirstModule(CX_MODULE_SCHEME); schemeModule != NULL; @@ -194,16 +197,18 @@ * Find the file module we'll use to compress/decompress the file with. * First try to auto-guess by extension. */ - for (fileModule = cxGetFirstModule(CX_MODULE_FILE); - fileModule != NULL; - fileModule = fileModule->next) - { - char *ext = strrchr(baseName, '.'); + ext = strrchr(baseName, '.'); + ext++; - ext++; - - if (fileModule->ops.file->supportsExtension(ext)) - break; + if (ext != NULL) + { + for (fileModule = cxGetFirstModule(CX_MODULE_FILE); + fileModule != NULL; + fileModule = fileModule->next) + { + if (fileModule->ops.file->supportsExtension(ext)) + break; + } } if (fileModule == NULL) |
From: <gnu...@li...> - 2001-06-06 01:49:53
|
GNUpdate CVS committal Author : chipx86 Module : libcomprex Path : /tests Added Files: decomprex.c Log Message: Added this as a more general-purpose testing tool. |
From: <gnu...@li...> - 2001-06-06 01:50:31
|
GNUpdate CVS committal Author : chipx86 Module : libcomprex Path : /tests Modified Files: Makefile.am Added Files: foo.ar Log Message: Added the foo.ar for testing. =================================================================== RCS file: /cvsroot/gnupdate/libcomprex/tests/Makefile.am,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -3 -r1.1.1.1 -r1.2 --- Makefile.am 2001/06/03 09:47:38 1.1.1.1 +++ Makefile.am 2001/06/06 01:50:30 1.2 @@ -1,6 +1,6 @@ -# $Id: Makefile.am,v 1.1.1.1 2001/06/03 09:47:38 chipx86 Exp $ +# $Id: Makefile.am,v 1.2 2001/06/06 01:50:30 chipx86 Exp $ -noinst_PROGRAMS = test1 test2 test3 +noinst_PROGRAMS = test1 test2 test3 decomprex test1_SOURCES = test1.c test1_LDADD = \ @@ -14,9 +14,14 @@ test3_LDADD = \ $(top_builddir)/libcomprex/libcomprex.la +decomprex_SOURCES = decomprex.c +decomprex_LDADD = \ + $(top_builddir)/libcomprex/libcomprex.la + EXTRA_DIST = \ - file1.txt - file2.txt.gz + file1.txt \ + file2.txt.gz \ + foo.ar INCLUDES = \ -I$(top_srcdir) \ |
From: <gnu...@li...> - 2001-06-06 01:50:48
|
GNUpdate CVS committal Author : chipx86 Module : libcomprex Path : /tests Modified Files: .cvsignore Log Message: CVS! Ssshhhhh :) =================================================================== RCS file: /cvsroot/gnupdate/libcomprex/tests/.cvsignore,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -3 -r1.1.1.1 -r1.2 --- .cvsignore 2001/06/03 09:47:39 1.1.1.1 +++ .cvsignore 2001/06/06 01:50:47 1.2 @@ -6,6 +6,7 @@ test1 test2 test3 +decomprex .libs .deps .*.swp |
From: <gnu...@li...> - 2001-06-06 01:51:09
|
GNUpdate CVS committal Author : chipx86 Module : libcomprex Path : / Modified Files: ChangeLog Log Message: Updated ChangeLog. =================================================================== RCS file: /cvsroot/gnupdate/libcomprex/ChangeLog,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- ChangeLog 2001/06/05 22:17:26 1.4 +++ ChangeLog 2001/06/06 01:51:08 1.5 @@ -1,3 +1,9 @@ +Tue Jun 05 18:44:41 PDT 2001 Christian Hammond <ch...@po...> + + * libcomprex/fileio.c: Bug fixes and optimizations. + * tests/decomprex.c: Add this as a more general-purpose testing tool. + * tests/foo.ar: Added this to test the new ar module. + Wed Jun 06 00:16:26 CEST 2001 Gerry Jo Jellestad <ge...@c6...> * Fixed some stuff in the AR module: |
From: <gnu...@li...> - 2001-06-06 09:28:00
|
GNUpdate CVS committal Author : chipx86 Module : libcomprex Path : /modules/file/zlib Modified Files: zlib.c Log Message: This is no longer "greedy." It doesn't attempt to open every time of file now, only gzipped files. This bug prevented other modules from even trying. =================================================================== RCS file: /cvsroot/gnupdate/libcomprex/modules/file/zlib/zlib.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- zlib.c 2001/06/04 06:47:32 1.2 +++ zlib.c 2001/06/06 09:28:00 1.3 @@ -1,7 +1,7 @@ /** * @file zlib.c Zlib module * - * $Id: zlib.c,v 1.2 2001/06/04 06:47:32 chipx86 Exp $ + * $Id: zlib.c,v 1.3 2001/06/06 09:28:00 chipx86 Exp $ * * @Copyright (C) 1999-2001 The GNUpdate Project. * @@ -24,6 +24,65 @@ #include <comprex.h> #include <zlib.h> +/* A copy of the gz_stream struct in zlib. */ +typedef struct +{ + z_stream stream; + int z_err; /* error code for last stream operation */ + int z_eof; /* set if end of input file */ + FILE *file; /* .gz file */ + Byte *inbuf; /* input buffer */ + Byte *outbuf; /* output buffer */ + uLong crc; /* crc32 of uncompressed data */ + char *msg; /* error message */ + char *path; /* path name for debugging only */ + int transparent; /* 1 if input file is not a .gz file */ + char mode; /* 'w' or 'r' */ + long startpos; /* start of compressed data in file */ + /* (header skipped) */ +} _gz_stream; + +#if 0 +static gzFile +__gzOpen(const char *path, const char *mode) +{ + gz_stream *s; + char *p = (char *)mode; + char *m = fmode; + char fmode[80]; /* copy of mode, without the compression level */ + int err; + int level = Z_DEFAULT_COMPRESSION; + + if (path == NULL || mode == NULL) + return Z_NULL; + + s = (gz_stream *)malloc(sizeof(gz_stream)); + if (s == NULL) + return Z_NULL; + + s->stream.zalloc = NULL; + s->stream.zfree = NULL; + s->stream.opaque = NULL; + s->stream.next_in = s->inbuf = Z_NULL; + s->stream.next_out = s->outbuf = Z_NULL; + s->stream.avail_in = s->stream.avail_out = 0; + + s->file = NULL; + s->z_err = Z_OK; + s->z_eof = 0; + s->crc = crc32(0L, Z_NULL, 0); + s->msg = NULL; + + s->transparent = 0; + + s->path = (char *)malloc((strlen(path) + 1) * sizeof(char)); + if (s->path == NULL) + { + return __gzDestroy(s) + } +} +#endif /* 0 */ + static CxStatus fileCompress(CxFileBatch *batch, const char *outFilename) { @@ -42,9 +101,17 @@ char buffer[BUFSIZ]; fp = gzopen(batch->storedPath, "rb"); - + if (fp == NULL) return CX_FILE_NOT_FOUND; + + if (((_gz_stream *)fp)->transparent == 1) + { + /* It's not a .gz! Clean up so other modules can try... */ + gzclose(fp); + + return CX_INVALID_FORMAT; + } file = newCxFile(batch); |
From: <gnu...@li...> - 2001-06-06 09:28:23
|
GNUpdate CVS committal Author : chipx86 Module : libcomprex Path : /tests Modified Files: decomprex.c Log Message: Fixed this so it now requests that the module tries to decompress the specified file. =================================================================== RCS file: /cvsroot/gnupdate/libcomprex/tests/decomprex.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- decomprex.c 2001/06/06 01:49:52 1.1 +++ decomprex.c 2001/06/06 09:28:22 1.2 @@ -1,7 +1,7 @@ /** * @file decomprex.c Decomprex an archive. * - * $Id: decomprex.c,v 1.1 2001/06/06 01:49:52 chipx86 Exp $ + * $Id: decomprex.c,v 1.2 2001/06/06 09:28:22 chipx86 Exp $ * * @Copyright (C) 1999-2001 The GNUpdate Project. * @@ -35,7 +35,7 @@ exit(1); } - file = cxOpen(argv[1], "r", CX_DEPTH_NONE); + file = cxOpen(argv[1], "r", CX_DEPTH_SINGLE); if (file == NULL) { |
From: <gnu...@li...> - 2001-06-06 09:28:54
|
GNUpdate CVS committal Author : chipx86 Module : libcomprex Path : /libcomprex Modified Files: module.c Log Message: Fixed a nasty bug in the __trimModuleList() function. =================================================================== RCS file: /cvsroot/gnupdate/libcomprex/libcomprex/module.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -3 -r1.1.1.1 -r1.2 --- module.c 2001/06/03 09:47:28 1.1.1.1 +++ module.c 2001/06/06 09:28:53 1.2 @@ -1,7 +1,7 @@ /** * @file module.h Module API * - * $Id: module.c,v 1.1.1.1 2001/06/03 09:47:28 chipx86 Exp $ + * $Id: module.c,v 1.2 2001/06/06 09:28:53 chipx86 Exp $ * * @Copyright (C) 1999-2001 The GNUpdate Project. * @@ -233,7 +233,7 @@ for (j = 0; j < size; j++) { - if (!strcmp(list[j], list[i])) + if (!strcmp(ret[j], list[i])) { found = 1; break; @@ -368,7 +368,7 @@ return NULL; module->filename = strdup(name); - module->name = strdup(name); + module->name = cxGetBaseName(name); module->type = type; if (type == CX_MODULE_FILE) @@ -429,15 +429,11 @@ lastSchemeModule = NULL; } - free(module->filename); - free(module->name); - -/* - if (module->type == CX_MODULE_FILE) - free(module->ops.file); - else - free(module->ops.scheme); -*/ + if (module->filename != NULL) + free(module->filename); + + if (module->name != NULL) + free(module->name); free(module); } |
From: <gnu...@li...> - 2001-06-06 09:29:26
|
GNUpdate CVS committal Author : chipx86 Module : libcomprex Path : /libcomprex Modified Files: fileio.c Log Message: If some of the module checks don't work, this will now open the file normally. =================================================================== RCS file: /cvsroot/gnupdate/libcomprex/libcomprex/fileio.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- fileio.c 2001/06/06 01:48:48 1.2 +++ fileio.c 2001/06/06 09:29:26 1.3 @@ -1,7 +1,7 @@ /** * @file fileio.c File input/output API * - * $Id: fileio.c,v 1.2 2001/06/06 01:48:48 chipx86 Exp $ + * $Id: fileio.c,v 1.3 2001/06/06 09:29:26 chipx86 Exp $ * * @Copyright (C) 1999-2001 The GNUpdate Project. * @@ -189,6 +189,15 @@ file = newCxFile(batch); file->filename = strdup(baseName); file->storedPath = strdup(outFilename); + + free(baseName); + + if (outFilename != NULL) + free(outFilename); + + free(outPath); + free(scheme); + free(newPath); return file; } @@ -230,15 +239,14 @@ if (fileModule == NULL) { - /* Nothing works. Give up. */ - freeCxFileBatch(batch); - free(scheme); - free(newPath); - free(outFilename); - free(outPath); - free(baseName); + /* That didn't work. Just open the file normally. */ + CxFile *file; - return NULL; + file = newCxFile(batch); + file->filename = strdup(baseName); + file->storedPath = strdup(outFilename); + + return file; } } else @@ -271,15 +279,20 @@ if (fileModule == NULL) { - /* Nothing works. Give up. */ - freeCxFileBatch(batch); + /* That didn't work. Just open the file normally. */ + CxFile *file; + + file = newCxFile(batch); + file->filename = strdup(baseName); + file->storedPath = strdup(outFilename); + free(scheme); free(newPath); free(outFilename); free(outPath); free(baseName); - return NULL; + return file; } } } @@ -342,7 +355,7 @@ cxClose(file); /* Maybe this shouldn't be here? */ - remove(file->storedPath); + /* remove(file->storedPath); */ freeCxFile(file); } @@ -350,7 +363,7 @@ /* Maybe this shouldn't be here too? */ if (batch->discardable != 0) { - remove(batch->storedPath); + /* remove(batch->storedPath); */ } path = (char *)malloc((strlen(batch->filename) + 14) * sizeof(char)); |
From: <gnu...@li...> - 2001-06-06 09:29:42
|
GNUpdate CVS committal Author : chipx86 Module : libcomprex Path : / Modified Files: ChangeLog Log Message: Updated ChangeLog. =================================================================== RCS file: /cvsroot/gnupdate/libcomprex/ChangeLog,v retrieving revision 1.5 retrieving revision 1.6 diff -u -3 -r1.5 -r1.6 --- ChangeLog 2001/06/06 01:51:08 1.5 +++ ChangeLog 2001/06/06 09:29:42 1.6 @@ -1,3 +1,15 @@ +Wed Jun 06 02:24:36 PDT 2001 Christian Hammond <ch...@po...> + + * libcomprex/fileio.c: If some of the module checks don't work, this + will now open the file normally. + * libcomprex/module.c: Fixed a nasty bug in the __trimModuleList() + function. + * modules/file/zlib/zlib.c: This is no longer "greedy." It doesn't + attempt to open every time of file now, only gzipped files. This + bug prevented other modules from even trying. + * tests/decomprex.c: Fixed this so it now requests that the module + tries to decompress the specified file. + Tue Jun 05 18:44:41 PDT 2001 Christian Hammond <ch...@po...> * libcomprex/fileio.c: Bug fixes and optimizations. |