ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/liblzf/lzfP.h
(Generate patch)

Comparing liblzf/lzfP.h (file contents):
Revision 1.3 by root, Sun Nov 17 11:39:26 2002 UTC vs.
Revision 1.10 by root, Thu Mar 3 17:06:44 2005 UTC

1/* 1/*
2 * Copyright (c) 2000-2002 Marc Alexander Lehmann <pcg@goof.com> 2 * Copyright (c) 2000-2005 Marc Alexander Lehmann <schmorp@schmorp.de>
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without modifica- 4 * Redistribution and use in source and binary forms, with or without modifica-
5 * tion, are permitted provided that the following conditions are met: 5 * tion, are permitted provided that the following conditions are met:
6 * 6 *
7 * 1. Redistributions of source code must retain the above copyright notice, 7 * 1. Redistributions of source code must retain the above copyright notice,
22 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 22 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
23 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 23 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTH- 24 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTH-
25 * ERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 25 * ERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
26 * OF THE POSSIBILITY OF SUCH DAMAGE. 26 * OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 * Alternatively, the contents of this file may be used under the terms of
29 * the GNU General Public License version 2 (the "GPL"), in which case the
30 * provisions of the GPL are applicable instead of the above. If you wish to
31 * allow the use of your version of this file only under the terms of the
32 * GPL and not to allow others to use your version of this file under the
33 * BSD license, indicate your decision by deleting the provisions above and
34 * replace them with the notice and other provisions required by the GPL. If
35 * you do not delete the provisions above, a recipient may use your version
36 * of this file under either the BSD or the GPL.
27 */ 37 */
28 38
29#ifndef LZFP_h 39#ifndef LZFP_h
30#define LZFP_h 40#define LZFP_h
31 41
78 */ 88 */
79#ifndef INIT_HTAB 89#ifndef INIT_HTAB
80# define INIT_HTAB 0 90# define INIT_HTAB 0
81#endif 91#endif
82 92
93/*
94 * avoid assigning values to errno variable? for some embedding purposes
95 * (linux kernel for example), this is neccessary. NOTE: this breaks
96 * the documentation in lzf.h.
97 */
98#ifndef AVOID_ERRNO
99# define AVOID_ERRNO 0
100#endif
101
102/*
103 * Wether to pass the LZF_STATE variable as argument, or allocate it
104 * on the stack. For small-stack environments, define this to 1.
105 * NOTE: this breaks the prototype in lzf.h.
106 */
107#ifndef LZF_STATE_ARG
108# define LZF_STATE_ARG 0
109#endif
110
83/*****************************************************************************/ 111/*****************************************************************************/
84/* nothing should be changed below */ 112/* nothing should be changed below */
85 113
86typedef unsigned char u8; 114typedef unsigned char u8;
115
116typedef const u8 *LZF_STATE[1 << (HLOG)];
87 117
88#if !STRICT_ALIGN 118#if !STRICT_ALIGN
89/* for unaligned accesses we need a 16 bit datatype. */ 119/* for unaligned accesses we need a 16 bit datatype. */
90# include <limits.h> 120# include <limits.h>
91# if USHRT_MAX == 65535 121# if USHRT_MAX == 65535
92 typedef unsigned short u16; 122 typedef unsigned short u16;
93# elif UINT_MAX == 65535 123# elif UINT_MAX == 65535
94 typedef unsigned int u16; 124 typedef unsigned int u16;
95# else 125# else
96# warn need 16 bit datatype when STRICT_ALIGN == 0, this is non-fatal
97# undef STRICT_ALIGN 126# undef STRICT_ALIGN
98# define STRICT_ALIGN 1 127# define STRICT_ALIGN 1
99# endif 128# endif
100#endif 129#endif
101 130
102#if USE_MEMCPY || INIT_HTAB 131#if USE_MEMCPY || INIT_HTAB
132# ifdef __cplusplus
133# include <cstring>
134# else
103# include <string.h> 135# include <string.h>
136# endif
104#endif 137#endif
105 138
106#endif 139#endif
107 140

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines