4# define INADDR_ANY ((unsigned long int) 0x00000000)
8# define INADDR_NONE ((unsigned long int) 0xffffffff)
12#define ISALNUM(c) ( (((c) >= 'A') && ((c) <= 'Z')) || (((c) >= 'a') && ((c) <= 'z')) || (((c) >= '0') && ((c) <= '9')) )
22 str[
sizeof(
str) - 1] =
'\0';
40 return ((
unsigned int)
ntohs((
unsigned short)
sp->s_port));
45 return ((
unsigned int)
ntohs((
unsigned short)
sp->s_port));
60 char *hostcp, *atsign, *colon, *
cp, *p2;
63 strncpy(portstr,
s,
sizeof(portstr));
64 portstr[
sizeof(portstr) - 1] =
'\0';
68 if ((colon[1] ==
'/') && (colon[2] ==
'/')) {
72 for (
cp = hostcp; *
cp !=
'\0';
cp++) {
95 }
else if ((atsign =
strchr(portstr,
'@')) !=
NULL) {
100 }
else if (defaultport > 0) {
102 port = (
unsigned int) defaultport;
117 sa->sin_addr.s_addr = ipnum;
138 const char *addrNamePtr;
157 for (dp =
dst, dlim = dp + dsize - 1; ;
fmt++) {
160 }
else if (*
fmt ==
'%') {
165 }
else if (*
fmt ==
'p') {
171 }
else if (*
fmt ==
'h') {
172 if (addrNamePtr !=
NULL) {
177 for ( ; *
cp !=
'\0';
cp++)
181 }
else if (*
fmt ==
's') {
191 for ( ; *
cp !=
'\0';
cp++)
196 }
else if ((*
fmt ==
't') || (*
fmt ==
'u')) {
204 for ( ; *
cp !=
'\0';
cp++)
209 }
else if (*
fmt ==
'\0') {
215 }
else if (dp < dlim) {
char * AddrToAddrStr(char *const dst, size_t dsize, struct sockaddr_in *const saddrp, int dns, const char *fmt)
static unsigned int ServiceNameToPortNumber(const char *const s)
int AddrStrToAddr(const char *const s, struct sockaddr_in *const sa, const int defaultport)
char * strncpy(char *DstString, const char *SrcString, ACPI_SIZE Count)
char * strchr(const char *String, int ch)
static struct sockaddr_in sa
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
PSERVENT WSAAPI getservbyport(IN int port, IN const char FAR *proto)
PHOSTENT WSAAPI gethostbyname(IN const char FAR *name)
PSERVENT WSAAPI getservbyname(IN const char FAR *name, IN const char FAR *proto)
PHOSTENT WSAAPI gethostbyaddr(IN const char FAR *addr, IN int len, IN int type)
_Check_return_ int __cdecl atoi(_In_z_ const char *_Str)
#define memcpy(s1, s2, n)
#define kAddrStrToAddrBadHost
#define kAddrStrToAddrMiscErr
#define sprintf(buf, format,...)