home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Interactive Guide
/
c-cplusplus-interactive-guide.iso
/
c_ref
/
csource4
/
285_01
/
allocate.c
< prev
next >
Wrap
Text File
|
1990-07-10
|
2KB
|
52 lines
/* Allocate and clear storage for bison,
Copyright (C) 1984 Bob Corbett and Free Software Foundation, Inc.
BISON is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY. No author or distributor accepts responsibility to anyone
for the consequences of using it or for whether it serves any
particular purpose or works at all, unless he says so in writing.
Refer to the BISON General Public License for full details.
Everyone is granted permission to copy, modify and redistribute BISON,
but only under the conditions described in the BISON General Public
License. A copy of this license is supposed to have been given to you
along with BISON so you can know your rights and responsibilities. It
should be in a file named COPYING. Among other things, the copyright
notice and this notice must be preserved on all copies.
In other words, you are welcome to use, share and improve this program.
You are forbidden to forbid anyone else to use, share and improve
what you give them. Help stamp out software-hoarding! */
/*
prototypeing and TurboC defs
1/5/88 DrH
*/
#include <stdio.h>
#ifdef TURBOC
#include <alloc.h>
#else
#include <malloc.h>
#endif
#include "allocate.h"
extern void done(int) ;
char *
mallocate(n)
register unsigned n;
{
register char *block;
block = (char *) calloc( n, 1);
if (block == NULL)
{
fprintf(stderr, "bison: memory exhausted\n");
done(1);
}
return (block);
}