mirror of
https://github.com/checkpoint-restore/criu
synced 2025-09-01 06:45:35 +00:00
compel std: rename printing functions
Let's rename the printing functions so their names look more like the standard ones. 1. putc/puts with a file descriptor. __std_putc -> std_dputc __std_puts -> std_dputs There are no standard putc/puts that accept fd as an argument, but the libc convention is to use d prefix for such. Therefore: NOTE we keep the order of the arguments intact, to be in line with the rest of the functions. 2. *printf __std_printk -> std_vdprintf __std_printf -> std_dprintf The reason is, these are the names of libc functions with similar functionality/arguments. Cc: Dmitry Safonov <dsafonov@virtuozzo.com> Cc: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by: Kir Kolyshkin <kir@openvz.org> Reviewed-by: Dmitry Safonov <dsafonov@virtuozzo.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
This commit is contained in:
committed by
Andrei Vagin
parent
026968f63a
commit
8b745876da
@@ -11,16 +11,15 @@
|
||||
#define STDERR_FILENO 2 /* Standard error output. */
|
||||
|
||||
|
||||
extern void __std_putc(int fd, char c);
|
||||
extern void __std_puts(int fd, const char *s);
|
||||
extern void __std_printk(int fd, const char *format, va_list args);
|
||||
extern void __std_printf(int fd, const char *format, ...)
|
||||
extern void std_dputc(int fd, char c);
|
||||
extern void std_dputs(int fd, const char *s);
|
||||
extern void std_vdprintf(int fd, const char *format, va_list args);
|
||||
extern void std_dprintf(int fd, const char *format, ...)
|
||||
__attribute__ ((__format__ (__printf__, 2, 3)));
|
||||
|
||||
|
||||
#define std_printf(fmt, ...) __std_printf(STDOUT_FILENO, fmt, ##__VA_ARGS__)
|
||||
#define std_puts(s) __std_puts(STDOUT_FILENO, s)
|
||||
#define std_putchar(c) __std_putc(STDOUT_FILENO, c)
|
||||
#define std_printf(fmt, ...) std_dprintf(STDOUT_FILENO, fmt, ##__VA_ARGS__)
|
||||
#define std_puts(s) std_dputs(STDOUT_FILENO, s)
|
||||
#define std_putchar(c) std_dputc(STDOUT_FILENO, c)
|
||||
|
||||
extern unsigned long std_strtoul(const char *nptr, char **endptr, int base);
|
||||
extern int std_strcmp(const char *cs, const char *ct);
|
||||
|
Reference in New Issue
Block a user