ftp.nice.ch/pub/next/developer/objc/mach/dis.N.bs.tar.gz#/print_routines.c

This is print_routines.c in view mode; [Download] [Up]

#include <stdio.h>
#include <dis.h>

/* $Log:	print_routines.c,v $
 * Revision 1.1  94/05/31  22:05:25  ediger
 * Initial revision
 * 
 *  */

static char rcsident[] = "$Id: print_routines.c,v 1.1 94/05/31 22:05:25 ediger Exp Locker: ediger $";

/*======================= print routines ========================*/

/*	These routines are called to print all the output.  So they and the
	calling routines can be identified if we ever improve this to produce
	graphical output.
*/
extern flag printit;		/* if false, disable printing for pre-passes */
extern flag xlabels;
static flag linestarted;	/* multiple \n preventer */

void 
startline(long unsigned address)
{
	if (!printit)
		return;
	if (linestarted)
		putchar('\n');
	if (xlabels)
		printf("%7x ", address);
	linestarted = TRUE;
}

void 
startlinenoaddress(void)
{
	if (!printit)
		return;
	if (linestarted)
		putchar('\n');
	if (xlabels)
		printf("        ");
	linestarted = TRUE;
}

void 
endline(void)
{				/* this only needs to be called at eof! */
	if (linestarted)
		putchar('\n');
	linestarted = FALSE;
}

void 
cprint(int c)
{
	if (printit)
		putchar(c);
}

void 
sprint(char *s)
{
	if (printit)
		printf("%s", s);
}

void
fprint(const char *f, ...)
{
	if (printit)
	{   va_list ap;

		va_start(ap, f);
		vprintf((char *)f, ap);
		va_end(ap);
	}
}

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.