1 /****************************************************************************
2  *
3  * Copyright (C) 2003-2009 Sourcefire, Inc.
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License Version 2 as
7  * published by the Free Software Foundation.  You may not use, modify or
8  * distribute this program under any other version of the GNU General
9  * Public License.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19  *
20  ****************************************************************************/
21 
22 /*
23 **  sfmemcap.h
24 */
25 #ifndef __SF_MEMCAP_H__
26 #define __SF_MEMCAP_H__
27 
28 typedef struct
29 {
30    unsigned memused;
31    unsigned memcap;
32    int      nblocks;
33 
34 }MEMCAP;
35 
36 void     sfmemcap_init(MEMCAP * mc, unsigned nbytes);
37 MEMCAP * sfmemcap_new( unsigned nbytes );
38 void     sfmemcap_delete( MEMCAP * mc );
39 void   * sfmemcap_alloc(MEMCAP * mc, unsigned nbytes);
40 void     sfmemcap_showmem(MEMCAP * mc );
41 void     sfmemcap_free( MEMCAP * mc, void * memory);
42 char   * sfmemcap_strdup(MEMCAP * mc, const char *str);
43 void   * sfmemcap_dupmem(MEMCAP * mc, void * src, int n );
44 
45 #endif
46