예제 #1
0
int
vcprintf(const char *fmt, va_list ap)
{
  int cnt = 0;

  vprintfmt((void*)putch, &cnt, fmt, ap);
  return cnt;
}
예제 #2
0
파일: printk.c 프로젝트: waynecw/cwos
void printk(const char *fmt, ...)
{
	va_list va;

	va_start(va, fmt);
	vprintfmt(__putchar, fmt, &va);
	va_end(va);
}
예제 #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;
}
예제 #5
0
파일: kio.c 프로젝트: Aresthu/ucore_plus
/* *
 * 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;
}
예제 #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;

}
예제 #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;
}
예제 #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;
}
예제 #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);
}
예제 #10
0
파일: stdio.c 프로젝트: spinlock/ucore
int
vfprintf(int fd, const char *fmt, va_list ap) {
    int cnt = 0;
    vprintfmt((void*)fputch, fd, &cnt, fmt, ap);
    return cnt;
}
예제 #11
0
파일: stdio.c 프로젝트: TySag/project
/* *
 * 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;
}
예제 #12
0
int	vprintk(const char *fmt,va_list ap){ 
	int cnt=0;
	vprintfmt(putch,(void *)&cnt,fmt,ap);
	return cnt;
}