From a1176b45029cf5c7645627d38dfc96f66ea213f5 Mon Sep 17 00:00:00 2001 From: pixel Date: Fri, 24 Jan 2003 08:17:00 +0000 Subject: All for NPAQ files... --- Makefile.sol.mingw | 2 +- configure.ac | 1 + lib/Input.cc | 34 ++++++++++++++++++++++++++++++++++ src/Makefile.am | 7 +++++-- src/paq.cc | 9 +++++++++ 5 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 src/paq.cc diff --git a/Makefile.sol.mingw b/Makefile.sol.mingw index 2aafe72..50e5f4a 100644 --- a/Makefile.sol.mingw +++ b/Makefile.sol.mingw @@ -1,4 +1,4 @@ -SUBDIRS = lib +SUBDIRS = lib src all: for dir in $(SUBDIRS) ; do $(MAKE) -C $$dir -f Makefile.sol.mingw all ; done diff --git a/configure.ac b/configure.ac index f69a841..b4864a2 100644 --- a/configure.ac +++ b/configure.ac @@ -30,6 +30,7 @@ AC_HEADER_SYS_WAIT AC_HEADER_STDBOOL AC_HEADER_STAT AC_HEADER_TIME +AC_HEADER_DIRENT AC_CHECK_HEADERS([argz.h fcntl.h inttypes.h langinfo.h libintl.h limits.h locale.h malloc.h netdb.h netinet/in.h stddef.h stdint.h stdio_ext.h stdlib.h string.h strings.h sys/param.h sys/socket.h sys/time.h unistd.h]) # Checks for typedefs, structures, and compiler characteristics. diff --git a/lib/Input.cc b/lib/Input.cc index e9b859a..6644dd0 100644 --- a/lib/Input.cc +++ b/lib/Input.cc @@ -22,6 +22,40 @@ #define BUILTIN_SIG 0x5141504e +/* + + NPAQ file format + ================ + +off|siz|description +---+---+----------- + 0 | 4 | Magic: NPAQ + 4 | X | Index +4+X| Y | Files + +Index: +It's composed of entries. Each entries have the same format: + +off|siz|description +---+---+----------- + 0 | 1 | name size = n + 1 | n | file name +1+n| 4 | file size +5+n| 1 | type --> 0 = file / 1 = directory + +If it's a directory, it means the following entries belongs to this directory. +If n = 0, there is nothing else afterward (no filesize nor type) and it +means the end of the current directory. The end of the root directory +means the end of the index. + +Files: +Each file are gzipped. They are all concatenated after the index. They +all start with a four bytes length which correspond to the unpacked size. +The size in the index corresponds to the size of the gzipped result plus +those 4 bytes. + +*/ + static Input::openresults_t gresults; Input::Input(const String & no) throw (GeneralException) : diff --git a/src/Makefile.am b/src/Makefile.am index dc5372e..a6c1b01 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -6,7 +6,7 @@ AM_CFLAGS = -O3 -Wall -Wstrict-prototypes -g AM_CXXFLAGS = -O3 -Wall -Wstrict-prototypes -g INCLUDES = -I.. -I../include -I$(includedir) -noinst_PROGRAMS = Baltisot +noinst_PROGRAMS = Baltisot paq noinst_JAVA = TestApplet.java @@ -14,8 +14,11 @@ JAVAROOT = datas Baltisot_SOURCES = Main.cc -LDADD = ../lib/libBaltisot.la -lefence +paq_SOURCES = paq.cc + +LDADD = ../lib/libBaltisot.la Baltisot_LDADD = $(LDADD) +paq_LDADD = $(LDADD) EXTRA_DIST = misc.cc TestApplet.java diff --git a/src/paq.cc b/src/paq.cc new file mode 100644 index 0000000..fff6569 --- /dev/null +++ b/src/paq.cc @@ -0,0 +1,9 @@ +#include +#include +#include +#include + +CODE_BEGINS +virtual int startup(void) throw (GeneralException) { +} +CODE_ENDS -- cgit v1.2.3