X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=include%2Fnmem.h;h=5d465481b12615f1182296d956e634e13b7870b5;hb=a00dfa73d5d3796f8048f2134fec2685b62e2658;hp=227d99ff5b7688cf5fe21ead39aeaa0299ab5be3;hpb=a309d6ece06c0ab732d98c59f2718efaebd01ec6;p=yaz-moved-to-github.git diff --git a/include/nmem.h b/include/nmem.h index 227d99f..5d46548 100644 --- a/include/nmem.h +++ b/include/nmem.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, Index Data. + * Copyright (c) 1995-1997, Index Data. * * Permission to use, copy, modify, distribute, and sell this software and * its documentation, in whole or in part, for any purpose, is hereby granted, @@ -29,6 +29,25 @@ #ifndef NMEM_H #define NMEM_H +#ifdef __cplusplus +extern "C" { +#endif + +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_control *NMEM; void nmem_reset(NMEM n); @@ -37,4 +56,8 @@ int nmem_total(NMEM n); NMEM nmem_create(void); void nmem_destroy(NMEM n); +#ifdef __cplusplus +} +#endif + #endif