campo-sirio/gfm/dalloc.c
alex ba237a9d91 Patch level : no patch
Files correlati     :
Ricompilazione Demo : [ ]
Commento            :
Aggiunti i sorgenti per Greenleaf Math Library (gfm.dll)


git-svn-id: svn://10.65.10.50/trunk@10079 c028cbd2-c16b-5b4b-a496-9718f37d4682
2002-02-26 12:19:02 +00:00

55 lines
911 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"
#ifndef DOS
extern char *calloc(unsigned ,unsigned );
#endif
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);
}