ReactOS  0.4.13-dev-92-gf251225
adns_win32.h File Reference
#include <stdlib.h>
#include <stdio.h>
#include <windef.h>
#include <winbase.h>
#include <objbase.h>
#include <winsock2.h>
#include <sys/types.h>
#include <time.h>
#include <errno.h>
#include <assert.h>
#include <limits.h>
#include <malloc.h>
#include <signal.h>
Include dependency graph for adns_win32.h:

Go to the source code of this file.

Classes

struct  iovec
 

Macros

#define ADNS_API
 
#define WIN32_NO_STATUS
 
#define _INC_WINDOWS
 
#define COM_NO_WINDOWS_H
 
#define HAVE_WINSOCK   1
 
#define inline   __inline
 
#define ADNS_SOCKET   SOCKET
 
#define adns_socket_close(sck)   closesocket(sck)
 
#define adns_socket_read(sck, data, len)   recv(sck, (char *)data, len, 0)
 
#define adns_socket_write(sck, data, len)   send(sck, (char *)data, len, 0)
 
#define ADNS_CAPTURE_ERRNO   {errno = WSAGetLastError(); WSASetLastError(errno);}
 
#define ADNS_CLEAR_ERRNO   {WSASetLastError(errno = 0);}
 
#define ENOBUFS   WSAENOBUFS
 
#define EWOULDBLOCK   WSAEWOULDBLOCK
 
#define EINPROGRESS   WSAEINPROGRESS
 
#define EMSGSIZE   WSAEMSGSIZE
 
#define ENOPROTOOPT   WSAENOPROTOOPT
 
#define ECONNRESET   WSAECONNRESET
 
#define gettimeofday(tv, tz)   adns_gettimeofday(tv, tz)
 
#define writev(FileDescriptor, iov, iovCount)   adns_writev(FileDescriptor, iov, iovCount)
 
#define inet_aton(ap, inp)   adns_inet_aton(ap, inp)
 
#define getpid()   adns_getpid()
 

Functions

ADNS_API int adns_gettimeofday (struct timeval *tv, struct timezone *tz)
 
ADNS_API int adns_writev (int FileDescriptor, const struct iovec *iov, int iovCount)
 
ADNS_API int adns_inet_aton (const char *cp, struct in_addr *inp)
 
ADNS_API int adns_getpid ()
 

Macro Definition Documentation

◆ _INC_WINDOWS

#define _INC_WINDOWS

Definition at line 79 of file adns_win32.h.

◆ ADNS_API

#define ADNS_API

Definition at line 66 of file adns_win32.h.

◆ ADNS_CAPTURE_ERRNO

#define ADNS_CAPTURE_ERRNO   {errno = WSAGetLastError(); WSASetLastError(errno);}

Definition at line 107 of file adns_win32.h.

◆ ADNS_CLEAR_ERRNO

#define ADNS_CLEAR_ERRNO   {WSASetLastError(errno = 0);}

Definition at line 108 of file adns_win32.h.

◆ ADNS_SOCKET

#define ADNS_SOCKET   SOCKET

Definition at line 98 of file adns_win32.h.

◆ adns_socket_close

#define adns_socket_close (   sck)    closesocket(sck)

Definition at line 99 of file adns_win32.h.

◆ adns_socket_read

#define adns_socket_read (   sck,
  data,
  len 
)    recv(sck, (char *)data, len, 0)

Definition at line 100 of file adns_win32.h.

◆ adns_socket_write

#define adns_socket_write (   sck,
  data,
  len 
)    send(sck, (char *)data, len, 0)

Definition at line 101 of file adns_win32.h.

◆ COM_NO_WINDOWS_H

#define COM_NO_WINDOWS_H

Definition at line 80 of file adns_win32.h.

◆ ECONNRESET

#define ECONNRESET   WSAECONNRESET

Definition at line 123 of file adns_win32.h.

◆ EINPROGRESS

#define EINPROGRESS   WSAEINPROGRESS

Definition at line 120 of file adns_win32.h.

◆ EMSGSIZE

#define EMSGSIZE   WSAEMSGSIZE

Definition at line 121 of file adns_win32.h.

◆ ENOBUFS

#define ENOBUFS   WSAENOBUFS

Definition at line 110 of file adns_win32.h.

◆ ENOPROTOOPT

#define ENOPROTOOPT   WSAENOPROTOOPT

Definition at line 122 of file adns_win32.h.

◆ EWOULDBLOCK

#define EWOULDBLOCK   WSAEWOULDBLOCK

Definition at line 118 of file adns_win32.h.

◆ getpid

#define getpid (   void)    adns_getpid()

Definition at line 162 of file adns_win32.h.

◆ gettimeofday

#define gettimeofday (   tv,
  tz 
)    adns_gettimeofday(tv, tz)

Definition at line 159 of file adns_win32.h.

◆ HAVE_WINSOCK

#define HAVE_WINSOCK   1

Definition at line 94 of file adns_win32.h.

◆ inet_aton

#define inet_aton (   ap,
  inp 
)    adns_inet_aton(ap, inp)

Definition at line 161 of file adns_win32.h.

◆ inline

#define inline   __inline

Definition at line 96 of file adns_win32.h.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 78 of file adns_win32.h.

◆ writev

#define writev (   FileDescriptor,
  iov,
  iovCount 
)    adns_writev(FileDescriptor, iov, iovCount)

Definition at line 160 of file adns_win32.h.

Function Documentation

◆ adns_getpid()

ADNS_API int adns_getpid ( )

Definition at line 75 of file adns_unix_calls.c.

76 {
77  return GetCurrentProcessId();
78 }
DWORD WINAPI GetCurrentProcessId(VOID)
Definition: proc.c:1188

◆ adns_gettimeofday()

ADNS_API int adns_gettimeofday ( struct timeval tv,
struct timezone tz 
)

◆ adns_inet_aton()

ADNS_API int adns_inet_aton ( const char cp,
struct in_addr inp 
)

Definition at line 56 of file adns_unix_calls.c.

57 {
58  if (!cp || !*cp || !inp)
59  {
60  errno = EINVAL;
61  return -1;
62  }
63 
64  if (!strcmp(cp, "255.255.255.255"))
65  {
66  // Special case
67  inp->s_addr = INADDR_NONE;
68  return 0;
69  }
70 
71  inp->s_addr = inet_addr(cp);
72  return (inp->s_addr == INADDR_NONE) ? -1 : 0;
73 }
#define inet_addr(cp)
Definition: inet.h:98
Definition: arc.h:39
#define INADDR_NONE
Definition: tcp.c:42
int errno
u32_t s_addr
Definition: inet.h:45
POINT cp
Definition: magnifier.c:60
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469

◆ adns_writev()

ADNS_API int adns_writev ( int  FileDescriptor,
const struct iovec iov,
int  iovCount 
)

Definition at line 33 of file adns_unix_calls.c.

34 {
35  size_t total_len = 0;
36  int i = 0, r = 0;
37  char *buf = NULL, *p = NULL;
38 
39  for(; i < iovCount; i++)
40  total_len += iov[i].iov_len;
41 
42  p = buf = (char *)_alloca(total_len);
43 
44  for(; i < iovCount; i++)
45  {
46  memcpy(p, iov[i].iov_base, iov[i].iov_len);
47  p += iov[i].iov_len;
48  }
49 
51  r = send(FileDescriptor, buf, total_len, 0);
53  return r;
54 }
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
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
__kernel_size_t iov_len
Definition: linux.h:1702
smooth NULL
Definition: ftsmooth.c:416
#define ADNS_CLEAR_ERRNO
Definition: adns_win32.h:108
INT WSAAPI send(IN SOCKET s, IN CONST CHAR FAR *buf, IN INT len, IN INT flags)
Definition: send.c:23
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define ADNS_CAPTURE_ERRNO
Definition: adns_win32.h:107
GLfloat GLfloat p
Definition: glext.h:8902