From 4daad9004d8f07991516970a1cbd77756fae7041 Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Thu, 27 Sep 2007 10:20:47 +0000 Subject: introduce bb_putchar(). saves ~1800 on uclibc (less on glibc). --- include/libbb.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/libbb.h b/include/libbb.h index 26a0f0d4a..2f5aa6077 100644 --- a/include/libbb.h +++ b/include/libbb.h @@ -391,11 +391,13 @@ ssize_t recv_from_to(int fd, void *buf, size_t len, int flags, struct sockaddr *from, struct sockaddr *to, socklen_t sa_size); - -extern char *xstrdup(const char *s); -extern char *xstrndup(const char *s, int n); -extern char *safe_strncpy(char *dst, const char *src, size_t size); -extern char *xasprintf(const char *format, ...) __attribute__ ((format (printf, 1, 2))); +char *xstrdup(const char *s); +char *xstrndup(const char *s, int n); +char *safe_strncpy(char *dst, const char *src, size_t size); +/* Guaranteed to NOT be a macro (smallest code). Saves nearly 2k on uclibc. +/* But potentially slow, don't use in one-billion-times loops */ +int bb_putchar(int ch); +char *xasprintf(const char *format, ...) __attribute__ ((format (printf, 1, 2))); // gcc-4.1.1 still isn't good enough at optimizing it // (+200 bytes compared to macro) //static ALWAYS_INLINE -- cgit v1.2.3