Commit Graph

31 Commits

Author SHA1 Message Date
Lasse Collin ebfb2c5e1f Use a tuklib module for integer handling.
This replaces bswap.h and integer.h.

The tuklib module uses <byteswap.h> on GNU,
<sys/endian.h> on *BSDs and <sys/byteorder.h>
on Solaris, which may contain optimized code
like inline assembly.
2009-10-04 22:57:12 +03:00
Lasse Collin db9119b918 Work around a bug in Interix header files.
Thanks to Markus Duft for the patch.
2009-09-27 11:48:54 +03:00
Lasse Collin 4c3630ec41 Avoid non-standard preprocessor construct.
Thanks to Jouk Jansen.
2009-09-22 13:40:19 +03:00
Lasse Collin 0deb1bb60a Make sure that TUKLIB_DOSLIKE doesn't get defined on Cygwin.
Thanks to Charles Wilson.
2009-09-21 19:50:09 +03:00
Lasse Collin e599bba421 Various changes.
Separate a few reusable components from XZ Utils specific
code. The reusable code is now in "tuklib" modules. A few
more could be separated still, e.g. bswap.h.

Fix some bugs in lzmainfo.

Fix physmem and cpucores code on OS/2. Thanks to Elbert Pol
for help.

Add OpenVMS support into physmem. Add a few #ifdefs to ease
building XZ Utils on OpenVMS. Thanks to Jouk Jansen for the
original patch.
2009-09-19 09:47:30 +03:00
Lasse Collin 429910b2ba Add OS/2-specific code to physmem.h.
Also move DJGPP-specific code near the code meant
for other DOS-like systems.
2009-09-05 18:39:21 +03:00
Lasse Collin 60ccb80c9c Use sysctl() != -1 instead of !sysctl() to check if
the function call succeeded.

NetBSD 4.0 returns positive values on success, but
NetBSD Current and FreeBSD return zero. OpenBSD's
man page doesn't tell what sysctl() returns on
success. All these BSDs return -1 on error.

Thanks to Robert Elz and Thomas Klausner.
2009-09-05 01:20:29 +03:00
Lasse Collin 27414daadf Fix sysctl() usage.
This fixes build on *BSDs and Darwin.

Thanks to Jukka Salmi for the patches.
Richard Koch reported the problem too.
2009-08-29 13:39:21 +03:00
Lasse Collin 64e498c89d Added public domain notice into a few files. 2009-07-18 11:26:39 +03:00
Lasse Collin 73f560ee5f Make physmem() work on Cygwin 1.5 and older. 2009-06-27 22:57:15 +03:00
Lasse Collin 7ff0004fbc Moved the Windows resource files outside the windows directory
to prepare for building them with Autotools.
2009-06-27 17:28:01 +03:00
Lasse Collin b317b218e2 Support HW_PHYSMEM64 2009-06-24 20:14:10 +03:00
Lasse Collin 02ddf09bc3 Put the interesting parts of XZ Utils into the public domain.
Some minor documentation cleanups were made at the same time.
2009-04-13 11:27:40 +03:00
Lasse Collin 390e69887f Fix wrong macro names in lc_cpucores.m4 and cpucores.h.
Thanks to Bert Wesarg.
2009-03-18 16:51:41 +02:00
Lasse Collin 7494816ab0 Make physmem.h work on old Windows versions.
Thanks to Hongbo Ni for the original patch.
2009-02-15 15:48:45 +02:00
Lasse Collin 3084d662d2 Cleanups to the code that detects the amount of RAM and
the number of CPU cores. Added support for using sysinfo()
on Linux systems whose libc lacks appropriate sysconf()
support (at least dietlibc). The Autoconf macros were
split into separate files, and CPU core count detection
was moved from hardware.c to cpucores.h. The core count
isn't used for anything real for now, so a problematic
part in process.c was commented out.
2009-02-14 00:45:29 +02:00
Lasse Collin 96c46df7de Improve support for DOS-like systems.
Here DOS-like means DOS, Windows, and OS/2.
2009-02-13 17:29:02 +02:00
Lasse Collin 53f7598998 Fix aliasing issue in physmem.h. 2009-02-08 21:35:11 +02:00
Lasse Collin 75905a9afc Various code cleanups the the xz command line tool.
It now builds with MinGW.
2009-02-05 09:12:57 +02:00
Lasse Collin 6a2eb54092 Add LZMA_API to liblzma API headers. It's useful at least
on Windows. sysdefs.h no longer #includes lzma.h, so lzma.h
has to be #included separately where needed.
2009-01-31 11:01:48 +02:00
Lasse Collin 8286a60b8f Use pthread_sigmask() instead of sigprocmask() when pthreads
are enabled.
2009-01-07 18:41:15 +02:00
Lasse Collin 7ed9d943b3 Remove lzma_init() and other init functions from liblzma API.
Half of developers were already forgetting to use these
functions, which could have caused total breakage in some future
liblzma version or even now if --enable-small was used. Now
liblzma uses pthread_once() to do the initializations unless
it has been built with --disable-threads which make these
initializations thread-unsafe.

When --enable-small isn't used, liblzma currently gets needlessly
linked against libpthread (on systems that have it). While it is
stupid for now, liblzma will need threads in future anyway, so
this stupidity will be temporary only.

When --enable-small is used, different code CRC32 and CRC64 is
now used than without --enable-small. This made the resulting
binary slightly smaller, but the main reason was to clean it up
and to handle the lack of lzma_init_check().

The pkg-config file lzma.pc was renamed to liblzma.pc. I'm not
sure if it works correctly and portably for static linking
(Libs.private includes -pthread or other operating system
specific flags). Hopefully someone complains if it is bad.

lzma_rc_prices[] is now included as a precomputed array even
with --enable-small. It's just 128 bytes now that it uses uint8_t
instead of uint32_t. Smaller array seemed to be at least as fast
as the more bloated uint32_t array on x86; hopefully it's not bad
on other architectures.
2008-12-31 00:30:49 +02:00
Lasse Collin e114502b2b Oh well, big messy commit again. Some highlights:
- Updated to the latest, probably final file format version.
  - Command line tool reworked to not use threads anymore.
    Threading will probably go into liblzma anyway.
  - Memory usage limit is now about 30 % for uncompression
    and about 90 % for compression.
  - Progress indicator with --verbose
  - Simplified --help and full --long-help
  - Upgraded to the last LGPLv2.1+ getopt_long from gnulib.
  - Some bug fixes
2008-11-19 20:46:52 +02:00
Lasse Collin 962f2231d4 Fix a compiler error on big endian systems that don't
support unaligned memory access.
2008-09-11 10:48:12 +03:00
Lasse Collin 3b34851de1 Sort of garbage collection commit. :-| Many things are still
broken. API has changed a lot and it will still change a
little more here and there. The command line tool doesn't
have all the required changes to reflect the API changes, so
it's easy to get "internal error" or trigger assertions.
2008-08-28 22:53:15 +03:00
Lasse Collin 7d17818cec Update the code to mostly match the new simpler file format
specification. Simplify things by removing most of the
support for known uncompressed size in most places.
There are some miscellaneous changes here and there too.

The API of liblzma has got many changes and still some
more will be done soon. While most of the code has been
updated, some things are not fixed (the command line tool
will choke with invalid filter chain, if nothing else).

Subblock filter is somewhat broken for now. It will be
updated once the encoded format of the Subblock filter
has been decided.
2008-06-18 18:02:10 +03:00
Lasse Collin ed6664146f Remove support for pre-C89 libc versions that lack memcpy,
memmove, and memset.
2008-05-11 14:24:42 +03:00
Lasse Collin 19389f2b82 Added ARRAY_SIZE(array) macro. 2008-01-16 14:31:44 +02:00
Lasse Collin e2417b2b91 More pre-C99 inttypes.h compatibility fixes. Now the code
should work even if the system has no inttypes.h.
2008-01-08 00:48:30 +02:00
Lasse Collin 4e7e54c4c5 Introduced compatibility with systems that have pre-C99
or no inttypes.h. This is useful when the compiler has
good enough support for C99, but libc headers don't.

Changed liblzma API so that sys/types.h and inttypes.h
have to be #included before #including lzma.h. On systems
that don't have C99 inttypes.h, it's the problem of the
applications to provide the required types and macros
before #including lzma.h.

If lzma.h defined the missing types and macros, it could
conflict with third-party applications whose configure
has detected that the types are missing and defined them
in config.h already. An alternative would have been
introducing lzma_uint32 and similar types, but that would
just be an extra pain on modern systems.
2008-01-06 16:27:41 +02:00
Lasse Collin 5d018dc035 Imported to git. 2007-12-09 00:42:33 +02:00