Esempio n. 1
0
int
vcprintf(const char *fmt, va_list ap)
{
  int cnt = 0;

  vprintfmt((void*)putch, &cnt, fmt, ap);
  return cnt;
}
Esempio n. 2
0
void printk(const char *fmt, ...)
{
	va_list va;

	va_start(va, fmt);
	vprintfmt(__putchar, fmt, &va);
	va_end(va);
}
Esempio n. 3
0
void lwip_print (const char *fmt, ...){
  va_list vargs;

  va_start(vargs, fmt);
  print("[net/tcpip] INFO: lwip: ");
  vprintfmt(fmt, vargs);
  va_end(vargs);
}
int vcprintf(const char *fmt, va_list ap) {
	struct printbuf b;

	b.idx = 0;
	b.cnt = 0;
	vprintfmt((void*) putch, &b, fmt, ap);
	sys_cputs(b.buf, b.idx);

	return b.cnt;
}
Esempio n. 5
0
/* *
 * vcprintf - format a string and writes it to stdout
 *
 * The return value is the number of characters which would be
 * written to stdout.
 *
 * Call this function if you are already dealing with a va_list.
 * Or you probably want cprintf() instead.
 * */
int vkprintf(const char *fmt, va_list ap)
{
	int cnt = 0;
	int flag;
	local_intr_save_hw(flag);
	spinlock_acquire(&kprintf_lock);
	vprintfmt((void *)cputch, NO_FD, &cnt, fmt, ap);
	spinlock_release(&kprintf_lock);
	local_intr_restore_hw(flag);
	return cnt;
}
Esempio n. 6
0
int
vcprintf(const char *fmt, va_list ap)
{
	int cnt = 0;
    va_list aq;
    va_copy(aq,ap);
	vprintfmt((void*)putch, &cnt, fmt, aq);
    va_end(aq);
	return cnt;

}
Esempio n. 7
0
int
vsnprintf(char *buf, int n, const char *fmt, va_list ap)
{
	assert(buf != NULL && n > 0);
	struct sprintbuf b = {buf, buf+n-1, 0};

	// print the string to the buffer
	vprintfmt((void*)sprintputch, &b, fmt, ap);

	// null terminate the buffer
	*b.buf = '\0';

	return b.cnt;
}
Esempio n. 8
0
int
vsprintf(char *buf, const char *fmt, va_list ap)
{
	assert(buf != NULL);
	struct sprintbuf b = {buf, (char*)(intptr_t)~0, 0};

	// print the string to the buffer
	vprintfmt((void*)sprintputch, &b, fmt, ap);

	// null terminate the buffer
	*b.buf = '\0';

	return b.cnt;
}
Esempio n. 9
0
int
vfprintf(int fd, const char *fmt, va_list ap)
{
	struct printbuf b;

	b.fd = fd;
	b.idx = 0;
	b.result = 0;
	b.error = 1;
	vprintfmt(putch, &b, fmt, ap);
	if (b.idx > 0)
		writebuf(&b);

	return (b.result ? b.result : b.error);
}
Esempio n. 10
0
int
vfprintf(int fd, const char *fmt, va_list ap) {
    int cnt = 0;
    vprintfmt((void*)fputch, fd, &cnt, fmt, ap);
    return cnt;
}
Esempio n. 11
0
/* *
 * vkprintf - format a string and writes it to stdout
 *
 * The return value is the number of characters which would be
 * written to stdout.
 *
 * Call this function if you are already dealing with a va_list.
 * Or you probably want kprintf() instead.
 * */
int
vkprintf(const char *fmt, va_list ap) {
    int cnt = 0;
    vprintfmt((void*)cputch, NO_FD, &cnt, fmt, ap);
    return cnt;
}
Esempio n. 12
0
int	vprintk(const char *fmt,va_list ap){ 
	int cnt=0;
	vprintfmt(putch,(void *)&cnt,fmt,ap);
	return cnt;
}