campo-sirio/gfm/dalloc.c
luca ac8ecb0b9f Patch level :2.0 aga 370
Files correlati     :
Ricompilazione Demo : [ ]
Commento            :sistemate le librerie gfm (allineate a partners version)


git-svn-id: svn://10.65.10.50/trunk@10750 c028cbd2-c16b-5b4b-a496-9718f37d4682
2003-01-17 12:20:25 +00:00

51 lines
849 B
C
Executable File

/* 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);
}