|
|
Initial revision
/* LINTLIBRARY */
#include "quipu/util.h"
#include "quipu/attr.h"
#include "psap.h"
atoi();
static PE intenc (x)
int x;
{
return (int2prim(x));
}
static intdec (pe)
PE pe;
{
if (! test_prim_pe (pe,PE_CLASS_UNIV,PE_PRIM_INT))
return (0);
return (prim2num(pe));
}
/* ARGSUSED */
static intprint (ps,x,format)
PS ps;
int x,format;
{
ps_printf (ps,"%d",x);
}
static intdup (x)
int x;
{
return (x);
}
static intcmp (x,y)
int x,y;
{
return ( x == y ? 0 : (x > y ? 1 : -1) );
}
integer_syntax ()
{
(void) add_attribute_syntax ("integer",
(IFP) intenc, (IFP) intdec,
(IFP) atoi, intprint,
(IFP) intdup, intcmp,
NULLIFP, NULLCP,
NULLIFP, FALSE);
}
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.