From 9f314c8b1e3e1c1ebfee21254530606d741d01b4 Mon Sep 17 00:00:00 2001 From: kugel Date: Tue, 3 Nov 2009 21:20:09 +0000 Subject: [PATCH] Rename vfnprintf to vuprintf (u stands for user for the user callback and data passed to it) to avoid confusion with file and buffer size related functions from the printf-family, and add a comment to its declaration. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23503 a1c6a512-1295-4272-9138-f99709370657 --- firmware/common/sprintf.c | 2 +- firmware/include/sprintf.h | 5 ++++- firmware/logf.c | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/firmware/common/sprintf.c b/firmware/common/sprintf.c index 6c1855e06..35f977a0a 100644 --- a/firmware/common/sprintf.c +++ b/firmware/common/sprintf.c @@ -292,7 +292,7 @@ int fdprintf(int fd, const char *fmt, ...) return fpr.bytes; /* return 0 on error */ } -int vfnprintf(int (*push)(void *userp, unsigned char data), void *userp, const char *fmt, va_list ap) +int vuprintf(int (*push)(void *userp, unsigned char data), void *userp, const char *fmt, va_list ap) { return format(push, userp, fmt, ap); } diff --git a/firmware/include/sprintf.h b/firmware/include/sprintf.h index b07ac9dfb..869b73eb1 100644 --- a/firmware/include/sprintf.h +++ b/firmware/include/sprintf.h @@ -32,6 +32,9 @@ int snprintf (char *buf, size_t size, const char *fmt, ...) int vsnprintf (char *buf, int size, const char *fmt, va_list ap); int fdprintf (int fd, const char *fmt, ...) ATTRIBUTE_PRINTF(2, 3); -int vfnprintf(int (*push)(void *userp, unsigned char data), void *userp, const char *fmt, va_list ap); +/* callback function is called for every output character (byte) with userp and + * should return 0 when ch is a char other than '\0' that should stop printing */ +int vuprintf(int (*push)(void *userp, unsigned char data), + void *userp, const char *fmt, va_list ap); #endif /* __SPRINTF_H__ */ diff --git a/firmware/logf.c b/firmware/logf.c index 76b017c09..7d4ffe24a 100644 --- a/firmware/logf.c +++ b/firmware/logf.c @@ -214,7 +214,7 @@ void _logf(const char *fmt, ...) DEBUGF("%s\n", buf); #endif - vfnprintf(logf_push, NULL, fmt, ap); + vuprintf(logf_push, NULL, fmt, ap); va_end(ap); /* add trailing zero */ -- 2.11.4.GIT