FreeBSD/contrib/ntp/ntpq/ntpq.c
/*
 * rawprint - do a printout of the data in raw mode
 */
do a printout of the data in raw mode
do a printout of the data in raw mode
static void
rawprint(
	int datatype,
	size_t length,
	const char *data,
	int status,
	int quiet,
	FILE *fp
	)
{
	const char *cp;
	const char *cpend;
	cp = data;
	cpend = data + length;
	if (!quiet)
		(void) fprintf(fp, "status=0x%04x,\n", status);
	while (cp < cpend) {
		if (*cp == '\r') {
			if (cp == (cpend - 1) || *(cp + 1) != '\n')
			    makeascii(1, cp, fp);
		} else if (isspace((unsigned char)*cp) || isprint((unsigned char)*cp))
			putc(*cp, fp);
		else
			makeascii(1, cp, fp);
		cp++;
	}
}
static void rawprint ( int datatype , size_t length , const char * data , int status , int quiet , FILE * fp ) { const char * cp ; const char * cpend ; cp = data ; cpend = data + length ; if ( ! quiet ) ( void ) fprintf ( fp , " \n " , status ) ; while ( cp < cpend ) { if ( * cp == ' \r ' ) { if ( cp == ( cpend - 1 ) || * ( cp + 1 ) != ' \n ' ) makeascii ( 1 , cp , fp ) ; } else if ( isspace ( ( unsigned char ) * cp ) || isprint ( ( unsigned char ) * cp ) ) putc ( * cp , fp ) ; else makeascii ( 1 , cp , fp ) ; cp ++ ; } }
rawprint - do a printout of the data in raw mode
rawprint - do a printout of the data in raw mode
/*
	 * Essentially print the data as is.  We reformat unprintables, though.
	 */ /*
			 * If this is a \r and the next character is a
			 * \n, supress this, else pretty print it.  Otherwise
			 * just output the character.
			 */