mirror of https://github.com/Cisco-Talos/clamav
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.8 KiB
52 lines
1.8 KiB
/*
|
|
* Copyright (C) 2008 Sourcefire, Inc.
|
|
*
|
|
* Authors: aCaB <acab@clamav.net>
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
* published by the Free Software Foundation.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, write to the Free Software
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
|
* MA 02110-1301, USA.
|
|
*/
|
|
|
|
#ifndef MPOOL_H
|
|
#define MPOOL_H
|
|
|
|
#ifdef USE_MPOOL
|
|
|
|
typedef struct MP mp_t;
|
|
|
|
mp_t *mp_create(void);
|
|
void mp_destroy(mp_t *mp);
|
|
void *mp_malloc(mp_t *mp, size_t size);
|
|
void mp_free(mp_t *mp, void *ptr);
|
|
void *mp_calloc(mp_t *mp, size_t nmemb, size_t size);
|
|
void *mp_realloc(mp_t *mp, void *ptr, size_t size);
|
|
void *mp_realloc2(mp_t *mp, void *ptr, size_t size);
|
|
unsigned char *cli_mp_hex2str(mp_t* mp, const unsigned char *src);
|
|
char *cli_mp_strdup(mp_t *mp, const char *s);
|
|
char *cli_mp_virname(mp_t *mp, char *virname, unsigned int official);
|
|
uint16_t *cli_mp_hex2ui(mp_t *mp, const char *hex);
|
|
#else /* USE_MPOOL */
|
|
|
|
#define mp_malloc(a, b) cli_malloc(b)
|
|
#define mp_free(a, b) free(b)
|
|
#define mp_calloc(a, b, c) cli_calloc(b, c)
|
|
#define mp_realloc(a, b, c) cli_realloc(b, c)
|
|
#define mp_realloc2(a, b, c) cli_realloc2(b, c)
|
|
#define cli_mp_hex2str(mp, src) cli_hex2str(src)
|
|
#define cli_mp_strdup(mp, s) cli_strdup(s)
|
|
#define cli_mp_virname(mp, a, b) cli_virname(a, b)
|
|
#define cli_mp_hex2ui(mp, hex) cli_hex2ui(hex)
|
|
#endif /* USE_MPOOL */
|
|
|
|
#endif
|
|
|