00001 /* 00002 * Copyright (c) 2005 Jukka Zitting <jz@yukatan.fi> 00003 * 00004 * This program is free software; you can redistribute it and/or modify it 00005 * under the terms of the GNU Lesser General Public License as published 00006 * by the Free Software Foundation; either version 2 of the License, or 00007 * (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to the Free Software 00016 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00017 */ 00018 #ifndef POOL_H 00019 #define POOL_H 00020 00021 typedef struct midgard_pool midgard_pool; 00022 00023 extern midgard_pool *mgd_alloc_pool(void); 00024 00025 extern void mgd_clear_pool(midgard_pool *pool); 00026 00027 extern void mgd_free_from_pool(midgard_pool *pool, void *ptr); 00028 00029 extern void mgd_free_pool(midgard_pool *pool); 00030 00031 extern void *mgd_alloc(midgard_pool *pool, int len); 00032 00033 extern char *mgd_stralloc(midgard_pool *pool, int len); 00034 00035 extern char *mgd_strdup(midgard_pool *pool, const char *str); 00036 00037 extern char *mgd_strndup(midgard_pool *pool, const char *str, int len); 00038 00039 #endif
1.4.6