Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/opencrypto Tidy up the namespace of this a little.



details:   https://anonhg.NetBSD.org/src/rev/dc939f8a8236
branches:  trunk
changeset: 550997:dc939f8a8236
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Wed Aug 27 00:12:37 2003 +0000

description:
Tidy up the namespace of this a little.

diffstat:

 sys/opencrypto/deflate.c |  41 +++++++++++++++++++----------------------
 1 files changed, 19 insertions(+), 22 deletions(-)

diffs (73 lines):

diff -r fb992251af5b -r dc939f8a8236 sys/opencrypto/deflate.c
--- a/sys/opencrypto/deflate.c  Wed Aug 27 00:08:31 2003 +0000
+++ b/sys/opencrypto/deflate.c  Wed Aug 27 00:12:37 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: deflate.c,v 1.1 2003/07/25 21:12:45 jonathan Exp $ */
+/*     $NetBSD: deflate.c,v 1.2 2003/08/27 00:12:37 thorpej Exp $ */
 /*     $FreeBSD: src/sys/opencrypto/deflate.c,v 1.1.2.1 2002/11/21 23:34:23 sam Exp $  */
 /* $OpenBSD: deflate.c,v 1.3 2001/08/20 02:45:22 hugh Exp $ */
 
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: deflate.c,v 1.1 2003/07/25 21:12:45 jonathan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: deflate.c,v 1.2 2003/08/27 00:12:37 thorpej Exp $");
 
 #include <sys/types.h>
 #include <sys/malloc.h>
@@ -54,6 +54,21 @@
  * algorithm
  */
 
+static void *
+ocf_zalloc(void *nil, u_int type, u_int size)
+{
+       void *ptr;
+
+       ptr = malloc(type *size, M_CRYPTO_DATA, M_NOWAIT);
+       return ptr;
+}
+
+static void
+ocf_zfree(void *nil, void *ptr)
+{
+       free(ptr, M_CRYPTO_DATA);
+}
+
 u_int32_t
 deflate_global(data, size, decomp, out)
        u_int8_t *data;
@@ -74,8 +89,8 @@
                buf[j].flag = 0;
 
        zbuf.next_in = data;    /* data that is going to be processed */
-       zbuf.zalloc = z_alloc;
-       zbuf.zfree = z_free;
+       zbuf.zalloc = ocf_zalloc;
+       zbuf.zfree = ocf_zfree;
        zbuf.opaque = Z_NULL;
        zbuf.avail_in = size;   /* Total length of data to be processed */
 
@@ -173,21 +188,3 @@
                deflateEnd(&zbuf);
        return 0;
 }
-
-void *
-z_alloc(nil, type, size)
-       void *nil;
-       u_int type, size;
-{
-       void *ptr;
-
-       ptr = malloc(type *size, M_CRYPTO_DATA, M_NOWAIT);
-       return ptr;
-}
-
-void
-z_free(nil, ptr)
-       void *nil, *ptr;
-{
-       free(ptr, M_CRYPTO_DATA);
-}



Home | Main Index | Thread Index | Old Index