Beispiel #1
0
int ipxe_printf(const char *format, ...)
{
	/* replace unsupported '%#' with 'x%' in format string */
	char *new_format = (char *)malloc(strlen(format) + 1);
	if (!new_format)
		return -1;
	memcpy(new_format, format, strlen(format) + 1);
	{
		int off;
		char *f;
		for (off = 0, f = new_format; *f; off++, f++)
			if (f[0] == '%' && f[1] == '#') {
				f[0] = 'x';
				f[1] = '%';
			}
	}

	va_list va;

	va_start(va, format);
	dde_kit_vprintf(new_format, va);
	va_end(va);

	free(new_format);
	return 0;
}
Beispiel #2
0
/* basic functions */
int printk(const char *s, ...)
{
  va_list ap;
  va_start(ap, s);
  int cnt = dde_kit_vprintf(s, ap);
  va_end(ap);
  return cnt;
}