
NAME
	HookPrintF -- Use _Printf() style formatting to process
		arbitrary data one character at a time via a callback
		hook

SYNOPSIS
	count,stream = HookPrintF(hook,formatstring,arguments...)
	d0    a0                  a2   a0           (a1)+

FUNCTION
	Use _PrintF() style formatting to process arbitrary data one
	character at a time. A user supplied callback hook will be
	invoked for each character expanded.

INPUTS
	struct Hook *hook - This is a standard callback hook representing
		a function to process a single character. See below
		for details on how to write such a function.

	char *formatstring - This is a null terminated string which
		represents the format in which to output the
		subsequent arguments. This string consists of printable
		characters and escape sequences which begin with the
		percent symbol ('%'). (Note that to write a percent
		symbol you need to put '%%' in the format string).
		For details of allowable escape sequences see the
		documentation for _PrintF().

	arguments... - These are arguments OF ANY TYPE whose
		values are to be printed. Note that machine code
		programmers must pass the address of the first
		parameter in register a1.

RESULTS
	ULONG count - This is a count of the number of characters
		written, or may be -1 in the event of an error.

	void *stream - This result is only available to machine
		code programmers. If there were more arguments
		supplied than escape sequences in the format string
		then this will be the address of the first unused
		argument.

NOTES
	(1) All restrictions which apply to _PrintF() also apply to
	this function, so please read the docs for _PrintF().

	(2) Machine code programmers will find the functions HookPrintF()
	and _VHookPrintF() to be identical. Only C programmers can tell
	them apart.

SEE ALSO
	_PrintF(),_VPrintF(),_SPrintF(),_VSPrintF(),_SNPrintF(),
	_VSNPrintF(),_FPrintF(),_VFPrintF(),VHookPrintF()
	BRawPrintF(),RawPrintF().

	Also _ScanF() and related functions
	and _PutS() and related functions.

----------------------------------------------------------------------
THE USER-SUPPLIED CALLBACK HOOK SHOULD BEHAVE AS FOLLOWS:
----------------------------------------------------------------------

NAME	<anything> -- It's up to you what you call it. For the
		remainder of this document I shall refer to the
		function as PrintFHook().

SYNOPSIS
	PrintFHook(hook,character,message)
		   a0   a2        a1

INPUTS
	struct Hook *hook - The hook itself

	LONG character - The character to process. Note that although
		the value is passed to you as a LONG, only the lower
		8 bits are significant. Machine code programmers please
		note that although the value is passed in an address
		register, it is NOT a pointer.

	LONG message - This will be the constant HPF_PUTCHAR, which is
		defined in "earth/earthbase.i" and "earth/earthbase.h".
		Machine code programmers please note that although the
		value is passed in an address register, it is NOT a pointer.

RESULTS
	None

NOTES
	Because this function is called via standard WB2 callback
	hooks, it may be written in any language. This will work even
	under WB1.3 or earlier - see the document Hooks.doc for more
	details on this.

SEE ALSO
