luazip-1.2.3/0000755000175000017500000000000010635554541013153 5ustar carregalcarregalluazip-1.2.3/doc/0000755000175000017500000000000010635554540013717 5ustar carregalcarregalluazip-1.2.3/doc/us/0000755000175000017500000000000010635554540014346 5ustar carregalcarregalluazip-1.2.3/doc/us/examples.html0000644000175000017500000000652210635551451017055 0ustar carregalcarregal LuaZip: Reading files inside zip files
LuaZip
Reading files inside zip files

Example

Suppose we have the following file hierarchy:

/a
    /b
        c.zip
/a2
    b2.ext2
/a3.ext3
/luazip.zip
  • c.zip contains the file 'd.txt'
  • b2.ext2 is a zip file containing the file 'c2/d2.txt'
  • a3.ext3 is a zip file containing the file 'b3/c3/d3.txt'
  • luazip.zip contains the files 'luazip.h', 'luazip.c', 'Makefile', 'README'
Below is a small sample code displaying the basic use of the library.
require "zip"

local zfile, err = zip.open('luazip.zip')

-- print the filenames of the files inside the zip
for file in zfile:files() do
	print(file.filename)
end

-- open README and print it
local f1, err = zfile:open('README')
local s1 = f1:read("*a")
print(s1)

f1:close()
zfile:close()

-- open d.txt inside c.zip
local d, err = zip.openfile('a/b/c/d.txt')
assert(d, err)
d:close()

-- open d2.txt inside b2.ext2
local d2, err = zip.openfile('a2/b2/c2/d2.txt', "ext2")
assert(d2, err)
d2:close()

-- open d3.txt inside a3.ext3
local d3, err = zip.openfile('a3/b3/c3/d3.txt', {"ext2", "ext3"})
assert(d3, err)
d3:close()

Valid XHTML 1.0!

$Id: examples.html,v 1.5 2007/06/18 18:47:05 carregal Exp $

luazip-1.2.3/doc/us/index.html0000644000175000017500000001004710635551451016343 0ustar carregalcarregal LuaZip: Reading files inside zip files
LuaZip
Reading files inside zip files

Overview

LuaZip is a lightweight Lua extension library used to read files stored inside zip files. The API is very similar to the standard Lua I/O library API.

LuaZip is free software and uses the same license as Lua 5.1.

Status

Current version is 1.2.3. It was developed for Lua 5.0 and 5.1.

Download

LuaZip source can be downloaded from its Lua Forge page. If you are using LuaBinaries a Windows binary version of LuaZip can be found at the same LuaForge page.

History

Version 1.2.3 [18/Jun/2007]
Adapted to work on both Lua 5.0 and Lua 5.1.
Version 1.2.2 [24/Mar/2006]
Minor fixes on makefile and config
Version 1.2.1 [08/Jun/2005]
Minor bug fixes
Version 1.2.0 [01/Dec/2004]
Version 1.1.3 [25/Jun/2004]
First Public Release

Credits

LuaZip was designed and coded by Danilo Tuler as part of the Kepler Project.

Contact

For more information please contact us. Comments are welcome!

You can also reach other Kepler developers and users on the Kepler Project mailing list.

Valid XHTML 1.0!

$Id: index.html,v 1.10 2007/06/18 18:47:05 carregal Exp $

luazip-1.2.3/doc/us/license.html0000644000175000017500000001040510635551451016654 0ustar carregalcarregal LuaZip: Reading files inside zip files
LuaZip
Reading files inside zip files

License

LuaZip is free software: it can be used for both academic and commercial purposes at absolutely no cost. There are no royalties or GNU-like "copyleft" restrictions. LuaZip qualifies as Open Source software. Its licenses are compatible with GPL. LuaZip is not in the public domain and the Kepler Project keep its copyright. The legal details are below.

The spirit of the license is that you are free to use LuaZip for any purpose at no cost without having to ask us. The only requirement is that if you do use LuaZip, then you should give us credit by including the appropriate copyright notice somewhere in your product or its documentation.

The LuaZip library was designed and implemented by Danilo Tuler. Part of the code is a derived work from the Lua standard I/O library, copyrighted by Tecgraf, PUC-Rio.


Copyright © 2003-2007 The Kepler Project.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Valid XHTML 1.0!

$Id: license.html,v 1.6 2007/06/18 18:47:05 carregal Exp $

luazip-1.2.3/doc/us/luazip-128.png0000644000175000017500000002562410153405651016672 0ustar carregalcarregalPNG  IHDRL\+IDATx=itTEַ%!,$" A@@69 Ȩ8̨3ߙ|)Ȩ *,"- ;;~T,$ԫWu[w[s?A:~"@O` ?APG%An\ ZO ⯜sƘ;BH`[G xBsm9g1ДZ;#` @HTG\iݽ{wii)缱`fffu9222,,h4{ pQOFRWgGud eqx dh?dm_TU)((~ &M4` w ;w,vf,=3g-ڻBKр19$\Wg[8Q\RR(F9..tN<9` 2c_ p6Oh/9;;_WXXX.]v:lذ]­Z6L$ݻo޼9lذDҰv8TTT$8` 72OO!|v w[C]v-::zر]t֏O|3 $̫5-BYYY>}̚5l6;Q@,&n+*yd۞=2`l5߁1;S^=E ^A[eW^ҥKXXUVarrr/^ܭ[7A4< )g$kZ999W\9sCI+q1FEEsCB(n8cPUKFF;~f6jGmF ]|ybb?,}|Iҏ>^84-\wv$$$hH^_ѣW%)DUU:o@Lv!}0c\SR֋qYYYyy9g?{ETVVv~ȑ#IG o+]`S[Ibaq'ӧWXqJM =z, #wGQTI ݼ9w0FBCu@QqAAUoݺuشiSEEL(7nԶ^YGZJƏJ`4@'YDDĬYlْ>a„O 1 ~>ӻwҥ{` *4accË-#t_jm1 OϟSJcAUŮ|_UvB1fBR2SJ!f͗.,Y95uպuٜ!XUPMgZd S|?@1?;B֭{'+|DzÇIu<{[cι{N3&Qf@`* ZYWGm1fL+_6q=~v{bb;߬Zubv#0Gaa&UeZ8W orhsq(mؼ9sR)e½orxLGl*e>B8Gz2`RkϞ]ׯ5jTw_s7mr\8BB}z~}pYZBGܵp\ytҝ2BY)!~{~5BΞ髯NJRN C޺?Uz~Kw~4}P~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ˣBsc8p={q4fvIi N{ll!m5#(؄*++Eo~!,:յk d8//)m0{NŢkTn8=\>}|+Z#G'|l4EG*#>xh„$AͶr'N@`ɲAڋ#so/IXUw)mCh$!Jo9婧Ϟ=l/5[tq<pK#_} VIB ȁ}UW_-l.[n~~w}7{l-)]mvfysQ!DRUߏw, 8BP?qo[^}۶m HKK. -AC|Fq=N$GpG+clܸq;v+N(٣GO-[v? c6Bǚg|LK4`{m kS9oLN\rkʕ+FO?o5oԕ+ơ"Cԇuz1/0\D|&:faÆK.⋝;wnoxj\hXZZG֮=j0N3u99{ppآEC-/ `_uƍΝ{bcc=rЃsrrf͚Nw_X -kf[]Tt "3ձ$Z "} pa3 s^<5QO>]_fMZZ#<Ș4vcjե>WhŇ]Sry魟a- FIIիccc,XNHQeϞݻ23oT[DR|t쌝1Gz]G6yrҤII覨2ڛ)0իWNOOW^ .ly [fE)gzC @LlMNGQڵkӦMkq6S^s̺u߾})))_HכOpfj݊ub4:w.jt^^ޡCxgm<·RN:u-n+[!UUBCC}j!^'v۷ϟ?[n mP-^dl6٬_mC ZİaRRRz. I:$wUTT|K, Phax܁ݥmb1CjFѨ "˲sm~̋/.^%lz<ޚISC^-F\t);;w9n x͖?qDJJJ׮]4A۷o?|phhh= Էo_q9H ^}zM>nzӧ9,Ϙ1Pjhh˲˪ZUUU[[[]]]PPp]w9RiJJJ޽{-D>Yr LuaZip: Reading files inside zip files
LuaZip
Reading files inside zip files

Introduction

LuaZip is a lightweight Lua extension library that can be used to read files stored inside zip files. It uses zziplib to do all the hard work.

The API exposed to Lua is very simple and very similiar to the usual file handling functions provided by the I/O Lua standard library. In fact, the API is so similar that parts of this manual are extracted from the Lua manual, copyrighted by Tecgraf, PUC-Rio.

Building

LuaZip could be built to Lua 5.0 or to Lua 5.1. In both cases, the language library and headers files for the target version must be installed properly.

LuaZip offers a Makefile and a separate configuration file, config, which should be edited to suit your installation before runnig make. The file has some definitions like paths to the external libraries, compiler options and the like. One important definition is the version of Lua language, which is not obtained from the installed software.

LuaZip compilation depends on zziplib 0.13.49 and zlib 1.2.3.

Installation

The LuaZip compiled binary should be copied to a directory in your C path. Lua 5.0 users should also install Compat-5.1.

Reference

zip.open (filename)
This function opens a zip file and returns a new zip file handle. In case of error it returns nil and an error message. Unlike io.open, there is no mode parameter, as the only supported mode is "read".
zip.openfile (filename [, extensions]])
This function opens a file and returns a file handle. In case of error it returns nil and an error message. Unlike io.open, there is no mode parameter, as the only supported mode is "read".
This function implements a virtual file system based on optionally compressed files. Instead of simply looking for a file at a given path, this function goes recursively up through all path separators ("/") looking for zip files there. If it finds a zip file, this function use the remaining path to open the requested file.
The optional parameter extensions allows the use of file extensions other than .zip during the lookup. It can be a string corresponding to the extension or an indexed table with the lookup extensions sequence.
zfile:close ()
This function closes a zfile opened by zip.open
zfile:files ()
Returns an iterator function that returns a new table containing the following information each time it is called:
  • filename: the full path of a file
  • compressed_size: the compressed size of the file in bytes
  • uncompressed_size: the uncompressed size of the file in bytes
zfile:open (filename)
This function opens a file that is stored inside the zip file opened by zip.open.
The filename may contain the full path of the file contained inside the zip. The directory separator must be '/'.
Unlike f:open, there is no mode parameter, as the only supported mode is "read".
file:read (format1, ...)
Reads a file according to the given formats, which specify what to read.
For each format, the function returns a string with the characters read, or nil if it cannot read data with the specified format. When called without formats, it uses a default format that reads the entire next line (see below).
The available formats are:
  • "*a": reads the whole file, starting at the current position. On end of file, it returns the empty string.
  • "*l": reads the next line (skipping the end of line), returns nil on end of file. This is the default format.
  • number: reads a string with up to that number of characters, returning nil on end of file.

Unlike the standard I/O read, the format "*n" is not supported.
file:seek ([whence] [, offset])
Sets and gets the file position, measured from the beginning of the file, to the position given by offset plus a base specified by the string whence, as follows:
  • set: base is position 0 (beginning of the file);
  • cur: base is current position;
  • end: base is end of file;
In case of success, function seek returns the final file position, measured in bytes from the beginning of the file. If this function fails, it returns nil, plus an error string. The default value for whence is "cur", and for offset is 0. Therefore, the call file:seek() returns the current file position, without changing it; the call file:seek("set") sets the position to the beginning of the file (and returns 0); and the call file:seek("end") sets the position to the end of the file, and returns its size.
file:close ()
This function closes a file opened by zfile:open.
file:lines ()
Returns an iterator function that returns a new line from the file each time it is called. Therefore, the construction
for line in file:lines() do ... end
will iterate over all lines of the file.

Valid XHTML 1.0!

$Id: manual.html,v 1.12 2007/06/18 18:47:05 carregal Exp $

luazip-1.2.3/src/0000755000175000017500000000000010635554541013742 5ustar carregalcarregalluazip-1.2.3/src/luazip.c0000644000175000017500000003304110635551451015410 0ustar carregalcarregal/* LuaZip - Reading files inside zip files. http://www.keplerproject.org/luazip/ Author: Danilo Tuler Copyright (c) 2003-2007 Kepler Project $Id: luazip.c,v 1.11 2007/06/18 18:47:05 carregal Exp $ */ #include #include #include "zzip/zzip.h" #include "luazip.h" #include "lauxlib.h" #if ! defined (LUA_VERSION_NUM) || LUA_VERSION_NUM < 501 #include "compat-5.1.h" #endif #define ZIPFILEHANDLE "lzipFile" #define ZIPINTERNALFILEHANDLE "lzipInternalFile" #define LUAZIP_MAX_EXTENSIONS 32 static int pushresult (lua_State *L, int i, const char *filename) { if (i) { lua_pushboolean(L, 1); return 1; } else { lua_pushnil(L); if (filename) lua_pushfstring(L, "%s: %s", filename, zzip_strerror(zzip_errno(errno))); else lua_pushfstring(L, "%s", zzip_strerror(zzip_errno(errno))); lua_pushnumber(L, zzip_errno(errno)); return 3; } } static ZZIP_DIR** topfile (lua_State *L, int findex) { ZZIP_DIR** f = (ZZIP_DIR**)luaL_checkudata(L, findex, ZIPFILEHANDLE); if (f == NULL) luaL_argerror(L, findex, "bad zip file"); return f; } static ZZIP_DIR* tofile (lua_State *L, int findex) { ZZIP_DIR** f = topfile(L, findex); if (*f == NULL) luaL_error(L, "attempt to use a closed zip file"); return *f; } static ZZIP_FILE** topinternalfile (lua_State *L, int findex) { ZZIP_FILE** f = (ZZIP_FILE**)luaL_checkudata(L, findex, ZIPINTERNALFILEHANDLE); if (f == NULL) luaL_argerror(L, findex, "bad zip file"); return f; } static ZZIP_FILE* tointernalfile (lua_State *L, int findex) { ZZIP_FILE** f = topinternalfile(L, findex); if (*f == NULL) luaL_error(L, "attempt to use a closed zip file"); return *f; } /* ** When creating file handles, always creates a `closed' file handle ** before opening the actual file; so, if there is a memory error, the ** file is not left opened. */ static ZZIP_DIR** newfile (lua_State *L) { ZZIP_DIR** pf = (ZZIP_DIR**)lua_newuserdata(L, sizeof(ZZIP_DIR*)); *pf = NULL; /* file handle is currently `closed' */ luaL_getmetatable(L, ZIPFILEHANDLE); lua_setmetatable(L, -2); return pf; } static ZZIP_FILE** newinternalfile (lua_State *L) { ZZIP_FILE** pf = (ZZIP_FILE**)lua_newuserdata(L, sizeof(ZZIP_FILE*)); *pf = NULL; /* file handle is currently `closed' */ luaL_getmetatable(L, ZIPINTERNALFILEHANDLE); lua_setmetatable(L, -2); return pf; } static int zip_open (lua_State *L) { const char *zipfilename = luaL_checkstring(L, 1); /*const char *mode = luaL_optstring(L, 2, "r");*/ ZZIP_DIR** pf = newfile(L); *pf = zzip_dir_open(zipfilename, 0); if (*pf == NULL) { lua_pushnil(L); lua_pushfstring(L, "could not open file `%s'", zipfilename); return 2; } return 1; } static int zip_close (lua_State *L) { ZZIP_DIR* f = tofile(L, 1); if (zzip_dir_close(f) == 0) { *(ZZIP_DIR**)lua_touserdata(L, 1) = NULL; /* mark file as close */ lua_pushboolean(L, 1); } else lua_pushboolean(L, 0); return 1; } static int f_open (lua_State *L) { ZZIP_DIR* uf = tofile(L, 1); const char *filename = luaL_checkstring(L, 2); /*const char *mode = luaL_optstring(L, 3, "r");*/ ZZIP_FILE** inf = newinternalfile(L); *inf = zzip_file_open(uf, filename, 0); if (*inf) return 1; lua_pushnil(L); lua_pushfstring(L, "could not open file `%s'", filename); return 2; } /* */ static int zip_openfile (lua_State *L) { ZZIP_FILE** inf; const char * ext2[LUAZIP_MAX_EXTENSIONS+1]; zzip_strings_t *ext = ext2; const char *filename = luaL_checkstring(L, 1); /*const char *mode = luaL_optstring(L, 2, "r");*/ inf = newinternalfile(L); if (lua_isstring(L, 2)) { /* creates a table with the string as the first and only (numerical) element */ lua_newtable(L); lua_pushvalue(L, 2); lua_rawseti(L, -2, 1); /* replaces the string by the table with the string inside */ lua_replace(L, 2); } if (lua_istable(L, 2)) { int i, m, n; /* how many extension were specified? */ n = luaL_getn(L, 2); if (n > LUAZIP_MAX_EXTENSIONS) { luaL_error(L, "too many extensions specified"); } for (i = 0, m = 0; i < n; i++) { lua_rawgeti(L, 2, i+1); if (lua_isstring(L, -1)) { /* luazip specifies "zip" as the extension, but zziplib expects ".zip" */ lua_pushstring(L, "."); lua_insert(L, -2); lua_concat(L, 2); ext2[m] = lua_tostring(L, -1); m++; } lua_pop(L, 1); } ext2[m] = 0; *inf = zzip_open_ext_io(filename, 0, 0664, ext, 0); } else { *inf = zzip_open(filename, 0); } if (*inf) return 1; lua_pushnil(L); lua_pushfstring(L, "could not open file `%s'", filename); return 2; } static int zip_type (lua_State *L) { ZZIP_DIR** f = (ZZIP_DIR**)luaL_checkudata(L, 1, ZIPFILEHANDLE); if (f == NULL) lua_pushnil(L); else if (*f == NULL) lua_pushliteral(L, "closed zip file"); else lua_pushliteral(L, "zip file"); return 1; } static int zip_tostring (lua_State *L) { char buff[32]; ZZIP_DIR** f = topfile(L, 1); if (*f == NULL) strcpy(buff, "closed"); else sprintf(buff, "%p", lua_touserdata(L, 1)); lua_pushfstring(L, "zip file (%s)", buff); return 1; } static int ff_tostring (lua_State *L) { char buff[32]; ZZIP_FILE** f = topinternalfile(L, 1); if (*f == NULL) strcpy(buff, "closed"); else sprintf(buff, "%p", lua_touserdata(L, 1)); lua_pushfstring(L, "file in zip file (%s)", buff); return 1; } static int zip_gc (lua_State *L) { ZZIP_DIR**f = topfile(L, 1); if (*f != NULL) /* ignore closed files */ zip_close(L); return 0; } static int zip_readfile (lua_State *L) { ZZIP_DIRENT* ent = NULL; ZZIP_DIR* uf = NULL; uf = *(ZZIP_DIR**)lua_touserdata(L, lua_upvalueindex(1)); if (uf == NULL) /* file is already closed? */ luaL_error(L, "file is already closed"); ent = zzip_readdir(uf); if (ent == NULL) return 0; lua_newtable(L); lua_pushstring(L, "compressed_size"); lua_pushnumber(L, ent->d_csize); lua_settable(L, -3); lua_pushstring(L, "compression_method"); lua_pushnumber(L, ent->d_compr); lua_settable(L, -3); lua_pushstring(L, "uncompressed_size"); lua_pushnumber(L, ent->st_size); lua_settable(L, -3); lua_pushstring(L, "filename"); lua_pushstring(L, ent->d_name); lua_settable(L, -3); return 1; } static int f_files (lua_State *L) { ZZIP_DIR *f = tofile(L, 1); zzip_rewinddir(f); lua_pushliteral(L, ZIPFILEHANDLE); lua_rawget(L, LUA_REGISTRYINDEX); lua_pushcclosure(L, zip_readfile, 2); return 1; } static int aux_close (lua_State *L) { ZZIP_FILE *f = tointernalfile(L, 1); int ok = (zzip_fclose(f) == 0); if (ok) *(ZZIP_FILE **)lua_touserdata(L, 1) = NULL; /* mark file as closed */ return ok; } static int ff_close (lua_State *L) { return pushresult(L, aux_close(L), NULL); } static int ff_gc (lua_State *L) { ZZIP_FILE**f = topinternalfile(L, 1); if (*f != NULL) /* ignore closed files */ aux_close(L); return 0; } static int zzip_getc (ZZIP_FILE *f) { char c; return (zzip_fread(&c, sizeof(char), 1, f) == 0) ? EOF : (int)c; } static char* zzip_fgets(char *str, int size, ZZIP_FILE *stream) { int c, i; for (i = 0; i < size-1; i++) { c = zzip_getc(stream); if (EOF == c) return NULL; str[i]=c; if (('\n' == c)/* || ('\r' == c)*/) { str[i++]='\n'; break; } } str[i] = '\0'; return str; } /* no support to read numbers static int zzip_fscanf (ZZIP_FILE *f, const char *format, ...) { // TODO return 0; } static int read_number (lua_State *L, ZZIP_FILE *f) { lua_Number d; if (zzip_fscanf(f, LUA_NUMBER_SCAN, &d) == 1) { lua_pushnumber(L, d); return 1; } else return 0; // read fails } */ static int test_eof (lua_State *L, ZZIP_FILE *f) { /* TODO */ (void) L; (void) f; return 1; } static int read_line (lua_State *L, ZZIP_FILE *f) { luaL_Buffer b; luaL_buffinit(L, &b); for (;;) { size_t l; char *p = luaL_prepbuffer(&b); if (zzip_fgets(p, LUAL_BUFFERSIZE, f) == NULL) { /* eof? */ luaL_pushresult(&b); /* close buffer */ return (lua_strlen(L, -1) > 0); /* check whether read something */ } l = strlen(p); if (p[l-1] != '\n') luaL_addsize(&b, l); else { luaL_addsize(&b, l - 1); /* do not include `eol' */ luaL_pushresult(&b); /* close buffer */ return 1; /* read at least an `eol' */ } } } static int read_chars (lua_State *L, ZZIP_FILE *f, size_t n) { size_t rlen; /* how much to read */ size_t nr; /* number of chars actually read */ luaL_Buffer b; luaL_buffinit(L, &b); rlen = LUAL_BUFFERSIZE; /* try to read that much each time */ do { char *p = luaL_prepbuffer(&b); if (rlen > n) rlen = n; /* cannot read more than asked */ nr = zzip_fread(p, sizeof(char), rlen, f); luaL_addsize(&b, nr); n -= nr; /* still have to read `n' chars */ } while (n > 0 && nr == rlen); /* until end of count or eof */ luaL_pushresult(&b); /* close buffer */ return (n == 0 || lua_strlen(L, -1) > 0); } static int g_read (lua_State *L, ZZIP_FILE *f, int first) { int nargs = lua_gettop(L) - 1; int success; int n; if (nargs == 0) { /* no arguments? */ success = read_line(L, f); n = first+1; /* to return 1 result */ } else { /* ensure stack space for all results and for auxlib's buffer */ luaL_checkstack(L, nargs+LUA_MINSTACK, "too many arguments"); success = 1; for (n = first; nargs-- && success; n++) { if (lua_type(L, n) == LUA_TNUMBER) { size_t l = (size_t)lua_tonumber(L, n); success = (l == 0) ? test_eof(L, f) : read_chars(L, f, l); } else { const char *p = lua_tostring(L, n); luaL_argcheck(L, p && p[0] == '*', n, "invalid option"); switch (p[1]) { case 'l': /* line */ success = read_line(L, f); break; case 'a': /* file */ read_chars(L, f, ~((size_t)0)); /* read MAX_SIZE_T chars */ success = 1; /* always success */ break; default: return luaL_argerror(L, n, "invalid format"); } } } } if (!success) { lua_pop(L, 1); /* remove last result */ lua_pushnil(L); /* push nil instead */ } return n - first; } static int ff_read (lua_State *L) { return g_read(L, tointernalfile(L, 1), 2); } static int zip_readline (lua_State *L); static void aux_lines (lua_State *L, int idx, int close) { lua_pushliteral(L, ZIPINTERNALFILEHANDLE); lua_rawget(L, LUA_REGISTRYINDEX); lua_pushvalue(L, idx); lua_pushboolean(L, close); /* close/not close file when finished */ lua_pushcclosure(L, zip_readline, 3); } static int ff_lines (lua_State *L) { tointernalfile(L, 1); /* check that it's a valid file handle */ aux_lines(L, 1, 0); return 1; } static int zip_readline (lua_State *L) { ZZIP_FILE *f = *(ZZIP_FILE **)lua_touserdata(L, lua_upvalueindex(2)); if (f == NULL) /* file is already closed? */ luaL_error(L, "file is already closed"); if (read_line(L, f)) return 1; else { /* EOF */ if (lua_toboolean(L, lua_upvalueindex(3))) { /* generator created file? */ lua_settop(L, 0); lua_pushvalue(L, lua_upvalueindex(2)); aux_close(L); /* close it */ } return 0; } } static int ff_seek (lua_State *L) { static const int mode[] = {SEEK_SET, SEEK_CUR, SEEK_END}; static const char *const modenames[] = {"set", "cur", "end", NULL}; ZZIP_FILE *f = tointernalfile(L, 1); long offset = luaL_optlong(L, 3, 0); #if ! defined (LUA_VERSION_NUM) || LUA_VERSION_NUM < 501 int op = luaL_findstring(luaL_optstring(L, 2, "cur"), modenames); luaL_argcheck(L, op != -1, 2, "invalid mode"); #else int op = luaL_checkoption(L, 2, "cur", modenames); #endif op = zzip_seek(f, offset, mode[op]); if (op < 0) return pushresult(L, 0, NULL); /* error */ else { lua_pushnumber(L, zzip_tell(f)); return 1; } } static const luaL_reg ziplib[] = { {"open", zip_open}, {"close", zip_close}, {"type", zip_type}, // {"files", io_files}, {"openfile", zip_openfile}, {NULL, NULL} }; static const luaL_reg flib[] = { {"open", f_open}, {"close", zip_close}, {"files", f_files}, {"__gc", zip_gc}, {"__tostring", zip_tostring}, {NULL, NULL} }; static const luaL_reg fflib[] = { {"read", ff_read}, {"close", ff_close}, {"seek", ff_seek}, {"lines", ff_lines}, {"__gc", ff_gc}, {"__tostring", ff_tostring}, /* {"flush", ff_flush}, {"write", ff_write},*/ {NULL, NULL} }; /* ** Assumes the table is on top of the stack. */ static void set_info (lua_State *L) { lua_pushliteral (L, "_COPYRIGHT"); lua_pushliteral (L, "Copyright (C) 2003-2007 Kepler Project"); lua_settable (L, -3); lua_pushliteral (L, "_DESCRIPTION"); lua_pushliteral (L, "Reading files inside zip files"); lua_settable (L, -3); lua_pushliteral (L, "_VERSION"); lua_pushliteral (L, "LuaZip 1.2.3"); lua_settable (L, -3); } static void createmeta (lua_State *L) { luaL_newmetatable(L, ZIPFILEHANDLE); /* create new metatable for file handles */ /* file methods */ lua_pushliteral(L, "__index"); lua_pushvalue(L, -2); /* push metatable */ lua_rawset(L, -3); /* metatable.__index = metatable */ luaL_openlib(L, NULL, flib, 0); luaL_newmetatable(L, ZIPINTERNALFILEHANDLE); /* create new metatable for internal file handles */ /* internal file methods */ lua_pushliteral(L, "__index"); lua_pushvalue(L, -2); /* push metatable */ lua_rawset(L, -3); /* metatable.__index = metatable */ luaL_openlib(L, NULL, fflib, 0); } LUAZIP_API int luaopen_zip (lua_State *L) { createmeta(L); lua_pushvalue(L, -1); luaL_openlib(L, LUA_ZIPLIBNAME, ziplib, 1); set_info(L); return 1; } luazip-1.2.3/src/luazip.def0000644000175000017500000000002410633355273015721 0ustar carregalcarregalEXPORTS luaopen_zipluazip-1.2.3/src/luazip.h0000644000175000017500000000061210635551451015413 0ustar carregalcarregal/* LuaZip - Reading files inside zip files. http://www.keplerproject.org/luazip/ Author: Danilo Tuler Copyright (c) 2003-2007 Kepler Project $Id: luazip.h,v 1.5 2007/06/18 18:47:05 carregal Exp $ */ #ifndef luazip_h #define luazip_h #include "lua.h" #ifndef LUAZIP_API #define LUAZIP_API LUA_API #endif #define LUA_ZIPLIBNAME "zip" LUAZIP_API int luaopen_zip (lua_State *L); #endif luazip-1.2.3/Makefile0000644000175000017500000000122510461020524014575 0ustar carregalcarregal# $Id: Makefile,v 1.10 2006/07/24 01:24:36 tomas Exp $ T= zip V= 1.2.3 CONFIG= ./config include $(CONFIG) ifeq "$(LUA_VERSION_NUM)" "500" COMPAT_O= $(COMPAT_DIR)/compat-5.1.o endif SRCS= src/lua$T.c OBJS= src/lua$T.o $(COMPAT_O) lib: src/$(LIBNAME) src/$(LIBNAME): $(OBJS) export MACOSX_DEPLOYMENT_TARGET="10.3"; $(CC) $(CFLAGS) $(LIB_OPTION) -o src/$(LIBNAME) $(OBJS) -lzzip $(COMPAT_DIR)/compat-5.1.o: $(COMPAT_DIR)/compat-5.1.c $(CC) -c $(CFLAGS) -o $@ $(COMPAT_DIR)/compat-5.1.c install: src/$(LIBNAME) mkdir -p $(LUA_LIBDIR) cp src/$(LIBNAME) $(LUA_LIBDIR) cd $(LUA_LIBDIR); ln -f -s $(LIBNAME) $T.so clean: rm -f $L src/$(LIBNAME) $(OBJS) luazip-1.2.3/README0000644000175000017500000000047610635551451014037 0ustar carregalcarregalLuaZip 1.2.3 ------------ LuaZip is a lightweight Lua extension library used to read files stored inside zip files. The API is very similar to the standard Lua I/O library API.

LuaZip is free software and uses the same license as Lua 5.1. Please see docs at doc/index.html or http://www.keplerproject.org/luazip luazip-1.2.3/config0000644000175000017500000000153710461020524014333 0ustar carregalcarregal# Installation directories # System's libraries directory (where binary libraries are installed) LUA_LIBDIR= /usr/local/lib/lua/5.0 # System's lua directory (where Lua libraries are installed) LUA_DIR= /usr/local/share/lua/5.0 # Lua includes directory LUA_INC= /usr/local/include/lua5 # Zziplib includes directory ZZLIB_INC= /usr/local/include # OS dependent LIB_OPTION= -shared #for Linux #LIB_OPTION= -bundle -undefined dynamic_lookup #for MacOS X # Lua version number (first and second digits of target version) LUA_VERSION_NUM= 500 LIBNAME= $T.so.$V COMPAT_DIR= ../compat/src # Compilation directives WARN= -O2 -Wall -fPIC -W -Waggregate-return -Wcast-align -Wmissing-prototypes -Wnested-externs -Wshadow -Wwrite-strings INCS= -I$(LUA_INC) -I$(ZZLIB_INC) -I$(COMPAT_DIR) CFLAGS= $(WARN) $(INCS) CC= gcc # $Id: config,v 1.6 2006/07/24 01:24:36 tomas Exp $ luazip-1.2.3/makefile.win0000644000175000017500000000135410634100302015427 0ustar carregalcarregalLUA_INC=c:\lua5.1\include LUA_DIR=c:\lua5.1\lua LUA_LIBDIR=c:\lua5.1 LUA_LIB=c:\lua5.1\lua5.1.lib OBJS= src\luazip.obj ZZLIB_INCLUDE=c:\zziplib-0.13.49 ZZLIB_LIB=c:\zziplib-0.13.49\zzip\zziplib.lib ZLIB_INCLUDE=c:\zziplib-0.13.49\zlib\include ZLIB_LIB=c:\zziplib-0.13.49\zlib\lib\zlib.lib .c.obj: cl /c /Fo$@ /O2 /I$(LUA_INC) /I$(ZZLIB_INCLUDE) /I$(ZLIB_INCLUDE) /D_CRT_SECURE_NO_DEPRECATE $< src\zip.dll: $(OBJS) link /dll /def:src\luazip.def /out:$@ $(OBJS) $(ZZLIB_LIB) $(ZLIB_LIB) $(LUA_LIB) install: src\zip.dll IF NOT EXIST $(LUA_LIBDIR) mkdir $(LUA_LIBDIR) copy src\zip.dll $(LUA_LIBDIR) clean: del src\zip.dll del src\*.obj del src\zip.exp del src\zip.lib # $Id: makefile.win,v 1.2 2007/06/13 23:41:54 carregal Exp $ luazip-1.2.3/tests/0000755000175000017500000000000010635554541014315 5ustar carregalcarregalluazip-1.2.3/tests/luazip.zip0000644000175000017500000001170610153405651016342 0ustar carregalcarregalPK)0㦢O|README;0D{KÜ95d%cGލ y<>ؕ1 fTR|_q ʬ(v2I+m4:>FKSPK<0^MakefileRQo0~^0FH!+g`I<|HZPeD0p?!Ӵk x2/=1vO= <'ώ/!w#ߖ^^o흳T;ϔbRZ`$tW,{ />uZ&{@ǦO/R-懰M\Ӷ5C92%k49밵jà΋2xVSTg\<[R[e%&N'f+<%_B+(A B;l|KHjvwoD8e*T%ů0s~3tcl<:E҇*IܡQ BERPoiL!g0T2W "- PKo13ȗm8luazip.cSFg2aMC2@G+C4B(]ʲ1>ݷo{}hQ#N/&.8N("JD BLY =~( D2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ezJõ{bZK+H06ǖyQ-v1 +0][+IB]3R_;8<&XZ&}a_H Ρ֧1=Y#Bl},H_0S)w -MşuR0l 6HXBcÍhT4q`E=?2JՉΥЋM/ *ѐnnN١#VOH8Hsj (xTZ'Q 2NDV`~hL6YaZJ]SڛWUި ?U._D+t#_Pп<^meׇ1ϜpV&_i貋/R;N yViJQ1..7*.5 ׳xY܉ sw5(mxTmݣ+c$\:v+BO)P h(Xƪ[(k79̇O؝0-VizJ*JYFAbIA8J'*7ñ٨tu.IPnc?6 8M=XU={ 24&&ǥU,pnrR&`%$SϊmѠW\*-q:8VuUaD&x2+jTnPD` {/YWӋw'ixn-?#lhax(L[,c4je7 ZTH!$;8Β}F3bW6H}63x&CW ߫[UK:=N@¹{Uq[ڦ34Ham./1"@IjC~idjVjqxw'A 3Q-r@_ 6W5BPS6G&.ti/~T|\CNnOq43'=J 9:$'Q!c8=u87W)uy`O|Aʃ?`GrkI]ʽڷBȷ4kvvp#ZPKL ~0œ]luazip.hRLKIMSȩ,Rr2R|Hf^rNiJRNi^D '3 1&IKL납Jx:9r* өW* 5/($*hhZM PK)0㦢O| READMEPK<0^ MakefilePKo13ȗm8 luazip.cPKL ~0œ] 5luazip.hPKluazip-1.2.3/tests/a3.ext30000644000175000017500000000045310153405651015417 0ustar carregalcarregalPK z1b3/PK z1b3/c3/PK tx1 + b3/c3/d3.txta b c PK z1b3/PK z1!b3/c3/PK tx1 + Eb3/c3/d3.txtPKvluazip-1.2.3/tests/a3.zip0000644000175000017500000000045110153405651015334 0ustar carregalcarregalPK z1b3/PK z1b3/c3/PK x1 . b3/c3/d3.txta b cPK z1b3/PK z1!b3/c3/PK x1 . Eb3/c3/d3.txtPKtluazip-1.2.3/tests/a/0000755000175000017500000000000010635554541014535 5ustar carregalcarregalluazip-1.2.3/tests/a/b/0000755000175000017500000000000010635554541014756 5ustar carregalcarregalluazip-1.2.3/tests/a/b/c.zip0000644000175000017500000000016210153405651015713 0ustar carregalcarregalPK x13wod.txta b c PK x13wo d.txtPK3)luazip-1.2.3/tests/a2/0000755000175000017500000000000010635554541014617 5ustar carregalcarregalluazip-1.2.3/tests/a2/b2.ext20000644000175000017500000000031310153405651015713 0ustar carregalcarregalPK z1c2/PK x1 . c2/d2.txta b cPK z1c2/PK x1 . !c2/d2.txtPKhMluazip-1.2.3/tests/a2/b2.zip0000644000175000017500000000031310153405651015633 0ustar carregalcarregalPK z1c2/PK x1 . c2/d2.txta b cPK z1c2/PK x1 . !c2/d2.txtPKhMluazip-1.2.3/tests/test_zip.lua0000644000175000017500000000315310251614124016647 0ustar carregalcarregal--[[------------------------------------------------------------------------ test_zip.lua test code for luazip --]]------------------------------------------------------------------------ -- compatibility code for Lua version 5.0 providing 5.1 behavior if string.find (_VERSION, "Lua 5.0") and not package then if not LUA_PATH then LUA_PATH = os.getenv("LUA_PATH") or "./?.lua;" end require"compat-5.1" package.cpath = os.getenv("LUA_CPATH") or "./?.so;./?.dll;./?.dylib" end require('zip') function test_open () local zfile, err = zip.open('luazip.zip') assert(zfile, err) print("File list begin") for file in zfile:files() do print(file.filename) end print("File list ended OK!") print() print("Testing zfile:open") local f1, err = zfile:open('README') assert(f1, err) local f2, err = zfile:open('luazip.h') assert(f2, err) print("zfile:open OK!") print() print("Testing reading by number") local c = f1:read(1) while c ~= nil do io.write(c) c = f1:read(1) end print() print("OK") print() end function test_openfile () print("Testing the openfile magic") local d, err = zip.openfile('a/b/c/d.txt') assert(d, err) local e, err = zip.openfile('a/b/c/e.txt') assert(e == nil, err) local d2, err = zip.openfile('a2/b2/c2/d2.txt', "ext2") assert(d2, err) local e2, err = zip.openfile('a2/b2/c2/e2.txt', "ext2") assert(e2 == nil, err) local d3, err = zip.openfile('a3/b3/c3/d3.txt', {"ext2", "ext3"}) assert(d3, err) local e3, err = zip.openfile('a3/b3/c3/e3.txt', {"ext2", "ext3"}) assert(e3 == nil, err) print("Smooth magic!") print() end test_open() test_openfile() luazip-1.2.3/vc6/0000755000175000017500000000000010635554541013651 5ustar carregalcarregalluazip-1.2.3/vc6/luazip.dsw0000644000175000017500000000100210222572326015656 0ustar carregalcarregalMicrosoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "luazip_dll"=.\luazip_dll.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### luazip-1.2.3/vc6/README0000644000175000017500000000075210161770705014531 0ustar carregalcarregalThese are the Visual Studio 6 projects provided by the Kepler Project Files: luazip_dll.dsp luazip_static.dsp luazip.dsw README Generated files: luazip.ncb luazip.opt ../lib/vc6/libzip.lib ../lib/vc6/libzipd.lib ../lib/vc6/zip.exp ../lib/vc6/zip.lib ../lib/vc6/zipd.exp ../lib/vc6/zipd.lib ../lib/vc6/zipd.pdb ../bin/vc6/zip.dll ../bin/vc6/zipd.dll ../bin/vc6/zipd.ilk Download source from: http://prdownloads.sourceforge.net/zziplib/zziplib-0.12.83.tar.bz2?downloadluazip-1.2.3/vc6/luazip.rc0000644000175000017500000000470310206665561015506 0ustar carregalcarregal//Microsoft Developer Studio generated resource script. // #include "resource.h" #define APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// // // Generated from the TEXTINCLUDE 2 resource. // #include "afxres.h" ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// // Portuguese (Brazil) resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_PTB) #ifdef _WIN32 LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE_BRAZILIAN #pragma code_page(1252) #endif //_WIN32 #ifndef _MAC ///////////////////////////////////////////////////////////////////////////// // // Version // VS_VERSION_INFO VERSIONINFO FILEVERSION 1,2,1,0 PRODUCTVERSION 1,2,1,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x21L #else FILEFLAGS 0x20L #endif FILEOS 0x40004L FILETYPE 0x2L FILESUBTYPE 0x0L BEGIN BLOCK "StringFileInfo" BEGIN BLOCK "000004b0" BEGIN VALUE "Comments", "\0" VALUE "CompanyName", "Ideais\0" VALUE "FileDescription", "LuaZip\0" VALUE "FileVersion", "1, 2, 1, 0\0" VALUE "InternalName", "luazip\0" VALUE "LegalCopyright", "Kepler Project 2005\0" VALUE "LegalTrademarks", "\0" VALUE "OriginalFilename", "luazip.dll\0" VALUE "PrivateBuild", "\0" VALUE "ProductName", "LuaZip\0" VALUE "ProductVersion", "1, 2, 1, 0\0" VALUE "SpecialBuild", "lua-5.0.2, zziplib-0.12.83\0" END END BLOCK "VarFileInfo" BEGIN VALUE "Translation", 0x0, 1200 END END #endif // !_MAC #ifdef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // TEXTINCLUDE // 1 TEXTINCLUDE DISCARDABLE BEGIN "resource.h\0" END 2 TEXTINCLUDE DISCARDABLE BEGIN "#include ""afxres.h""\r\n" "\0" END 3 TEXTINCLUDE DISCARDABLE BEGIN "\r\n" "\0" END #endif // APSTUDIO_INVOKED #endif // Portuguese (Brazil) resources ///////////////////////////////////////////////////////////////////////////// #ifndef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // Generated from the TEXTINCLUDE 3 resource. // ///////////////////////////////////////////////////////////////////////////// #endif // not APSTUDIO_INVOKED luazip-1.2.3/vc6/luazip_dll.dsp0000644000175000017500000001344210242464274016521 0ustar carregalcarregal# Microsoft Developer Studio Project File - Name="luazip_dll" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 CFG=luazip_dll - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "luazip_dll.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "luazip_dll.mak" CFG="luazip_dll - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "luazip_dll - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "luazip_dll - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "luazip_dll - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "../lib/vc6" # PROP Intermediate_Dir "luazip_dll/Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LUAZIP_EXPORTS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "../../external-src/lua50/include" /I "../../external-src/zlib/include" /I "../../external-src/zziplib-0.12.83" /I "../../compat/src" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LUAZIP_EXPORTS" /D LUAZIP_API=__declspec(dllexport) /FR /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x416 /d "NDEBUG" # ADD RSC /l 0x416 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 # ADD LINK32 lua50.lib zdll.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"../bin/vc6/zip.dll" /libpath:"../../external-src/lua50/lib/dll" /libpath:"../../external-src/zlib/lib" # Begin Special Build Tool SOURCE="$(InputPath)" PostBuild_Cmds=cd ../bin/vc6 zip.exe luazip-1.2.1-win32.zip zip.dll # End Special Build Tool !ELSEIF "$(CFG)" == "luazip_dll - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "../lib/vc6" # PROP Intermediate_Dir "luazip_dll/Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LUAZIP_EXPORTS" /YX /FD /GZ /c # ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../external-src/lua50/include" /I "../../external-src/zlib/include" /I "../../external-src/zziplib-0.12.83" /I "../../compat/src" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LUAZIP_EXPORTS" /D LUAZIP_API=__declspec(dllexport) /FR /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x416 /d "_DEBUG" # ADD RSC /l 0x416 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept # ADD LINK32 lua50.lib zdll.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"../bin/vc6/zipd.dll" /pdbtype:sept /libpath:"../../external-src/lua50/lib/dll" /libpath:"../../external-src/zlib/lib" !ENDIF # Begin Target # Name "luazip_dll - Win32 Release" # Name "luazip_dll - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE="..\..\compat\src\compat-5.1.c" # End Source File # Begin Source File SOURCE=..\src\luazip.c # End Source File # Begin Source File SOURCE=.\luazip.rc # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE="..\..\compat\src\compat-5.1.h" # End Source File # Begin Source File SOURCE=..\src\luazip.h # End Source File # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # Begin Group "zziplib Files" # PROP Default_Filter "" # Begin Source File SOURCE="..\..\external-src\zziplib-0.12.83\zzip\dir.c" # End Source File # Begin Source File SOURCE="..\..\external-src\zziplib-0.12.83\zzip\err.c" # End Source File # Begin Source File SOURCE="..\..\external-src\zziplib-0.12.83\zzip\file.c" # End Source File # Begin Source File SOURCE="..\..\external-src\zziplib-0.12.83\zzip\info.c" # End Source File # Begin Source File SOURCE="..\..\external-src\zziplib-0.12.83\zzip\plugin.c" # End Source File # Begin Source File SOURCE="..\..\external-src\zziplib-0.12.83\zzip\stat.c" # End Source File # Begin Source File SOURCE="..\..\external-src\zziplib-0.12.83\zzip\write.c" # End Source File # Begin Source File SOURCE="..\..\external-src\zziplib-0.12.83\zzip\zip.c" # End Source File # End Group # End Target # End Project luazip-1.2.3/vc6/luazip_static.dsp0000644000175000017500000000763410167531413017237 0ustar carregalcarregal# Microsoft Developer Studio Project File - Name="luazip_static" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Static Library" 0x0104 CFG=luazip_static - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "luazip_static.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "luazip_static.mak" CFG="luazip_static - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "luazip_static - Win32 Release" (based on "Win32 (x86) Static Library") !MESSAGE "luazip_static - Win32 Debug" (based on "Win32 (x86) Static Library") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "luazip_static - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "../lib/vc6" # PROP Intermediate_Dir "luazip_static/Release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "../../lua/include" /I "../../zlib/include" /I "../zziplib-0.12.83" /I "../../compat" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c # ADD BASE RSC /l 0x416 /d "NDEBUG" # ADD RSC /l 0x416 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo /out:"../lib/vc6/libzip.lib" !ELSEIF "$(CFG)" == "luazip_static - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "../lib/vc6" # PROP Intermediate_Dir "luazip_static/Debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c # ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../lua/include" /I "../../zlib/include" /I "../zziplib-0.12.83" /I "../../compat" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c # ADD BASE RSC /l 0x416 /d "_DEBUG" # ADD RSC /l 0x416 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo /out:"../lib/vc6/libzipd.lib" !ENDIF # Begin Target # Name "luazip_static - Win32 Release" # Name "luazip_static - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE="..\..\compat\compat-5.1.c" # End Source File # Begin Source File SOURCE=..\luazip.c # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE="..\..\compat\compat-5.1.h" # End Source File # Begin Source File SOURCE=..\luazip.h # End Source File # End Group # Begin Group "zziplib Files" # PROP Default_Filter "" # Begin Source File SOURCE="..\zziplib-0.12.83\zzip\dir.c" # End Source File # Begin Source File SOURCE="..\zziplib-0.12.83\zzip\err.c" # End Source File # Begin Source File SOURCE="..\zziplib-0.12.83\zzip\file.c" # End Source File # Begin Source File SOURCE="..\zziplib-0.12.83\zzip\info.c" # End Source File # Begin Source File SOURCE="..\zziplib-0.12.83\zzip\plugin.c" # End Source File # Begin Source File SOURCE="..\zziplib-0.12.83\zzip\stat.c" # End Source File # Begin Source File SOURCE="..\zziplib-0.12.83\zzip\write.c" # End Source File # Begin Source File SOURCE="..\zziplib-0.12.83\zzip\zip.c" # End Source File # End Group # End Target # End Project luazip-1.2.3/vc6/resource.h0000644000175000017500000000061310161770657015653 0ustar carregalcarregal//{{NO_DEPENDENCIES}} // Microsoft Developer Studio generated include file. // Used by luazip.rc // // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 101 #define _APS_NEXT_COMMAND_VALUE 40001 #define _APS_NEXT_CONTROL_VALUE 1000 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif luazip-1.2.3/vc7/0000755000175000017500000000000010635554542013653 5ustar carregalcarregalluazip-1.2.3/vc7/luazip.rc0000644000175000017500000000441110153405651015474 0ustar carregalcarregal// Microsoft Visual C++ generated resource script. // #include "resource.h" #define APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// // // Generated from the TEXTINCLUDE 2 resource. // #include "afxres.h" ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// // Portuguese (Brazil) resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_PTB) #ifdef _WIN32 LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE_BRAZILIAN #pragma code_page(1252) #endif //_WIN32 ///////////////////////////////////////////////////////////////////////////// // // Version // VS_VERSION_INFO VERSIONINFO FILEVERSION 1,2,0,0 PRODUCTVERSION 1,2,0,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x21L #else FILEFLAGS 0x20L #endif FILEOS 0x40004L FILETYPE 0x2L FILESUBTYPE 0x0L BEGIN BLOCK "StringFileInfo" BEGIN BLOCK "000004b0" BEGIN VALUE "CompanyName", "Ideais" VALUE "FileDescription", "LuaZip" VALUE "FileVersion", "1, 2, 0, 0" VALUE "InternalName", "luazip" VALUE "LegalCopyright", "Kepler Project 2004" VALUE "OriginalFilename", "luazip.dll" VALUE "ProductName", "LuaZip" VALUE "ProductVersion", "1, 2, 0, 0" VALUE "SpecialBuild", "lua-5.0.2, zziplib-0.12.83, compat-5.1 release 1" END END BLOCK "VarFileInfo" BEGIN VALUE "Translation", 0x0, 1200 END END #ifdef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // TEXTINCLUDE // 1 TEXTINCLUDE BEGIN "resource.h\0" END 2 TEXTINCLUDE BEGIN "#include ""afxres.h""\r\n" "\0" END 3 TEXTINCLUDE BEGIN "\r\n" "\0" END #endif // APSTUDIO_INVOKED #endif // Portuguese (Brazil) resources ///////////////////////////////////////////////////////////////////////////// #ifndef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // Generated from the TEXTINCLUDE 3 resource. // ///////////////////////////////////////////////////////////////////////////// #endif // not APSTUDIO_INVOKED luazip-1.2.3/vc7/README0000644000175000017500000000074210153405651014525 0ustar carregalcarregalThese are the Visual Studio 7 projects provided by the Kepler Project Files: luazip_dll.vcproj luazip_static.vcproj luazip.sln README Generated files: lzip.suo ../lib/vc7/libzip.lib ../lib/vc7/libzipd.lib ../lib/vc7/zip.exp ../lib/vc7/zip.lib ../lib/vc7/zipd.exp ../lib/vc7/zipd.lib ../lib/vc7/zipd.pdb ../bin/vc7/zip.dll ../bin/vc7/zipd.dll ../bin/vc7/zipd.ilk Download source from: http://prdownloads.sourceforge.net/zziplib/zziplib-0.12.83.tar.bz2?downloadluazip-1.2.3/vc7/luazip.sln0000644000175000017500000000255710153405651015675 0ustar carregalcarregalMicrosoft Visual Studio Solution File, Format Version 8.00 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "luazip_dll", "luazip_dll.vcproj", "{F7323180-F4E8-4994-9DE4-DB985CF23033}" ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "luazip_static", "luazip_static.vcproj", "{F4571BC6-4181-4D7C-BA2A-4398140445D0}" ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject Global GlobalSection(SolutionConfiguration) = preSolution Debug = Debug Release = Release EndGlobalSection GlobalSection(ProjectConfiguration) = postSolution {F7323180-F4E8-4994-9DE4-DB985CF23033}.Debug.ActiveCfg = Debug|Win32 {F7323180-F4E8-4994-9DE4-DB985CF23033}.Debug.Build.0 = Debug|Win32 {F7323180-F4E8-4994-9DE4-DB985CF23033}.Release.ActiveCfg = Release|Win32 {F7323180-F4E8-4994-9DE4-DB985CF23033}.Release.Build.0 = Release|Win32 {F4571BC6-4181-4D7C-BA2A-4398140445D0}.Debug.ActiveCfg = Debug|Win32 {F4571BC6-4181-4D7C-BA2A-4398140445D0}.Debug.Build.0 = Debug|Win32 {F4571BC6-4181-4D7C-BA2A-4398140445D0}.Release.ActiveCfg = Release|Win32 {F4571BC6-4181-4D7C-BA2A-4398140445D0}.Release.Build.0 = Release|Win32 EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution EndGlobalSection GlobalSection(ExtensibilityAddIns) = postSolution EndGlobalSection EndGlobal luazip-1.2.3/vc7/luazip_dll.vcproj0000644000175000017500000002714610153405651017240 0ustar carregalcarregal luazip-1.2.3/vc7/luazip_static.vcproj0000644000175000017500000002040310153405651017741 0ustar carregalcarregal luazip-1.2.3/vc7/resource.h0000644000175000017500000000162410161770657015657 0ustar carregalcarregal//{{NO_DEPENDENCIES}} // Microsoft Visual C++ generated include file. // Used by luazip.rc // #define IDS_PROJNAME 100 #define IDR_WMDMLOGGER 101 #define IDS_LOG_SEV_INFO 201 #define IDS_LOG_SEV_WARN 202 #define IDS_LOG_SEV_ERROR 203 #define IDS_LOG_DATETIME 204 #define IDS_LOG_SRCNAME 205 #define IDS_DEF_LOGFILE 301 #define IDS_DEF_MAXSIZE 302 #define IDS_DEF_SHRINKTOSIZE 303 #define IDS_DEF_LOGENABLED 304 #define IDS_MUTEX_TIMEOUT 401 // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 201 #define _APS_NEXT_COMMAND_VALUE 32768 #define _APS_NEXT_CONTROL_VALUE 201 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif