Need help about doprnt


...
...
void fn4Display ( char *szp )
{
	while ( *szp )
	{
		if (isprint(*szp))
		{
			iDataFlag = DATA;
			fn4Byte (*szp++);
		}
		else
		{
			switch (*szp++)
			{
				case CLEAR: fn4Clear(); break;
				case LINETWO: fn4Line2(); break;
			}
		}
	}
}

nodebug void pr_qe(int c, char *buf, int *cnt) { buf[(*cnt)++] = c;}

void lprintf(char *format, ...) {
	auto char buf[128];
	auto int count;
	count = 0;
	doprnt(pr_qe, format, (char *) ((char *) &format + sizeof (format)), NULL, buf, &count);
	pr_qe(0, buf, &count);                 // Null Terminator
	fn4Display(buf);
}

void main(void)
{
fn4LCD_Init();
	while(1)
	{
		lprintf("\fabc
def");
		fnMsDelay(200);
		fn4Line2Clear();
		fn4Cursor(4);
		lprintf("TEXT");
		fnMsDelay(200);
	}

}

I’m trying to convert the characters to hex. In this code it has done with using “doprnt” function but i couldnt realize how it works and how this can be done.
I wonder if anybody could help me.
Thanks.