ReactOS 0.4.17-dev-423-ged51a5d
wine.c File Reference
#include <ws2_32.h>
#include <debug.h>
Include dependency graph for wine.c:

Go to the source code of this file.

Macros

#define NDEBUG
 
#define TRACE(...)
 

Functions

u_long WINAPI inet_addr (const char *str)
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 27 of file wine.c.

◆ TRACE

#define TRACE (   ...)

Definition at line 30 of file wine.c.

Function Documentation

◆ inet_addr()

u_long WINAPI inet_addr ( const char str)

Definition at line 35 of file wine.c.

36{
37 unsigned long a[4] = { 0 };
38 const char *s = str;
39 unsigned char *d;
40 unsigned int i;
42 char *z;
43
44 TRACE( "str %s.\n", debugstr_a(str) );
45
46 if (!s)
47 {
49 return INADDR_NONE;
50 }
51
52 d = (unsigned char *)&addr;
53
54 if (s[0] == ' ' && !s[1]) return 0;
55
56 for (i = 0; i < 4; ++i)
57 {
58 a[i] = strtoul( s, &z, 0 );
59 if (z == s || !isdigit( *s )) return INADDR_NONE;
60 if (!*z || isspace(*z)) break;
61 if (*z != '.') return INADDR_NONE;
62 s = z + 1;
63 }
64
65 if (i == 4) return INADDR_NONE;
66
67 switch (i)
68 {
69 case 0:
70 a[1] = a[0] & 0xffffff;
71 a[0] >>= 24;
72 /* fallthrough */
73 case 1:
74 a[2] = a[1] & 0xffff;
75 a[1] >>= 16;
76 /* fallthrough */
77 case 2:
78 a[3] = a[2] & 0xff;
79 a[2] >>= 8;
80 }
81 for (i = 0; i < 4; ++i)
82 {
83 if (a[i] > 255) return INADDR_NONE;
84 d[i] = a[i];
85 }
86 return addr;
87}
#define isspace(c)
Definition: acclib.h:69
#define isdigit(c)
Definition: acclib.h:68
#define INADDR_NONE
Definition: tcp.c:42
#define SetLastError(x)
Definition: compat.h:752
_ACRTIMP __msvcrt_ulong __cdecl strtoul(const char *, char **, int)
Definition: string.c:1864
__msvcrt_ulong u_long
Definition: types.h:53
GLdouble s
Definition: gl.h:2039
GLenum const GLvoid * addr
Definition: glext.h:9621
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
GLdouble GLdouble z
Definition: glext.h:5874
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define d
Definition: ke_i.h:81
#define debugstr_a
Definition: kernel32.h:31
const WCHAR * str
#define TRACE(...)
Definition: wine.c:30
#define WSAEFAULT
Definition: winerror.h:2844

Referenced by __rpc_uaddr2taddr_af(), AcceptProc(), Addhost(), AddrStrToAddr(), adns_inet_aton(), client_start(), Telnet::Connect(), ConvertAddCmdLine(), Deletehost(), Dns_Ip4StringToAddress_A(), GetAdaptersInfo(), GetHostByName(), GetHostEntry(), hookup(), init_leases_list(), InitializePropertyDialog(), NetBTinetResolve(), NetBTInit(), netfinger(), oob_server(), open_http(), Query_Main(), ReadIpConfiguration(), select_server(), SendRequest(), server_start(), server_thread(), Setup(), setup_iocp_src(), simple_mixed_client(), simple_server(), START_TEST(), tcp_connect(), tcp_socketpair(), tcp_socketpair_ovl(), Test_CloseWhileSelectDuplicatedSocket(), Test_CloseWhileSelectSameSocket(), test_events(), test_ip_pktinfo(), test_select(), test_send(), test_sendto(), test_set_getsockopt(), TestSend(), TestSendTo(), TestTcp(), TestUdp(), WSAttemptAutodialName(), and WspiapiParseV4Address().