client: eliminate client_printf()
This commit is contained in:
@@ -241,11 +241,4 @@ void
|
|||||||
client_new(EventLoop &loop, Partition &partition,
|
client_new(EventLoop &loop, Partition &partition,
|
||||||
UniqueSocketDescriptor fd, SocketAddress address, int uid) noexcept;
|
UniqueSocketDescriptor fd, SocketAddress address, int uid) noexcept;
|
||||||
|
|
||||||
/**
|
|
||||||
* Write a printf-like formatted string to the client.
|
|
||||||
*/
|
|
||||||
gcc_printf(2,3)
|
|
||||||
void
|
|
||||||
client_printf(Client &client, const char *fmt, ...);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -19,11 +19,8 @@
|
|||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "Client.hxx"
|
#include "Client.hxx"
|
||||||
#include "util/FormatString.hxx"
|
|
||||||
#include "util/AllocatedString.hxx"
|
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdarg.h>
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
Client::Write(const void *data, size_t length)
|
Client::Write(const void *data, size_t length)
|
||||||
@@ -37,19 +34,3 @@ Client::Write(const char *data)
|
|||||||
{
|
{
|
||||||
return Write(data, strlen(data));
|
return Write(data, strlen(data));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
client_vprintf(Client &client, const char *fmt, va_list args)
|
|
||||||
{
|
|
||||||
client.Write(FormatStringV(fmt, args).c_str());
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
client_printf(Client &client, const char *fmt, ...)
|
|
||||||
{
|
|
||||||
va_list args;
|
|
||||||
|
|
||||||
va_start(args, fmt);
|
|
||||||
client_vprintf(client, fmt, args);
|
|
||||||
va_end(args);
|
|
||||||
}
|
|
||||||
|
Reference in New Issue
Block a user