--- Compress-LZF/lzfP.h 2001/09/27 18:36:34 1.1 +++ Compress-LZF/lzfP.h 2004/12/15 07:09:34 1.2 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000 Marc Alexander Lehmann + * Copyright (c) 2000-2003 Marc Alexander Lehmann * * Redistribution and use in source and binary forms, with or without modifica- * tion, are permitted provided that the following conditions are met: @@ -24,6 +24,16 @@ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTH- * ERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Alternatively, the contents of this file may be used under the terms of + * the GNU General Public License version 2 (the "GPL"), in which case the + * provisions of the GPL are applicable instead of the above. If you wish to + * allow the use of your version of this file only under the terms of the + * GPL and not to allow others to use your version of this file under the + * BSD license, indicate your decision by deleting the provisions above and + * replace them with the notice and other provisions required by the GPL. If + * you do not delete the provisions above, a recipient may use your version + * of this file under either the BSD or the GPL. */ #ifndef LZFP_h @@ -48,9 +58,9 @@ #endif /* - * sacrifice some compression quality in favour of speed. + * sacrifice some compression quality in favour of compression speed. * (roughly 1-2% worse compression for large blocks and - * 9-10% for small, redundant, blocks and 20% better speed in both cases) + * 9-10% for small, redundant, blocks and >>20% better speed in both cases) * In short: enable this for binary data, disable this for text data. */ #ifndef ULTRA_FAST @@ -80,11 +90,31 @@ # define INIT_HTAB 0 #endif +/* + * avoid assigning values to errno variable? for some embedding purposes + * (linux kernel for example), this is neccessary. NOTE: this breaks + * the documentation in lzf.h. + */ +#ifndef AVOID_ERRNO +# define AVOID_ERRNO 0 +#endif + +/* + * Wether to pass the LZF_STATE variable as argument, or allocate it + * on the stack. For small-stack environments, define this to 1. + * NOTE: this breaks the prototype in lzf.h. + */ +#ifndef LZF_STATE_ARG +# define LZF_STATE_ARG 0 +#endif + /*****************************************************************************/ /* nothing should be changed below */ typedef unsigned char u8; +typedef const u8 *LZF_STATE[1 << (HLOG)]; + #if !STRICT_ALIGN /* for unaligned accesses we need a 16 bit datatype. */ # include @@ -93,7 +123,6 @@ # elif UINT_MAX == 65535 typedef unsigned int u16; # else -# warn need 16 bit datatype when STRICT_ALIGN == 0 # undef STRICT_ALIGN # define STRICT_ALIGN 1 # endif