move eet to HEAD


			
			
				devs/devilhorns/wayland_egl
			
			
		
Carsten Haitzler 20 years ago
parent 936fe70f8b
commit f9fb3941f8
  1. 2
      legacy/eet/.cvsignore
  2. 0
      legacy/eet/ChangeLog
  3. 14
      legacy/eet/INSTALL
  4. 10
      legacy/eet/Makefile.am
  5. 0
      legacy/eet/NEWS
  6. 3
      legacy/eet/acconfig.h
  7. 137
      legacy/eet/autogen.sh
  8. 75
      legacy/eet/configure.ac
  9. 75
      legacy/eet/configure.in
  10. 7
      legacy/eet/debian/.cvsignore
  11. 6
      legacy/eet/debian/changelog
  12. 29
      legacy/eet/debian/control
  13. 32
      legacy/eet/debian/copyright
  14. 27
      legacy/eet/debian/eet-config.1
  15. 61
      legacy/eet/debian/eet.1
  16. 4
      legacy/eet/debian/libeet0-dev.files
  17. 2
      legacy/eet/debian/libeet0.files
  18. 74
      legacy/eet/debian/rules
  19. 59
      legacy/eet/eet-config.in
  20. 63
      legacy/eet/eet.spec
  21. 3
      legacy/eet/src/.cvsignore
  22. 3
      legacy/eet/src/Makefile.am
  23. 3
      legacy/eet/src/bin/.cvsignore
  24. 12
      legacy/eet/src/bin/Makefile.am
  25. 420
      legacy/eet/src/bin/eet_main.c
  26. 3
      legacy/eet/src/lib/.cvsignore
  27. 268
      legacy/eet/src/lib/Eet.h
  28. 20
      legacy/eet/src/lib/Makefile.am
  29. 1765
      legacy/eet/src/lib/eet_data.c
  30. 889
      legacy/eet/src/lib/eet_lib.c

@ -0,0 +1,2 @@
.config
build-stamp

@ -0,0 +1,14 @@
COMPILING and INSTALLING:
If you got a official release tar archive do:
./configure
( otherwise if you got this from enlightenment cvs do: ./autogen.sh )
Then to compile:
make
To install (run this as root, or the user who handles installs):
make install
NOTE: You MUST make install Eet for it to run properly.

@ -0,0 +1,10 @@
## Process this file with automake to produce Makefile.in
SUBDIRS = src
MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.guess \
config.h.in config.sub configure install-sh \
ltconfig ltmain.sh missing mkinstalldirs \
stamp-h.in
EXTRA_DIST = README AUTHORS COPYING eet.spec

@ -0,0 +1,3 @@
#undef PACKAGE_SOURCE_DIR
#undef PACKAGE_BIN_DIR
#undef PACKAGE_LIB_DIR

@ -0,0 +1,137 @@
#!/bin/sh
# Run this to generate all the initial makefiles, etc.
srcdir=`dirname $0`
PKG_NAME="the package."
DIE=0
(autoconf --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: You must have \`autoconf' installed to."
echo "Download the appropriate package for your distribution,"
echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
DIE=1
}
(grep "^AM_PROG_LIBTOOL" $srcdir/configure.in >/dev/null) && {
(libtool --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: You must have \`libtool' installed."
echo "Get ftp://ftp.gnu.org/pub/gnu/libtool-1.2d.tar.gz"
echo "(or a newer version if it is available)"
DIE=1
}
}
grep "^AM_GNU_GETTEXT" $srcdir/configure.in >/dev/null && {
grep "sed.*POTFILES" $srcdir/configure.in >/dev/null || \
(gettext --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: You must have \`gettext' installed."
echo "Get ftp://alpha.gnu.org/gnu/gettext-0.10.35.tar.gz"
echo "(or a newer version if it is available)"
DIE=1
}
}
(automake --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: You must have \`automake' installed."
echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
echo "(or a newer version if it is available)"
DIE=1
NO_AUTOMAKE=yes
}
# if no automake, don't bother testing for aclocal
test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: Missing \`aclocal'. The version of \`automake'"
echo "installed doesn't appear recent enough."
echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
echo "(or a newer version if it is available)"
DIE=1
}
if test "$DIE" -eq 1; then
exit 1
fi
if test -z "$*"; then
echo "**Warning**: I am going to run \`configure' with no arguments."
echo "If you wish to pass any to it, please specify them on the"
echo \`$0\'" command line."
echo
fi
case $CC in
xlc )
am_opt=--include-deps;;
esac
for coin in `find $srcdir -name configure.in -print`
do
dr=`dirname $coin`
if test -f $dr/NO-AUTO-GEN; then
echo skipping $dr -- flagged as no auto-gen
else
echo processing $dr
macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < $coin`
( cd $dr
aclocalinclude="$ACLOCAL_FLAGS"
for k in $macrodirs; do
if test -d $k; then
aclocalinclude="$aclocalinclude -I $k"
##else
## echo "**Warning**: No such directory \`$k'. Ignored."
fi
done
if grep "^AM_GNU_GETTEXT" configure.in >/dev/null; then
if grep "sed.*POTFILES" configure.in >/dev/null; then
: do nothing -- we still have an old unmodified configure.in
else
echo "Creating $dr/aclocal.m4 ..."
test -r $dr/aclocal.m4 || touch $dr/aclocal.m4
echo "Running gettextize... Ignore non-fatal messages."
echo "no" | gettextize --force --copy
echo "Making $dr/aclocal.m4 writable ..."
test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4
fi
fi
if grep "^AM_GNOME_GETTEXT" configure.in >/dev/null; then
echo "Creating $dr/aclocal.m4 ..."
test -r $dr/aclocal.m4 || touch $dr/aclocal.m4
echo "Running gettextize... Ignore non-fatal messages."
echo "no" | gettextize --force --copy
echo "Making $dr/aclocal.m4 writable ..."
test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4
fi
if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then
echo "Running libtoolize..."
libtoolize --force --copy
fi
echo "Running aclocal $aclocalinclude ..."
aclocal $aclocalinclude
if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then
echo "Running autoheader..."
autoheader
fi
echo "Running automake --gnu $am_opt ..."
automake --add-missing --gnu $am_opt
echo "Running autoconf ..."
autoconf
)
fi
done
#conf_flags="--enable-maintainer-mode --enable-compile-warnings" #--enable-iso-c
if test x$NOCONFIGURE = x; then
echo Running $srcdir/configure $conf_flags "$@" ...
$srcdir/configure $conf_flags "$@" \
&& echo Now type \`make\' to compile $PKG_NAME
else
echo Skipping configure process.
fi

@ -0,0 +1,75 @@
dnl Process this file with autoconf to produce a configure script.
# get rid of that stupid cache mechanism
rm -f config.cache
AC_INIT(configure.in)
AM_INIT_AUTOMAKE(eet, 0.0.1)
AM_CONFIG_HEADER(config.h)
AC_ISC_POSIX
AC_PROG_CC
AM_PROG_CC_STDC
AC_HEADER_STDC
AC_C_CONST
AM_ENABLE_SHARED
AM_PROG_LIBTOOL
if test "x${exec_prefix}" = "xNONE"; then
if test "x${prefix}" = "xNONE"; then
bindir="${ac_default_prefix}/bin";
else
bindir="${prefix}/bin";
fi
else
if test "x${prefix}" = "xNONE"; then
bindir="${ac_default_prefix}/bin";
else
bindir="${prefix}/bin";
fi
fi
if test "x${exec_prefix}" = "xNONE"; then
if test "x${prefix}" = "xNONE"; then
libdir="${ac_default_prefix}/lib";
else
libdir="${prefix}/lib";
fi
else
if test "x${prefix}" = "xNONE"; then
libdir="${ac_default_prefix}/lib";
else
libdir="${prefix}/lib";
fi
fi
dnl Set PACKAGE_BIN_DIR in config.h.
if test "x${bindir}" = 'xNONE'; then
if test "x${prefix}" = "xNONE"; then
AC_DEFINE_UNQUOTED(PACKAGE_BIN_DIR, "${ac_default_prefix}/bin")
else
AC_DEFINE_UNQUOTED(PACKAGE_BIN_DIR, "${prefix}/bin")
fi
else
AC_DEFINE_UNQUOTED(PACKAGE_BIN_DIR, "${bindir}")
fi
dnl Set PACKAGE_LIB_DIR in config.h.
if test "x${libdir}" = 'xNONE'; then
if test "x${prefix}" = "xNONE"; then
AC_DEFINE_UNQUOTED(PACKAGE_LIB_DIR, "${ac_default_prefix}/lib")
else
AC_DEFINE_UNQUOTED(PACKAGE_LIB_DIR, "${prefix}/lib")
fi
else
AC_DEFINE_UNQUOTED(PACKAGE_LIB_DIR, "${libdir}")
fi
dnl Set PACKAGE_SOURCE_DIR in config.h.
packagesrcdir=`cd $srcdir && pwd`
AC_DEFINE_UNQUOTED(PACKAGE_SOURCE_DIR, "${packagesrcdir}")
AC_OUTPUT([
Makefile src/Makefile src/lib/Makefile src/bin/Makefile
])

@ -0,0 +1,75 @@
dnl Process this file with autoconf to produce a configure script.
# get rid of that stupid cache mechanism
rm -f config.cache
AC_INIT(configure.in)
AM_INIT_AUTOMAKE(eet, 0.0.1)
AM_CONFIG_HEADER(config.h)
AC_ISC_POSIX
AC_PROG_CC
AM_PROG_CC_STDC
AC_HEADER_STDC
AC_C_CONST
AM_ENABLE_SHARED
AM_PROG_LIBTOOL
if test "x${exec_prefix}" = "xNONE"; then
if test "x${prefix}" = "xNONE"; then
bindir="${ac_default_prefix}/bin";
else
bindir="${prefix}/bin";
fi
else
if test "x${prefix}" = "xNONE"; then
bindir="${ac_default_prefix}/bin";
else
bindir="${prefix}/bin";
fi
fi
if test "x${exec_prefix}" = "xNONE"; then
if test "x${prefix}" = "xNONE"; then
libdir="${ac_default_prefix}/lib";
else
libdir="${prefix}/lib";
fi
else
if test "x${prefix}" = "xNONE"; then
libdir="${ac_default_prefix}/lib";
else
libdir="${prefix}/lib";
fi
fi
dnl Set PACKAGE_BIN_DIR in config.h.
if test "x${bindir}" = 'xNONE'; then
if test "x${prefix}" = "xNONE"; then
AC_DEFINE_UNQUOTED(PACKAGE_BIN_DIR, "${ac_default_prefix}/bin")
else
AC_DEFINE_UNQUOTED(PACKAGE_BIN_DIR, "${prefix}/bin")
fi
else
AC_DEFINE_UNQUOTED(PACKAGE_BIN_DIR, "${bindir}")
fi
dnl Set PACKAGE_LIB_DIR in config.h.
if test "x${libdir}" = 'xNONE'; then
if test "x${prefix}" = "xNONE"; then
AC_DEFINE_UNQUOTED(PACKAGE_LIB_DIR, "${ac_default_prefix}/lib")
else
AC_DEFINE_UNQUOTED(PACKAGE_LIB_DIR, "${prefix}/lib")
fi
else
AC_DEFINE_UNQUOTED(PACKAGE_LIB_DIR, "${libdir}")
fi
dnl Set PACKAGE_SOURCE_DIR in config.h.
packagesrcdir=`cd $srcdir && pwd`
AC_DEFINE_UNQUOTED(PACKAGE_SOURCE_DIR, "${packagesrcdir}")
AC_OUTPUT([
Makefile src/Makefile src/lib/Makefile src/bin/Makefile
])

@ -0,0 +1,7 @@
files
libeet0
libeet0-dev
libeet0.postinst.debhelper
libeet0.postrm.debhelper
libeet0.substvars
tmp

@ -0,0 +1,6 @@
libeet (0.0.0-0cvs20021005) unstable; urgency=low
* a CVS release
-- Sytse Wielinga <s.b.wielinga@student.utwente.nl> Sat, 5 Oct 2002 12:12:06 +0200

@ -0,0 +1,29 @@
Source: libeet
Section: libs
Priority: optional
Maintainer: Sytse Wielinga <s.b.wielinga@student.utwente.nl>
Build-Depends: debhelper (>> 3.0.0), libz-dev, libjpeg-dev
Standards-Version: 3.5.7.0
Package: libeet0-dev
Section: devel
Architecture: any
Depends: libeet0 (= ${Source-Version})
Provides: libeet-dev
Conflicts: libeet-dev
Description: Enlightenment file chunk reading/writing library development files
This package contains headers and static libraries for development with
libeet.
Package: libeet0
Section: libs
Architecture: any
Depends: ${shlibs:Depends}
Description: Enlightenment file chunk reading/writing library
Eet is a tiny library designed to write an arbitary set of chunks of data to a
file and optionally compress each chunk (very much like a zip file) and allow
fast random-access reading of the file later on. It does not do zip as zip
itself has more complexity than we need, and it was much simpler to implement
this once here.
.
It's small, fast, and does a job. It's heavily commented and fully documented.

@ -0,0 +1,32 @@
This package was debianized by Sytse Wielinga <s.b.wielinga@student.utwente.nl> on
Thu, 3 Oct 2002 12:08:24 +0200.
The source is downloaded from the e17/libs/eet module of the enlightenment CVS
tree. For more information, see:
http://www.enlightenment.org/cvs.html
Upstream Author(s): Enlightenment team <enlightenment-devel@lists.sourceforge.net>
Copyright:
Copyright (C) 2000 Carsten Haitzler and various contributors (see AUTHORS)
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 of the Software, its documentation and marketing & publicity
materials, and acknowledgment shall be given in the documentation, materials
and software packages that this Software was used.
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 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.

@ -0,0 +1,27 @@
.\" Hey, EMACS: -*- nroff -*-
.TH EET 1 "oktober 3, 2002"
.SH NAME
eet-config \- script to get information about the installed version of Eet
.SH SYNOPSIS
.B eet-config [\-\-version] [\-\-libs] [\-\-cflags]
.SH DESCRIPTION
\fIeet-config\fP is a tool that is used by configure to determine the
availability of eet and the compiler and linker flags that should be used to
compile programs using it.
.SH OPTIONS
\fIeet-config\fP accepts the following options:
.TP
.B \-\-version
Print the currently installed version of \fIeet\fP on the standard output.
.TP
.B \-\-libs
Print the linker flags that are necessary to link a \fIeet\fP\-program.
.TP
.B \-\-cflags
Print the compiler flags that are necessary to link a \fIeet\fP\-program.
.SH SEE ALSO
.BR eet (1).
.SH AUTHOR
This manual page was written by Sytse Wielinga
<s.b.wielinga@student.utwente.nl> for the Debian GNU/Linux system (but may be
used by others).

@ -0,0 +1,61 @@
.\" Hey, EMACS: -*- nroff -*-
.TH EET 1 "oktober 3, 2002"
.SH NAME
eet \- program for editing eet files
.SH SYNOPSIS
.B eet
-l in_file
.br
.B eet
-d in_file
.br
.B eet
-c out_file [-nz glob [-nz glob ...]] dir_file1 [dir_file2 ...]
.SH DESCRIPTION
This manual page documents briefly the
.B eet
command.
This manual page was written for the Debian distribution
because the original program does not have a manual page.
.PP
.B eet
is a program for viewing, unpacking and adding files to eet files, which are
containers for optionally compressed data, allowing for fast random-access
reading. These files are mostly used by the enlightenment project. See
.B www.enlightenment.org
for more details about this project.
.SH OPTIONS
.TP
.B \-l in_file
List the contents of an eet file
.TP
.B \-d in_file
Unpack an eet file
.TP
.B \-c out_file
Create an eet file
.TP
.B \-nz match
Store files matching match glob uncompressed
.SH SEE ALSO
.BR eet-config (1).
.PP
For more information, have a look at the sources of libeet. To get them, have
a look at the website
.B www.enlightenment.org
or execute the following commands:
.TP
.B export CVSROOT=:pserver:anonymous@cvs.enlightenment.sourceforge.net:/cvsroot/enlightenment
If this is command is broken among multiple lines because your terminal is not
as wide as the command, please don't include the minus sign into the command.
.TP
.B cvs login
Just hit enter if it asks about a password for anonymous.
.TP
.B cvs co -r SPLIT e17/libs/eet
This command should create the directory e17/libs/eet, containing the latest
sources of eet.
.SH AUTHOR
This manual page was written by Sytse Wielinga
<s.b.wielinga@student.utwente.nl> for the Debian GNU/Linux system (but may be
used by others).

@ -0,0 +1,4 @@
usr/bin/eet-config
usr/include/*
usr/lib/lib*.a
usr/lib/lib*.so

@ -0,0 +1,2 @@
usr/bin/eet
usr/lib/lib*.so.*

@ -0,0 +1,74 @@
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
# This is the debhelper compatibility version to use.
export DH_COMPAT=3
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
CFLAGS += -g
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
INSTALL_PROGRAM += -s
endif
version=`ls src/.libs/lib*.so.* | \
awk '{if (match($$0,/[0-9]+\.[0-9]+\.[0-9]+$$/)) print substr($$0,RSTART)}'`
major=`ls src/.libs/lib*.so.* | \
awk '{if (match($$0,/\.so\.[0-9]+$$/)) print substr($$0,RSTART+4)}'`
build: build-stamp
build-stamp:
dh_testdir
./configure --prefix=/usr build
touch build-stamp
clean:
dh_testdir
dh_testroot
rm -f build-stamp
-./configure clean
dh_clean
install: build
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs
./configure --prefix=$(CURDIR)/debian/tmp/usr install
binary-indep: build install
binary-arch: build install
dh_testdir
dh_testroot
dh_movefiles
dh_installdocs -plibeet0 README AUTHORS
dh_installdocs -plibeet0-dev
dh_installman -plibeet0 debian/eet.1
dh_installman -plibeet0-dev debian/eet-config.1
dh_installchangelogs
dh_link
dh_strip
dh_compress
dh_fixperms
dh_makeshlibs
dh_installdeb
dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install

@ -0,0 +1,59 @@
#!/bin/sh
prefix=@prefix@
exec_prefix=@exec_prefix@
exec_prefix_set=no
usage="\
Usage: evas-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--libs] [--cflags]"
if test $# -eq 0; then
echo "${usage}" 1>&2
exit 1
fi
while test $# -gt 0; do
case "$1" in
-*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
*) optarg= ;;
esac
case $1 in
--prefix=*)
prefix=$optarg
if test $exec_prefix_set = no ; then
exec_prefix=$optarg
fi
;;
--prefix)
echo $prefix
;;
--exec-prefix=*)
exec_prefix=$optarg
exec_prefix_set=yes
;;
--exec-prefix)
echo $exec_prefix
;;
--version)
echo @VERSION@
;;
--cflags)
if test @includedir@ != /usr/include ; then
includes=-I@includedir@
fi
echo $includes
;;
--libs)
libdirs=-L@libdir@
echo $libdirs -leet -ljpeg -lz
;;
*)
echo "${usage}" 1>&2
exit 1
;;
esac
shift
done
exit 0

@ -0,0 +1,63 @@
# Note that this is NOT a relocatable package
%define ver 0.0.1
%define rel 1
%define prefix /usr/local
Summary: eet
Name: eet
Version: %ver
Release: %rel
Copyright: BSD
Group: Base/Group
Source: ftp://ftp.enlightenment.org/pub/eet/eet-%{ver}.tar.gz
BuildRoot: /var/tmp/eet-root
Packager: The Rasterman <raster@rasterman.com>
URL: http://www.enlightenment.org/
Requires: libjpeg
Requires: zlib
Docdir: %{prefix}/doc
%description
Eet
%prep
%setup
%build
./configure --prefix=%prefix
if [ "$SMP" != "" ]; then
(make "MAKE=make -k -j $SMP"; exit 0)
make
else
make
fi
###########################################################################
%install
rm -rf $RPM_BUILD_ROOT
make prefix=$RPM_BUILD_ROOT%{prefix} install
%clean
rm -rf $RPM_BUILD_ROOT
%post
%postun
%files
%defattr(-,root,root)
%doc README COPYING ChangeLog
%attr(755,root,root) %{prefix}/bin/*
%attr(755,root,root) %{prefix}/lib/*
%{prefix}/share/*
%doc AUTHORS
%doc COPYING
%doc README
%changelog
* Sat Jun 23 2001 The Rasterman <raster@rasterman.com>
- Created spec file

@ -0,0 +1,3 @@
eet
eet-config
libeet.so.0.0.0

@ -0,0 +1,3 @@
## Process this file with automake to produce Makefile.in
SUBDIRS = lib bin

@ -0,0 +1,3 @@
eet
eet-config
libeet.so.0.0.0

@ -0,0 +1,12 @@
## Process this file with automake to produce Makefile.in
INCLUDES = \
-I../lib
bin_PROGRAMS = eet
eet_SOURCES = \
eet_main.c
eet_LDADD = $(top_builddir)/src/lib/libeet.la
eet_DEPENDANCIES = $(top_builddir)/src/lib/libeet.la

@ -0,0 +1,420 @@
#include "Eet.h"
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <dirent.h>
#include <limits.h>
#include <fnmatch.h>
/* just some sample code on how to use encoder/decoders */
#if 0
#include <Evas.h>
typedef struct _blah2
{
char *string;
}
Blah2;
typedef struct _blah3
{
char *string;
}
Blah3;
typedef struct _blah
{
char character;
short sixteen;
int integer;
long long lots;
float floating;
double floating_lots;
char *string;
Blah2 *blah2;
Evas_List *blah3;
}
Blah;
void
encdectest(void)
{
Blah blah;
Blah2 blah2;
Blah3 blah3;
Eet_Data_Descriptor *edd, *edd2, *edd3;
void *data;
int size;
FILE *f;
Blah *blah_in;
edd3 = eet_data_descriptor_new("blah3", sizeof(Blah3),
evas_list_next,
evas_list_append,
evas_list_data,
evas_hash_foreach,
evas_hash_add);
EET_DATA_DESCRIPTOR_ADD_BASIC(edd3, Blah3, "string3", string, EET_T_STRING);
edd2 = eet_data_descriptor_new("blah2", sizeof(Blah2),
evas_list_next,
evas_list_append,
evas_list_data,
evas_hash_foreach,
evas_hash_add);
EET_DATA_DESCRIPTOR_ADD_BASIC(edd2, Blah2, "string2", string, EET_T_STRING);
edd = eet_data_descriptor_new("blah", sizeof(Blah),
evas_list_next,
evas_list_append,
evas_list_data,
evas_hash_foreach,
evas_hash_add);
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Blah, "character", character, EET_T_CHAR);
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Blah, "sixteen", sixteen, EET_T_SHORT);
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Blah, "integer", integer, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Blah, "lots", lots, EET_T_LONG_LONG);
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Blah, "floating", floating, EET_T_FLOAT);
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Blah, "floating_lots", floating_lots, EET_T_DOUBLE);
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Blah, "string", string, EET_T_STRING);
EET_DATA_DESCRIPTOR_ADD_SUB (edd, Blah, "blah2", blah2, edd2);
EET_DATA_DESCRIPTOR_ADD_LIST (edd, Blah, "blah3", blah3, edd3);
blah3.string="PANTS";
blah2.string="subtype string here!";
blah.character='7';
blah.sixteen=0x7777;
blah.integer=0xc0def00d;
blah.lots=0xdeadbeef31337777;
blah.floating=3.141592654;
blah.floating_lots=0.777777777777777;
blah.string="bite me like a turnip";
blah.blah2 = &blah2;
blah.blah3 = evas_list_append(NULL, &blah3);
blah.blah3 = evas_list_append(blah.blah3, &blah3);
blah.blah3 = evas_list_append(blah.blah3, &blah3);
blah.blah3 = evas_list_append(blah.blah3, &blah3);
blah.blah3 = evas_list_append(blah.blah3, &blah3);
blah.blah3 = evas_list_append(blah.blah3, &blah3);
blah.blah3 = evas_list_append(blah.blah3, &blah3);
data = eet_data_descriptor_encode(edd, &blah, &size);
f = fopen("out", "w");
if (f)
{
fwrite(data, size, 1, f);
fclose(f);
}
printf("-----DECODING\n");
blah_in = eet_data_descriptor_decode(edd, data, size);
printf("-----DECODED!\n");
printf("%c\n", blah_in->character);
printf("%x\n", (int)blah_in->sixteen);
printf("%x\n", blah_in->integer);
printf("%lx\n", blah_in->lots);
printf("%f\n", (double)blah_in->floating);
printf("%f\n", (double)blah_in->floating_lots);
printf("%s\n", blah_in->string);
printf("%p\n", blah_in->blah2);
printf(" %s\n", blah_in->blah2->string);
{
Evas_List *l;
for (l = blah_in->blah3; l; l = l->next)
{
Blah3 *blah3_in;
blah3_in = l->data;
printf("%p\n", blah3_in);
printf(" %s\n", blah3_in->string);
}
}
eet_data_descriptor_free(edd);
eet_data_descriptor_free(edd2);
eet_data_descriptor_free(edd3);
exit(0);
}
#endif
int eet_mkdir(char *dir);
void eet_mkdirs(char *s);
void depak_file(Eet_File *ef, char *file);
void depack(char *pak_file);
void list(char *pak_file);
void pak_file(Eet_File *ef, char *file, char **noz, int noz_num);
void pak_dir(Eet_File *ef, char *dir, char **noz, int noz_num);
void pack(char *pak_file, char **files, int count, char **noz, int noz_num);
static mode_t default_mode =
S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH;
int
eet_mkdir(char *dir)
{
if (mkdir(dir, default_mode) < 0) return 0;
return 1;
}
void
eet_mkdirs(char *s)
{
char ss[PATH_MAX];
int i, ii;
i = 0;
ii = 0;
while (s[i])
{
ss[ii++] = s[i];
ss[ii] = 0;
if (s[i] == '/') eet_mkdir(ss);
i++;
}
}
void
depak_file(Eet_File *ef, char *file)
{
void *data;
int size;
char *last;
data = eet_read(ef, file, &size);
if (data)
{
FILE *f;
char buf[PATH_MAX];
strcpy(buf, file);
last = strrchr(buf, '/');
if (last)
{
last[1] = 0;
eet_mkdirs(buf);
}
f = fopen(file, "w");
if (f)
{
fwrite(data, 1, size, f);
fclose(f);
printf("exported: %s\n", file);
}
else
printf("error exporting: %s\n", file);
free(data);
}
else
{
printf("error reading: %s\n", file);
}
}
void
depack(char *pak_file)
{
int i, num;
char **list;
Eet_File *ef;
ef = eet_open(pak_file, EET_FILE_MODE_READ);
if (!ef)
{
printf("cannot open for reading: %s\n", pak_file);
return;
}
list = eet_list(ef, "*", &num);
if (list)
{
for (i = 0; i < num; i++)
depak_file(ef, list[i]);
free(list);
}
eet_close(ef);
}
void
list(char *pak_file)
{
int i, num;
char **list;
Eet_File *ef;
ef = eet_open(pak_file, EET_FILE_MODE_READ);
if (!ef)
{
printf("cannot open for reading: %s\n", pak_file);
return;
}
list = eet_list(ef, "*", &num);
if (list)
{
for (i = 0; i < num; i++)
printf("%s\n",list[i]);
free(list);
}
eet_close(ef);
}
void
pak_file(Eet_File *ef, char *file, char **noz, int noz_num)
{
struct stat st;
if (stat(file, &st) >= 0)
{
void *buf;
buf = malloc(st.st_size);
if (buf)
{
FILE *f;
f = fopen(file, "r");
if (f)
{
int compress = 1;
int i;
for (i = 0; i < noz_num; i++)
{
if (!fnmatch(noz[i], file, 0))
{
compress = 0;
break;
}
}
fread(buf, 1, st.st_size, f);
if (!eet_write(ef, file, buf, st.st_size, compress))
printf("error importing: %s\n", file);
else
{
if (compress)
printf("compress: %s\n", file);
else
printf("imported: %s\n", file);
}
fclose(f);
}
free(buf);
}
}
}
void
pak_dir(Eet_File *ef, char *dir, char **noz, int noz_num)
{
DIR *dirp;
struct dirent *dp;
dirp = opendir(dir);
if (!dirp)
pak_file(ef, dir, noz, noz_num);
else
{
while ((dp = readdir(dirp)))
{
char buf[PATH_MAX];
if ((!strcmp(".", dp->d_name)) || (!strcmp("..", dp->d_name)))
{
}
else
{
snprintf(buf, sizeof(buf), "%s/%s", dir, dp->d_name);
pak_dir(ef, buf, noz, noz_num);
}
}
}
}
void
pack(char *pak_file, char **files, int count, char **noz, int noz_num)
{
Eet_File *ef;
int i;
ef = eet_open(pak_file, EET_FILE_MODE_WRITE);
if (!ef)
{
printf("cannot open for writing: %s\n", pak_file);
return;
}
for (i = 0; i < count; i++) pak_dir(ef, files[i], noz, noz_num);
printf("done.\n");
eet_close(ef);
}
int
main(int argc, char **argv)
{
if (argc == 3)
{
if (!strcmp(argv[1], "-d"))
{
depack(argv[2]);
return 0;
}
else if (!strcmp(argv[1], "-l"))
{
list(argv[2]);
return 0;
}
}
else if (argc > 3)
{
char **noz = NULL;
int noz_num = 0;
if (!strcmp(argv[1], "-c"))
{
int i;
for (i = 3; i < argc; i++)
{
if (!strcmp(argv[i], "-nz"))
{
if (i < (argc - 1))
{
i++;
noz_num++;
noz = realloc(noz, noz_num * sizeof(char *));
noz[noz_num - 1] = argv[i];
}
}
else
break;
}
pack(argv[2], &(argv[i]), argc - i, noz, noz_num);
return 0;
}
}
printf("usage:\n"
" %s -l in_file\n"
" %s -d in_file\n"
" %s -c out_file [-nz glob [-nz glob ...]] dir_file1 [dir_file2 ...]\n"
"\n"
"where:\n"
" -l in_file list contents of eet file\n"
" -d in_file unpack eet file\n"
" -c out_file pack up eet file\n"
" -nz match don't compress files matching match glob\n"
"\n"
"example:\n"
" %s -c out.eet -nz \"*.jpg\" things/\n"
" %s -l out.eet\n"
" %s -d out.eet\n",
argv[0], argv[0], argv[0],
argv[0], argv[0], argv[0]);
return -1;
}

@ -0,0 +1,3 @@
eet
eet-config
libeet.so.0.0.0

@ -0,0 +1,268 @@
#ifndef _EET_H
#define _EET_H
/***************************************************************************/
/*
* EET - E file chunk reading/writing library
*
* What is it?
* It is a tiny library designed to write an arbitary set of chunks of data
* to a file and optionally compress each chunk (very much like a zip file)
* and allow fast random-access reading of the file later on. It does not
* do zip as zip itself has more complexity than we need, and it was much
* simpler to impliment this once here.
*
*/
/***************************************************************************/
#ifdef __cplusplus
extern "C" {
#endif
/***************************************************************************/
#define EET_T_UNKNOW 0
#define EET_T_CHAR 1
#define EET_T_SHORT 2
#define EET_T_INT 3
#define EET_T_LONG_LONG 4
#define EET_T_FLOAT 5
#define EET_T_DOUBLE 6
#define EET_T_UCHAR 7
#define EET_T_USHORT 8
#define EET_T_UINT 9
#define EET_T_ULONG_LONG 10
#define EET_T_STRING 11
#define EET_T_LAST 12
#define EET_G_UNKNOWN 100
#define EET_G_ARRAY 101
#define EET_G_VAR_ARRAY 102
#define EET_G_LIST 103
#define EET_G_HASH 104
#define EET_G_LAST 105
/***************************************************************************/
enum _Eet_File_Mode
{
EET_FILE_MODE_READ,
EET_FILE_MODE_WRITE
};
typedef enum _Eet_File_Mode Eet_File_Mode;
typedef struct _Eet_File Eet_File;
typedef struct _Eet_Data_Descriptor Eet_Data_Descriptor;
/***************************************************************************/
/* eet_open - Open an eet file on disk, and returns a handle to it.
* @file: The file path to the eet file. eg: "/tmp/file.eet".
* @mode: The mode for opening. Either EET_FILE_MODE_READ or EET_FILE_MODE_WRITE, but not both.
*
* This function will open an exiting eet file for reading, and build
* the directory table in memory and return a handle to the file, if it
* exists and can be read, and no memory errors occur on the way, otherwise
* NULL will be returned.
*
* It will also open an eet file for writing. This will, if successful,
* delete the original file and replace it with a new empty file, till
* the eet file handle is closed or flushed. If it cannot be opened for
* writing or a memory error occurs, NULL is returned.
*/
Eet_File *eet_open (char *file, Eet_File_Mode mode);
/* eet_close - Close an eet file handle and flush and writes pending.
* @ef: A valid eet file handle.
*
* This function will flush any pending writes to disk if the eet file
* was opened for write, and free all data associated with the file handle
* and file, and close the file.
*
* If the eet file handle is not valid nothing will be done.
*/
void eet_close (Eet_File *ef);
/* eet_read - Read a specified entry from an eet file and return data
* @ef: A valid eet file handle opened for reading.
* @name: Name of the entry. eg: "/base/file_i_want".
* @size_ret: Number of bytes read from entry and returned.
*
* This function finds an entry in the eet file that is stored under the
* name specified, and returns that data, decompressed, if successfule.
* NULL is retuurned if the lookup fails or if memory errors are
* encountered. It is the job of the calling program to call free() on
* the returned data. The number of bytes in the returned data chunk are
* placed in size_ret.
*
* If the eet file handle is not valid NULl is returned and size_ret is
* filled with 0.
*/
void *eet_read (Eet_File *ef, char *name, int *size_ret);
/* eet_write - Write a specified entry to an eet file handle
* @ef: A valid eet file handle opened for writing.
* @name: Name of the entry. eg: "/base/file_i_want".
* @data: Pointer to the data to be stored.
* @size: Length in bytes in the data to be stored.
* @compress: Compression flags (1 == compress, 0 = don't compress).
*
* This function will write the specified chunk of data to the eet file
* and return 1 on success. 0 will be returned on failure.
*
* The eet file handle must be a valid file handle for an eet file opened
* for writing. If it is not, 0 will be returned and no action will be
* performed.
*
* Name, and data must not be NULL, and size must be > 0. If these
* conditions are not met, 0 will be returned.
*
* The data will be copied (and optionally compressed) in ram, pending
* a flush to disk (it will stay in ram till the eet file handle is
* closed though).
*/
int eet_write (Eet_File *ef, char *name, void *data, int size, int compress);
/* eet_list - List all entries in eet file matching shell glob.
* @ef: A valid eet file handle.
* @glob: A shell glob to match against.
* @count_ret: number of entries foudn to match.
*
* This function will list all entries in the eet file matching the
* supplied shell glob and return an allocated list of their names, if
* there are any, and if no memory errors occur.
*
* The eet file handle must be valid and glob must not be NULL, or NULL
* will be returned and count_ret will be filled with 0.
*
* The calling program must call free() on the array returned, but NOT
* on the string pointers in the array. They are taken as read-only
* internals from the eet file handle. They are only valid as long as
* the file handle is not closed. When it is closed those pointers in the
* array are now not valid and should not be used.
*
* On success the array returned will have a list of string pointers
* that are the names of the entries that matched, and count_ret will have
* the number of entries in this array placed in it.
*
* Hint: an easy way to list all entries in an eet file is to use a glob
* value of "*".
*/
char **eet_list (Eet_File *ef, char *glob, int *count_ret);
/***************************************************************************/
/* eet_data_image_read - Read image data from the named key in the eet file.
* @ef: A valid eet file handle opened for reading.
* @name: Name of the entry. eg: "/base/file_i_want".
* @w: A pointer to the int to hold the width in pixels.
* @h: A pointer to the int to hold the height in pixels.
* @alpha: A pointer to the int to hold the alpha flag.
* @compress: A pointer to the int to hold the compression amount.
* @quality: A pointer to the int to hold the quality amount.
* @lossy: A pointer to the int to hold the lossiness flag.
*
* This function reads an image from an eet file stored under the named
* key in the eet file and return a pointer to the decompressed pixel data.
*
* The other parameters of the image (width, height etc.) are placed into
* the values pointed to (they must be supplied). The pixel data is a linear
* array of pixels starting from the top-left of the image scanning row by
* row from left to right. Each piel is a 32bit value, with the high byte
* being the alpha channel, the next being red, then green, and the low byte
* being blue. The width and height are measured in pixels and will be
* greater than 0 when returned. The alpha flag is either 0 or 1. 0 denotes
* that the alpha channel is not used. 1 denoties that it is significant.
* Compress is fiulled with the compression value/amount the image was
* stored with. The quality value si fileld with the quality encoding of
* the image file (0 - 100). The lossy flags is either 0 or 1 as to if
* the image was encoded lossily or not.
*
* On success the function returns a pointer to the image data decoded. The
* calling application is responsible for calling free() on the image data
* when it is done with it. On failure NULL is returned and the parameter
* values may not contain any sensible data.
*/
void *eet_data_image_read(Eet_File *ef, char *name, int *w, int *h, int *alpha, int *compress, int *quality, int *lossy);
/* eet_data_image_write - Write image data to the named key in an eet file.
* @ef: A valid eet file handle opened for writing.
* @name: Name of the entry. eg: "/base/file_i_want".
* @data: A pointer to the image pixel data.
* @w: The width of the image in pixels.
* @h: The height of the image in pixels.
* @alpha: The alpha channel flag.
* @compress: The compression amount.
* @quality: The quality encoding amount.
* @lossy: The lossiness flag.
*
* This function dates image pixel data and encodes it in an eet file
* stored under the supplied name key, and returns how many bytes were
* actually written to encode the image data.
*
* The data expected is the same format as returned by eet_data_image_read.
* If this is not the case wierd things may happen. Width and height must
* be between 1 and 8000 pixels. The alpha flags can be 0 or 1 (0 meaning
* the alpha values are not useful and 1 meaning they are). Compress can
* be from 0 to 9 (0 meaning no compression, 9 meaning full compression).
* This is only used if the image is not lossily encoded. Quality is used on
* lossy compression and shoudl be a value from 0 to 100. The lossy flag
* can be 0 or 1. 0 means encode losslessly and 1 means to encode with
* image quality loss (but then have a much smaller encoding).
*
* On success this function rtuens the numebr fo bytes that were required
* to encode the image data, or on failure it returns 0.
*/
int eet_data_image_write(Eet_File *ef, char *name, void *data, int w, int h, int alpha, int compress, int quality, int lossy);
/* To Be Documented
*
*/
void *eet_data_image_encode(void *data, int *size_ret, int w, int h, int alpha, int compress, int quality, int lossy);
void *eet_data_image_decode(void *data, int size, int *w, int *h, int *alpha, int *compress, int *quality, int *lossy);
/***************************************************************************/
/* To Be Documented
*
*/
Eet_Data_Descriptor *eet_data_descriptor_new(char *name, int size, void *(*func_list_next) (void *l), void *(*func_list_append) (void *l, void *d), void *(*func_list_data) (void *l), void (*func_hash_foreach) (void *h, int (*func) (void *h, const char *k, void *dt, void *fdt), void *fdt), void *(*func_hash_add) (void *h, const char *k, void *d));
void eet_data_descriptor_free(Eet_Data_Descriptor *edd);
void eet_data_descriptor_element_add(Eet_Data_Descriptor *edd, char *name, int type, int group_type, int offset, int count, char *counter_name, Eet_Data_Descriptor *subtype);
void *eet_data_read(Eet_File *ef, Eet_Data_Descriptor *edd, char *name);
int eet_data_write(Eet_File *ef, Eet_Data_Descriptor *edd, char *name, void *data, int compress);
void *eet_data_descriptor_decode(Eet_Data_Descriptor *edd, void *data_in, int size_in);
void *eet_data_descriptor_encode(Eet_Data_Descriptor *edd, void *data_in, int *size_ret);
#define EET_DATA_DESCRIPTOR_ADD_BASIC(edd, struct_type, name, member, type) \
{ \
struct_type ___ett; \
\
eet_data_descriptor_element_add(edd, name, type, EET_G_UNKNOWN, \
(char *)(&(___ett.member)) - (char *)(&(___ett)), \
0, NULL, NULL); \
}
#define EET_DATA_DESCRIPTOR_ADD_SUB(edd, struct_type, name, member, subtype) \
{ \
struct_type ___ett; \
\
eet_data_descriptor_element_add(edd, name, EET_T_UNKNOW, EET_G_UNKNOWN, \
(char *)(&(___ett.member)) - (char *)(&(___ett)), \
0, NULL, subtype); \
}
#define EET_DATA_DESCRIPTOR_ADD_LIST(edd, struct_type, name, member, subtype) \
{ \
struct_type ___ett; \
\
eet_data_descriptor_element_add(edd, name, EET_T_UNKNOW, EET_G_LIST, \
(char *)(&(___ett.member)) - (char *)(&(___ett)), \
0, NULL, subtype); \
}
/***************************************************************************/
#ifdef __cplusplus
}
#endif
#endif

@ -0,0 +1,20 @@
## Process this file with automake to produce Makefile.in
AUTOMAKE_OPTIONS = 1.4 foreign
# A list of all the files in the current directory which can be regenerated
MAINTAINERCLEANFILES = Makefile.in