campo-sirio/gfm/makuld.c

54 lines
841 B
C
Raw Normal View History

/* DEC *MakeDecimalFromUnsLong( x, l, n)
*
* ARGUMENT
* DEC *x;
* unsigned long l;
* int n;
*
* DESCRIPTION
* Converts unsigned long 'l' to a DEC with implied decimal 'n'.
*
* SIDE EFFECTS
* None.
*
* RETURNS
* The DEC if the conversion is successful, and GM_NULL otherwise.
*
* POSSIBLE ERROR CODES
*
* GM_INVALIDID
*
* AUTHOR
* Jared Levy Feb. 9, 1987
* Copyright (C) 1987-1990 Greenleaf Software Inc. All rights reserved.
*
* MODIFICATIONS
*
*/
#include <stdio.h>
#include "gm.h"
#include "gmsystem.h"
DEC *MakeDecimalFromUnsLong( x, l, n)
DEC *x;
unsigned long l;
int n;
{
_MacStart(GM_MAKULD);
_MacOutVarD(x);
if((n>GM_MAXID)||(n<GM_MINID)) {
_MacErr(GM_INVALIDID);
_MacRet(GM_NULL);
}
x->ls.lattr = 0;
x->ls.lid = n;
x->ls.lsl[0] = l;
x->ls.lsl[1] = 0L;
x->dc.msd = 0;
_MacRet(x);
}