b_int.c

umud/U/b_int.c · 480 B

From the archive umud2.0.tar.gz

Download the archive   « Back to the archive contents

#include	"config.h"
#include	"mud.h"
#include	"u.h"
#include	"y.tab.h"

/* convert a string (or something) to a NUM */
ub_int(who,aswho,ac,av,retnode)
char	*who;
char	*aswho;
int	ac;
Nod	*av[];
Nod	*retnode;
{
	switch(av[0]->rv.t) {
	case STR:
		retnode->rv.iv = atoi(av[0]->rv.cv);
		break;
	case NUM:
		retnode->rv.iv = av[0]->rv.iv;
		break;
	case OID:
	case VNULL:
		retnode->rv.iv = 0;
		break;
	default:
		return(UERR_FATAL);
	}

	retnode->rv.t = NUM;
	return(UERR_NONE);
}

Site Stats

Snippets: 1791
Codebases: 571