00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #include "ansidecl.h"
00016 #ifdef ANSI_PROTOTYPES
00017 #include <stddef.h>
00018 #else
00019 #define size_t unsigned long
00020 #endif
00021
00022
00023 PTR malloc PARAMS ((size_t));
00024 void bzero PARAMS ((PTR, size_t));
00025
00026 PTR
00027 calloc (nelem, elsize)
00028 size_t nelem, elsize;
00029 {
00030 register PTR ptr;
00031
00032 if (nelem == 0 || elsize == 0)
00033 nelem = elsize = 1;
00034
00035 ptr = malloc (nelem * elsize);
00036 if (ptr) bzero (ptr, nelem * elsize);
00037
00038 return ptr;
00039 }