Changeset View
Changeset View
Standalone View
Standalone View
sys/netgraph/zlib.c
- This file was moved from sys/libkern/zlib.c.
Show First 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | |||||
*/ | */ | ||||
/* From: zutil.h,v 1.16 1996/07/24 13:41:13 me Exp $ */ | /* From: zutil.h,v 1.16 1996/07/24 13:41:13 me Exp $ */ | ||||
#ifndef _Z_UTIL_H | #ifndef _Z_UTIL_H | ||||
#define _Z_UTIL_H | #define _Z_UTIL_H | ||||
#ifdef _KERNEL | #ifdef _KERNEL | ||||
#include <sys/zlib.h> | #include <netgraph/zlib.h> | ||||
#else | #else | ||||
#include "zlib.h" | #include "zlib.h" | ||||
#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> | ||||
▲ Show 20 Lines • Show All 5,319 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 */ |