FreeBSD/usr.bin/tip/tip/value.c
/*
 * assign variable s with value v (for NUMBER or STRING or CHAR types)
 */
assign variable s with value v (for NUMBER or STRING or CHAR types)
assign variable s with value v ( for NUMBER or STRING or CHAR types )
int
vstring(char *s, char *v)
{
	value_t *p;
	p = vlookup(s);
	if (p == 0)
		return (1);
	if (p->v_type&NUMBER)
		vassign(p, (char *)(intptr_t)atoi(v));
	else {
		if (strcmp(s, "record") == 0)
			v = expand(v);
		vassign(p, v);
	}
	return (0);
}
int vstring ( char * s , char * v ) { value_t * p ; p = vlookup ( s ) ; if ( p == 0 ) return ( 1 ) ; if ( p -> v_type & NUMBER ) vassign ( p , ( char * ) ( intptr_t ) atoi ( v ) ) ; else { if ( strcmp ( s , " " ) == 0 ) v = expand ( v ) ; vassign ( p , v ) ; } return ( 0 ) ; }
assign variable s with value v (for NUMBER or STRING or CHAR types)
assign variable s with value v ( for NUMBER or STRING or CHAR types )