FreeBSD/contrib/ntp/ntpq/ntpq-subs.c
/*
 * readvar - send a read variables request with the specified variables
 */
send a read variables request with the specified variables
send a read variables request with the specified variables
static void
readvar(
	struct parse *pcmd,
	FILE *fp
	)
{
	associd_t	associd;
	size_t		tmpcount;
	size_t		u;
	int		type;
	struct varlist	tmplist[MAXLIST];
	if (pcmd->nargs == 0 || pcmd->argval[0].uval == 0)
		associd = 0;
	else if ((associd = checkassocid(pcmd->argval[0].uval)) == 0)
		return;
	ZERO(tmplist);
	if (pcmd->nargs > 1) {
		tmpcount = pcmd->nargs - 1;
		for (u = 0; u < tmpcount; u++)
			doaddvlist(tmplist, pcmd->argval[1 + u].string);
	}
	type = (0 == associd)
		   ? TYPE_SYS
		   : TYPE_PEER;
	dolist(tmplist, associd, CTL_OP_READVAR, type, fp);
	doclearvlist(tmplist);
}
static void readvar ( struct parse * pcmd , FILE * fp ) { associd_t associd ; size_t tmpcount ; size_t u ; int type ; struct varlist tmplist [ MAXLIST ] ; if ( pcmd -> nargs == 0 || pcmd -> argval [ 0 ] . uval == 0 ) associd = 0 ; else if ( ( associd = checkassocid ( pcmd -> argval [ 0 ] . uval ) ) == 0 ) return ; ZERO ( tmplist ) ; if ( pcmd -> nargs > 1 ) { tmpcount = pcmd -> nargs - 1 ; for ( u = 0 ; u < tmpcount ; u ++ ) doaddvlist ( tmplist , pcmd -> argval [ 1 + u ] . string ) ; } type = ( 0 == associd ) ? TYPE_SYS : TYPE_PEER ; dolist ( tmplist , associd , CTL_OP_READVAR , type , fp ) ; doclearvlist ( tmplist ) ; }
readvar - send a read variables request with the specified variables
readvar - send a read variables request with the specified variables
/* HMS: uval? */