Changeset View
Changeset View
Standalone View
Standalone View
head/sys/libkern/zlib.c
Show All 19 Lines | |||||
* whether an up-to-date version of this file is already installed. | * whether an up-to-date version of this file is already installed. | ||||
*/ | */ | ||||
#define NO_DUMMY_DECL | #define NO_DUMMY_DECL | ||||
#define NO_ZCFUNCS | #define NO_ZCFUNCS | ||||
#define MY_ZCALLOC | #define MY_ZCALLOC | ||||
#if defined(__FreeBSD__) && defined(_KERNEL) | #if defined(__FreeBSD__) && defined(_KERNEL) | ||||
#define _tr_init _zlib104_tr_init | #define _tr_init zlib104_tr_init | ||||
#define _tr_align _zlib104_tr_align | #define _tr_align zlib104_tr_align | ||||
#define _tr_tally _zlib104_tr_tally | #define _tr_tally zlib104_tr_tally | ||||
#define _tr_flush_block _zlib104_tr_flush_block | #define _tr_flush_block zlib104_tr_flush_block | ||||
#define _tr_stored_block _zlib104_tr_stored_block | #define _tr_stored_block zlib104_tr_stored_block | ||||
#define inflate_fast _zlib104_inflate_fast | #define inflate_fast zlib104_inflate_fast | ||||
#define inflate _zlib104_inflate | #define inflate zlib104_inflate | ||||
#define zlibVersion _zlib104_Version | #define zlibVersion zlib104_Version | ||||
#endif | #endif | ||||
/* +++ zutil.h */ | /* +++ zutil.h */ | ||||
/*- | /*- | ||||
* zutil.h -- internal interface and configuration of the compression library | * zutil.h -- internal interface and configuration of the compression library | ||||
* Copyright (C) 1995-1996 Jean-loup Gailly. | * Copyright (C) 1995-1996 Jean-loup Gailly. | ||||
* For conditions of distribution and use, see copyright notice in zlib.h | * For conditions of distribution and use, see copyright notice in zlib.h | ||||
Show All 16 Lines | |||||
#endif | #endif | ||||
#ifdef _KERNEL | #ifdef _KERNEL | ||||
/* Assume this is a *BSD or SVR4 kernel */ | /* Assume this is a *BSD or SVR4 kernel */ | ||||
#include <sys/types.h> | #include <sys/types.h> | ||||
#include <sys/time.h> | #include <sys/time.h> | ||||
#include <sys/systm.h> | #include <sys/systm.h> | ||||
#include <sys/param.h> | #include <sys/param.h> | ||||
#include <sys/kernel.h> | |||||
#include <sys/module.h> | |||||
# define HAVE_MEMCPY | # define HAVE_MEMCPY | ||||
#else | #else | ||||
#if defined(__KERNEL__) | #if defined(__KERNEL__) | ||||
/* Assume this is a Linux kernel */ | /* Assume this is a Linux kernel */ | ||||
#include <linux/string.h> | #include <linux/string.h> | ||||
#define HAVE_MEMCPY | #define HAVE_MEMCPY | ||||
▲ Show 20 Lines • Show All 519 Lines • ▼ Show 20 Lines | |||||
* Data Compression with Finite Windows, Comm.ACM, 32,4 (1989) 490-595 | * Data Compression with Finite Windows, Comm.ACM, 32,4 (1989) 490-595 | ||||
* | * | ||||
*/ | */ | ||||
/* From: deflate.c,v 1.15 1996/07/24 13:40:58 me Exp $ */ | /* From: deflate.c,v 1.15 1996/07/24 13:40:58 me Exp $ */ | ||||
/* #include "deflate.h" */ | /* #include "deflate.h" */ | ||||
char deflate_copyright[] = " deflate 1.0.4 Copyright 1995-1996 Jean-loup Gailly "; | |||||
/* | /* | ||||
If you use the zlib library in a product, an acknowledgment is welcome | If you use the zlib library in a product, an acknowledgment is welcome | ||||
in the documentation of your product. If for some reason you cannot | in the documentation of your product. If for some reason you cannot | ||||
include such an acknowledgment, I would appreciate that you keep this | include such an acknowledgment, I would appreciate that you keep this | ||||
copyright string in the executable of your product. | copyright string in the executable of your product. | ||||
*/ | */ | ||||
/* =========================================================================== | /* =========================================================================== | ||||
▲ Show 20 Lines • Show All 3,490 Lines • ▼ Show 20 Lines | |||||
/* inftrees.c -- generate Huffman trees for efficient decoding | /* inftrees.c -- generate Huffman trees for efficient decoding | ||||
* Copyright (C) 1995-1996 Mark Adler | * Copyright (C) 1995-1996 Mark Adler | ||||
* For conditions of distribution and use, see copyright notice in zlib.h | * For conditions of distribution and use, see copyright notice in zlib.h | ||||
*/ | */ | ||||
/* #include "zutil.h" */ | /* #include "zutil.h" */ | ||||
/* #include "inftrees.h" */ | /* #include "inftrees.h" */ | ||||
char inflate_copyright[] = " inflate 1.0.4 Copyright 1995-1996 Mark Adler "; | |||||
/* | /* | ||||
If you use the zlib library in a product, an acknowledgment is welcome | If you use the zlib library in a product, an acknowledgment is welcome | ||||
in the documentation of your product. If for some reason you cannot | in the documentation of your product. If for some reason you cannot | ||||
include such an acknowledgment, I would appreciate that you keep this | include such an acknowledgment, I would appreciate that you keep this | ||||
copyright string in the executable of your product. | copyright string in the executable of your product. | ||||
*/ | */ | ||||
#ifndef NO_DUMMY_DECL | #ifndef NO_DUMMY_DECL | ||||
▲ Show 20 Lines • Show All 1,264 Lines • ▼ Show 20 Lines | while (len > 0) { | ||||
s2 += s1; | s2 += s1; | ||||
} while (--k); | } while (--k); | ||||
s1 %= BASE; | s1 %= BASE; | ||||
s2 %= BASE; | s2 %= BASE; | ||||
} | } | ||||
return (s2 << 16) | s1; | return (s2 << 16) | s1; | ||||
} | } | ||||
/* --- adler32.c */ | /* --- adler32.c */ | ||||
#ifdef _KERNEL | |||||
static int | |||||
zlib_modevent(module_t mod, int type, void *unused) | |||||
{ | |||||
switch (type) { | |||||
case MOD_LOAD: | |||||
return 0; | |||||
case MOD_UNLOAD: | |||||
return 0; | |||||
} | |||||
return EINVAL; | |||||
} | |||||
static moduledata_t zlib_mod = { | |||||
"zlib", | |||||
zlib_modevent, | |||||
0 | |||||
}; | |||||
DECLARE_MODULE(zlib, zlib_mod, SI_SUB_DRIVERS, SI_ORDER_FIRST); | |||||
MODULE_VERSION(zlib, 1); | |||||
#endif /* _KERNEL */ |