FreeBSD/contrib/ntp/ntpq/ntpq-subs.c
/*
 * dormvlist - remove variable(s) from the variable list
 */
remove variable(s) from the variable list
remove variable ( s ) from the variable list
static void
dormvlist(
	struct varlist *vlist,
	const char *vars
	)
{
	struct varlist *vl;
	size_t len;
	char *name;
	char *value;
	len = strlen(vars);
	while (nextvar(&len, &vars, &name, &value)) {
		vl = findlistvar(vlist, name);
		if (vl == 0 || vl->name == 0) {
			(void) fprintf(stderr, "Variable `%s' not found\n",
				       name);
		} else {
			free((void *)(intptr_t)vl->name);
			if (vl->value != 0)
			    free(vl->value);
			for ( ; (vl+1) < (g_varlist + MAXLIST)
				      && (vl+1)->name != 0; vl++) {
				vl->name = (vl+1)->name;
				vl->value = (vl+1)->value;
			}
			vl->name = vl->value = 0;
		}
	}
}
static void dormvlist ( struct varlist * vlist , const char * vars ) { struct varlist * vl ; size_t len ; char * name ; char * value ; len = strlen ( vars ) ; while ( nextvar ( & len , & vars , & name , & value ) ) { vl = findlistvar ( vlist , name ) ; if ( vl == 0 || vl -> name == 0 ) { ( void ) fprintf ( stderr , " \n " , name ) ; } else { free ( ( void * ) ( intptr_t ) vl -> name ) ; if ( vl -> value != 0 ) free ( vl -> value ) ; for ( ; ( vl + 1 ) < ( g_varlist + MAXLIST ) && ( vl + 1 ) -> name != 0 ; vl ++ ) { vl -> name = ( vl + 1 ) -> name ; vl -> value = ( vl + 1 ) -> value ; } vl -> name = vl -> value = 0 ; } } }
dormvlist - remove variable(s) from the variable list
dormvlist - remove variable ( s ) from the variable list