campo-sirio/gfm/dalloc.c

51 lines
849 B
C
Raw Normal View History

/* DEC *AllocateDecimal();
*
* ARGUMENT
* None.
*
* DESCRIPTION
* Creates a DEC structure and zeroes it. The id is set to 2.
*
* SIDE EFFECTS
* None.
*
* RETURNS
* Returns pointer to the new structure if allocation is successful,
* otherwise returns GM_NULL. wGMError contains GM_NOMEMORY if no previous
* error existed.
*
* POSSIBLE ERROR CODES
*
* GM_NOMEMORY
*
* AUTHOR
* Andy Anderson 14-JAN-1987 16:15
* Copyright (C) 1987-1990 Greenleaf Software Inc. All rights reserved.
*
* MODIFICATIONS
*
*/
#include <stdio.h>
#include <malloc.h>
#include "gm.h"
#include "gmsystem.h"
DEC *AllocateDecimal()
{
DEC *a;
_MacStart(GM_DALLOC);
a=(DEC *) calloc(1,sizeof(DEC));
/* then make sure we pass back a good value */
if(!a) {
_MacErr(GM_NOMEMORY);
_MacRet(GM_NULL);
}
_MacDZero(a);
_MacRet(a);
}