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