summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.sol.mingw2
-rw-r--r--configure.ac1
-rw-r--r--lib/Input.cc34
-rw-r--r--src/Makefile.am7
-rw-r--r--src/paq.cc9
5 files changed, 50 insertions, 3 deletions
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 <dirent.h>
+#include <Main.h>
+#include <Input.h>
+#include <Output.h>
+
+CODE_BEGINS
+virtual int startup(void) throw (GeneralException) {
+}
+CODE_ENDS