FreeBSD/contrib/ntp/ntpq/ntpq-subs.c
/*
 *  saveconfig - dump ntp server configuration to server file
 */
dump ntp server configuration to server file
dump ntp server configuration to server file
static void
saveconfig(
	struct parse *pcmd,
	FILE *fp
	)
{
	const char *datap;
	int res;
	size_t dsize;
	u_short rstatus;
	if (0 == pcmd->nargs)
		return;
	res = doquery(CTL_OP_SAVECONFIG, 0, 1,
		      strlen(pcmd->argval[0].string),
		      pcmd->argval[0].string, &rstatus, &dsize,
		      &datap);
	if (res != 0)
		return;
	if (0 == dsize)
		fprintf(fp, "(no response message, curiously)");
	else
		fprintf(fp, "%.*s", (int)dsize, datap); 
}
static void saveconfig ( struct parse * pcmd , FILE * fp ) { const char * datap ; int res ; size_t dsize ; u_short rstatus ; if ( 0 == pcmd -> nargs ) return ; res = doquery ( CTL_OP_SAVECONFIG , 0 , 1 , strlen ( pcmd -> argval [ 0 ] . string ) , pcmd -> argval [ 0 ] . string , & rstatus , & dsize , & datap ) ; if ( res != 0 ) return ; if ( 0 == dsize ) fprintf ( fp , " " ) ; else fprintf ( fp , " " , ( int ) dsize , datap ) ; }
saveconfig - dump ntp server configuration to server file
saveconfig - dump ntp server configuration to server file
/* cast is wobbly */