File:  [CSRG BSD Unix] / 43BSDReno / contrib / isode-beta / dsap / common / integer.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 16:12:56 2018 UTC (8 years, 1 month ago) by root
Branches: MAIN, BSD
CVS tags: HEAD, BSD43reno
BSD 4.3reno

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

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.