2 * Non-failing memory allocation routines.
3 * Copyright (c) 1995-1999 Markku Rossi.
5 * Author: Markku Rossi <mtr@iki.fi>
9 * This file is part of GNU enscript.
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2, or (at your option)
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; see the file COPYING. If not, write to
23 * the Free Software Foundation, 59 Temple Place - Suite 330,
24 * Boston, MA 02111-1307, USA.
38 #else /* no STDC_HEADERS */
48 #endif /* no STDC_HEADERS */
52 #define _(String) gettext (String)
54 #define _(String) String
70 fprintf (stderr, _("xmalloc(): couldn't allocate %d bytes\n"), size);
85 ptr = calloc (num, size);
88 fprintf (stderr, _("xcalloc(): couldn't allocate %d bytes\n"), size);
104 return xmalloc (size);
106 nptr = realloc (ptr, size);
109 fprintf (stderr, _("xrealloc(): couldn't reallocate %d bytes\n"), size);
134 tmp = xmalloc (strlen (str) + 1);