00001 /* 00002 * File: xalloc.h 00003 * $Id: xalloc.h,v 1.3 2002/04/29 17:55:41 alec Exp $ 00004 * 00005 * Author: Alec Panovici (alecu@email.com) 00006 * 00007 * Comments: this header cntains decls for the ?alloc and string allocation 00008 * related functions. All the function here check the results and do a 00009 * RUNTIME_ERROR if the allocation did not succeed. 00010 * 00011 * Revision history: 00012 * 00013 * $Log: xalloc.h,v $ 00014 * Revision 1.3 2002/04/29 17:55:41 alec 00015 * regexps almost done 00016 * 00017 * Revision 1.2 2002/04/29 09:34:10 alec 00018 * scanner ptree building compiles 00019 * 00020 */ 00021 00022 00023 /* 00024 Copyright (C) 2002 Alexandru Panoviciu (alecu@email.com) 00025 00026 This program is free software; you can redistribute it and/or modify 00027 it under the terms of the GNU General Public License as published by 00028 the Free Software Foundation; either version 2 of the License, or 00029 (at your option) any later version. 00030 00031 This program is distributed in the hope that it will be useful, 00032 but WITHOUT ANY WARRANTY; without even the implied warranty of 00033 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00034 GNU General Public License for more details. 00035 00036 You should have received a copy of the GNU General Public License 00037 along with this program; if not, write to the Free Software 00038 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00039 00040 */ 00041 00042 #ifndef __XALLOC_H__ 00043 #define __XALLOC_H__ 00044 00045 #include <stdlib.h> 00046 #include <string.h> 00047 00052 void *xcalloc(size_t nmemb, size_t size); 00053 00058 void *xmalloc(size_t size); 00059 00063 void xfree(void **ptr); 00064 00069 void *xrealloc(void *ptr, size_t size); 00070 00074 char *xstrdup(const char *s); 00075 00076 #endif /* #ifndef __XALLOC_H__ */ 00077