* 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 $
*/
/**
*/
#ifndef NMEM_H
#define NMEM_H
+
+#include <stddef.h>
#include <yaz/yconfig.h>
#define NMEM_DEBUG 0
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 *);
* 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 $
*/
/**
#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 {