FreeBSD/contrib/ntp/ntpq/ntpq-subs.c
/*
 * validate_ifnum - helper for ifstats()
 *
 * Ensures rows are received in order and complete.
 */
helper for ifstats()
Ensures rows are received in order and complete.
helper for ifstats () Ensures rows are received in order and complete .
static void
validate_ifnum(
	FILE *		fp,
	u_int		ifnum,
	int *		pfields,
	ifstats_row *	prow
	)
{
	if (prow->ifnum == ifnum)
		return;
	if (prow->ifnum + 1 <= ifnum) {
		if (*pfields < IFSTATS_FIELDS)
			fprintf(fp, "Warning: incomplete row with %d (of %d) fields",
				*pfields, IFSTATS_FIELDS);
		*pfields = 0;
		prow->ifnum = ifnum;
		return;
	}
	fprintf(stderr,
		"received if index %u, have %d of %d fields for index %u, aborting.\n",
		ifnum, *pfields, IFSTATS_FIELDS, prow->ifnum);
	exit(1);
}
static void validate_ifnum ( FILE * fp , u_int ifnum , int * pfields , ifstats_row * prow ) { if ( prow -> ifnum == ifnum ) return ; if ( prow -> ifnum + 1 <= ifnum ) { if ( * pfields < IFSTATS_FIELDS ) fprintf ( fp , " " , * pfields , IFSTATS_FIELDS ) ; * pfields = 0 ; prow -> ifnum = ifnum ; return ; } fprintf ( stderr , " \n " , ifnum , * pfields , IFSTATS_FIELDS , prow -> ifnum ) ; exit ( 1 ) ; }
validate_ifnum - helper for ifstats()
 Ensures rows are received in order and complete.
validate_ifnum - helper for ifstats () Ensures rows are received in order and complete .