*/
#ifdef _WIN32
-#include <ratbox_lib.h>
+#include <rb_lib.h>
#include "getaddrinfo.h"
-
-/* $Id$ */
+#include "stdinc.h"
static const char in_addrany[] = { 0, 0, 0, 0 };
static const char in_loopback[] = { 127, 0, 0, 1 };
#define PTON_MAX 16
-static int str_isnumber(const char *);
+static bool str_isnumber(const char *);
static int explore_null(const struct rb_addrinfo *,
const char *, struct rb_addrinfo **);
static int explore_numeric(const struct rb_addrinfo *, const char *,
} while (ai);
}
-static int
+static bool
str_isnumber(const char *p)
{
char *ep;
if (*p == '\0')
- return NO;
+ return false;
+
ep = NULL;
errno = 0;
(void)strtoul(p, &ep, 10);
if (errno == 0 && ep && *ep == '\0')
- return YES;
+ return true;
else
- return NO;
+ return false;
}
int
{
char *p;
struct rb_addrinfo *ai;
-
+
ai = (struct rb_addrinfo *)rb_malloc(sizeof(struct rb_addrinfo)
+ (afd->a_socklen));
if (ai == NULL)
get_portmatch(const struct rb_addrinfo *ai, const char *servname)
{
struct rb_addrinfo xai;
- memcpy(&xai, ai, sizeof(struct rb_addrinfo));
+ memcpy(&xai, ai, sizeof(struct rb_addrinfo));
return(get_port(&xai, servname, 1));
}