Skip to content

Commit

Permalink
Merge branch 'liblrzip' of github.com:ckolivas/lrzip into liblrzip
Browse files Browse the repository at this point in the history
Conflicts:
	rzip.c
  • Loading branch information
ckolivas committed Mar 7, 2012
2 parents ef07687 + 9131188 commit a62e781
Show file tree
Hide file tree
Showing 20 changed files with 2,698 additions and 1,074 deletions.
31 changes: 26 additions & 5 deletions Makefile.am
Expand Up @@ -23,20 +23,21 @@ m4/ltversion.m4

SUBDIRS = lzma man doc

AM_CFLAGS = -I lzma/C -DNDEBUG
AM_CFLAGS = -I. -I lzma/C -DNDEBUG
AM_CXXFLAGS = $(AM_CFLAGS)

lrztardir = $(bindir)
lrztar_SCRIPTS = lrztar

bin_PROGRAMS = lrzip
lrzip_SOURCES = \
noinst_LTLIBRARIES = libtmplrzip.la
libtmplrzip_la_SOURCES = \
zpipe.cpp \
zpipe.h \
lrzip_private.h \
liblrzip_private.h \
liblrzip.h \
lrzip.c \
lrzip.h \
main.c \
rzip.h \
rzip.c \
runzip.c \
Expand All @@ -51,12 +52,32 @@ lrzip_SOURCES = \
aes.h \
sha4.c \
sha4.h
libtmplrzip_la_LIBADD = lzma/C/liblzma.la


lrzip_LDADD = lzma/C/liblzma.la
lib_LTLIBRARIES = liblrzip.la
liblrzip_la_SOURCES = \
liblrzip.c
nodist_EXTRA_liblrzip_la_SOURCES = dummy.cxx
liblrzip_la_LIBADD = libtmplrzip.la

bin_PROGRAMS = lrzip
lrzip_SOURCES = \
main.c
nodist_EXTRA_lrzip_SOURCES = dummyy.cxx

lrzip_LDADD = libtmplrzip.la
if STATIC
lrzip_LDFLAGS = -all-static
endif

noinst_PROGRAMS = decompress_demo liblrzip_demo
decompress_demo_SOURCES = decompress_demo.c
decompress_demo_LDADD = liblrzip.la

liblrzip_demo_SOURCES = liblrzip_demo.c
liblrzip_demo_LDADD = liblrzip.la

dist_doc_DATA = \
AUTHORS \
BUGS \
Expand Down
10 changes: 5 additions & 5 deletions aes.c
Expand Up @@ -61,10 +61,10 @@
* Forward S-box & tables
*/
static unsigned char FSb[256];
static unsigned long FT0[256];
static unsigned long FT1[256];
static unsigned long FT2[256];
static unsigned long FT3[256];
static unsigned long FT0[256];
static unsigned long FT1[256];
static unsigned long FT2[256];
static unsigned long FT3[256];

/*
* Reverse S-box & tables
Expand Down Expand Up @@ -501,7 +501,7 @@ int aes_crypt_cbc( aes_context *ctx,
{
if( padlock_xcryptcbc( ctx, mode, length, iv, input, output ) == 0 )
return( 0 );

// If padlock data misaligned, we just fall back to
// unaccelerated mode
//
Expand Down
1 change: 1 addition & 0 deletions configure.ac
Expand Up @@ -52,6 +52,7 @@ AC_PROG_INSTALL
AC_PROG_LN_S
AC_SUBST(SHELL)
AC_SYS_LARGEFILE
AC_FUNC_ALLOCA

AC_CHECK_PROG([HAVE_POD2MAN], [pod2man], [yes])
AS_IF([test "$HAVE_POD2MAN" != "yes"],
Expand Down
41 changes: 41 additions & 0 deletions decompress_demo.c
@@ -0,0 +1,41 @@
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#undef NDEBUG
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <liblrzip.h>

static const char *suffix_me(const char *file)
{
const char *p;
static char buf[4096];

p = strrchr(file, '.');
if (p && (strlen(p + 1) < 4))
strncat(buf, file, p - file);
else
strcat(buf, file);
return &buf[0];
}

int main(int argc, char *argv[])
{
Lrzip *lr;
if ((argc != 2) && (argc != 3)) {
fprintf(stderr, "Usage: %s file [outfile]\n", argv[0]);
exit(1);
}
lr = lrzip_new(LRZIP_MODE_DECOMPRESS);
assert(lr);
lrzip_config_env(lr);
assert(lrzip_filename_add(lr, argv[1]));
if (argc == 2)
lrzip_outfilename_set(lr, suffix_me(argv[1]));
else
lrzip_outfilename_set(lr, argv[2]);
assert(lrzip_run(lr));
return 0;
}

0 comments on commit a62e781

Please sign in to comment.