
#include <stdio.h>

#define MAXINT	32767	/* maximum size integer */
#define MAXLINE 128
#define MAXSCAN 128


/* Short version of printf to save space */
qprintf(nargs)
	{
	register char **arg, *fmt;
	register c, base;
	char s[7], *itob();

	arg = (char **)&nargs + nargs;
	fmt = *arg;
	while (c = *fmt++) {
		if (c != '%') {
			putchar(c);
			continue;
			}
		switch (c = *fmt++) {
		case 'c':
			putchar(*--arg);
			continue;
		case 'd':
			base = -10;
			goto prt;
		case 'o':
			base = 8;
			goto prt;
		case 'u':
			base = 10;
			goto prt;
		case 'x':
			base = 16;
		prt:
			fputs(itob(*--arg, s, base), stdout);
			continue;
		case 's':
			fputs(*--arg, stdout);
			continue;
		default:
			putchar(c);
			continue;
			}
		}
	}
