Don't copy util functions in client.c

This requires moving croak() to logging.c and avoiding use
of log functions in util.c.
This commit is contained in:
Miroslav Lichvar
2009-09-15 18:08:58 +02:00
parent 19f3a6bca8
commit 5a2b38378c
7 changed files with 28 additions and 62 deletions

View File

@@ -39,6 +39,7 @@
#include "cmdparse.h"
#include "pktlength.h"
#include "memory.h"
#include "util.h"
#ifdef FEAT_READLINE
#ifdef USE_EDITLINE
@@ -94,34 +95,6 @@ time_to_log_form(time_t t)
return buffer;
}
/* ================================================== */
static char *
UTI_RefidToString(unsigned long ref_id)
{
unsigned int a, b, c, d;
static char result[64];
a = (ref_id>>24) & 0xff;
b = (ref_id>>16) & 0xff;
c = (ref_id>> 8) & 0xff;
d = (ref_id>> 0) & 0xff;
snprintf(result, sizeof(result), "%c%c%c%c", a, b, c, d);
return result;
}
static char *
UTI_IPToDottedQuad(unsigned long ip)
{
unsigned long a, b, c, d;
static char result[64];
a = (ip>>24) & 0xff;
b = (ip>>16) & 0xff;
c = (ip>> 8) & 0xff;
d = (ip>> 0) & 0xff;
snprintf(result, sizeof(result), "%ld.%ld.%ld.%ld", a, b, c, d);
return result;
}
/* ================================================== */
/* Read a single line of commands from standard input. Eventually we
might want to use the GNU readline library. */