From: Daniel Hokka Zakrisson Date: Thu, 3 Jan 2008 15:30:17 +0000 (+0000) Subject: Move WRITE_INT to util-io.h, so other programs can use it too. X-Git-Tag: release-0.30.215~57 X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d081f7a2c7a962ab3a6b65255f4be5e17cf4b276;p=util-vserver.git Move WRITE_INT to util-io.h, so other programs can use it too. git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@2650 94cd875c-1c1d-0410-91d2-eb244daf1a30 --- diff --git a/lib_internal/util-io.h b/lib_internal/util-io.h index 4f364b8..1f8cbec 100644 --- a/lib_internal/util-io.h +++ b/lib_internal/util-io.h @@ -21,6 +21,7 @@ #include #include +#include "ensc_fmt/fmt.h" inline static void UNUSED Vwrite(int fd, char const *buf, size_t len) @@ -34,6 +35,17 @@ writeStr(int fd, char const *cmd) Vwrite(fd, cmd, strlen(cmd)); } +inline static void UNUSED +WRITE_INT(int fd, int num) +{ + char buf[sizeof(num)*3+2]; + size_t l; + + l = utilvserver_fmt_long(buf,num); + + Vwrite(fd, buf, l); +} + #define WRITE_MSG(FD,X) Vwrite(FD,X,sizeof(X)-1) #define WRITE_STR(FD,X) writeStr(FD,X) diff --git a/src/h2ext.c b/src/h2ext.c index 50d3094..af1cc5a 100644 --- a/src/h2ext.c +++ b/src/h2ext.c @@ -210,17 +210,6 @@ byteswap(void *p, size_t len) } } -static inline ALWAYSINLINE void -WRITE_INT(int fd, int num) -{ - char buf[sizeof(num)*3+2]; - size_t l; - - l = utilvserver_fmt_long(buf,num); - - Vwrite(fd, buf, l); -} - static int load_description(const char *file, file_format_t **head) {