Annotation of researchv10dc/cmd/bison/allocate.c, revision 1.1

1.1     ! root        1: /* Allocate and clear storage for bison,
        !             2:    Copyright (C) 1984 Bob Corbett and Free Software Foundation, Inc.
        !             3: 
        !             4: BISON is distributed in the hope that it will be useful, but WITHOUT ANY
        !             5: WARRANTY.  No author or distributor accepts responsibility to anyone
        !             6: for the consequences of using it or for whether it serves any
        !             7: particular purpose or works at all, unless he says so in writing.
        !             8: Refer to the BISON General Public License for full details.
        !             9: 
        !            10: Everyone is granted permission to copy, modify and redistribute BISON,
        !            11: but only under the conditions described in the BISON General Public
        !            12: License.  A copy of this license is supposed to have been given to you
        !            13: along with BISON so you can know your rights and responsibilities.  It
        !            14: should be in a file named COPYING.  Among other things, the copyright
        !            15: notice and this notice must be preserved on all copies.
        !            16: 
        !            17:  In other words, you are welcome to use, share and improve this program.
        !            18:  You are forbidden to forbid anyone else to use, share and improve
        !            19:  what you give them.   Help stamp out software-hoarding!  */
        !            20: 
        !            21: #include <stdio.h>
        !            22: 
        !            23: 
        !            24: char *
        !            25: allocate(n)
        !            26: register unsigned n;
        !            27: {
        !            28:   register char *block;
        !            29: 
        !            30:   extern char *calloc();
        !            31: 
        !            32:   block = calloc(n,1);
        !            33:   if (block == NULL)
        !            34:     {
        !            35:       fprintf(stderr, "bison: memory exhausted\n");
        !            36:       done(1);
        !            37:     }
        !            38: 
        !            39:   return (block);
        !            40: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.