From a97174e3c213916ba968c8922ec69e9101badb2d Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Fri, 3 Jun 2005 20:30:30 +0000 Subject: [PATCH] Let nmem.h include stddef.h to get size_t defined. Hide strutures nmem_control and nmem_block. --- include/yaz/nmem.h | 21 ++++++--------------- src/nmem.c | 17 ++++++++++++++++- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/include/yaz/nmem.h b/include/yaz/nmem.h index da63a1a..b424be0 100644 --- a/include/yaz/nmem.h +++ b/include/yaz/nmem.h @@ -23,7 +23,7 @@ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. * - * $Id: nmem.h,v 1.15 2005-05-02 19:14:33 adam Exp $ + * $Id: nmem.h,v 1.16 2005-06-03 20:30:30 adam Exp $ */ /** @@ -35,6 +35,8 @@ */ #ifndef NMEM_H #define NMEM_H + +#include #include #define NMEM_DEBUG 0 @@ -45,20 +47,9 @@ YAZ_BEGIN_CDECL -typedef struct nmem_block -{ - char *buf; /* memory allocated in this block */ - int size; /* size of buf */ - int top; /* top of buffer */ - struct nmem_block *next; -} nmem_block; - -typedef struct nmem_control -{ - int total; - nmem_block *blocks; - struct nmem_control *next; -} nmem_control; +typedef struct nmem_block nmem_block; + +typedef struct nmem_control nmem_control; typedef struct nmem_mutex *NMEM_MUTEX; YAZ_EXPORT void nmem_mutex_create(NMEM_MUTEX *); diff --git a/src/nmem.c b/src/nmem.c index 0ce4ca6..123d284 100644 --- a/src/nmem.c +++ b/src/nmem.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2005, Index Data ApS * See the file LICENSE for details. * - * $Id: nmem.c,v 1.15 2005-04-29 10:36:05 heikki Exp $ + * $Id: nmem.c,v 1.16 2005-06-03 20:30:30 adam Exp $ */ /** @@ -43,6 +43,21 @@ #define NMEM_CHUNK (4*1024) +struct nmem_block +{ + char *buf; /* memory allocated in this block */ + int size; /* size of buf */ + int top; /* top of buffer */ + struct nmem_block *next; +}; + +struct nmem_control +{ + int total; + nmem_block *blocks; + struct nmem_control *next; +}; + struct align { char x; union { -- 1.7.10.4