MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
evutil.h File Reference
#include <config.h>
#include <stdarg.h>
Include dependency graph for evutil.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define ev_uint8_t   unsigned char
#define EVUTIL_CLOSESOCKET(s)   close(s)
#define EVUTIL_SOCKET_ERROR()   (errno)
#define EVUTIL_SET_SOCKET_ERROR(errcode)   do { errno = (errcode); } while (0)
#define evutil_timeradd(tvp, uvp, vvp)
#define evutil_timersub(tvp, uvp, vvp)
#define evutil_timerclear(tvp)   (tvp)->tv_sec = (tvp)->tv_usec = 0
#define evutil_timercmp(tvp, uvp, cmp)
#define evutil_timerisset(tvp)   ((tvp)->tv_sec || (tvp)->tv_usec)

Functions

int evutil_socketpair (int d, int type, int protocol, int sv[2])
int evutil_make_socket_nonblocking (int sock)
ev_int64_t evutil_strtoll (const char *s, char **endptr, int base)
int evutil_gettimeofday (struct timeval *tv, struct timezone *tz)
int evutil_snprintf (char *buf, size_t buflen, const char *format,...)
int evutil_vsnprintf (char *buf, size_t buflen, const char *format, va_list ap)

Detailed Description

Common convenience functions for cross-platform portability and related socket manipulations.

Definition in file evutil.h.

Macro Definition Documentation

#define evutil_timeradd (   tvp,
  uvp,
  vvp 
)
Value:
do { \
(vvp)->tv_sec = (tvp)->tv_sec + (uvp)->tv_sec; \
(vvp)->tv_usec = (tvp)->tv_usec + (uvp)->tv_usec; \
if ((vvp)->tv_usec >= 1000000) { \
(vvp)->tv_sec++; \
(vvp)->tv_usec -= 1000000; \
} \
} while (0)

Definition at line 126 of file evutil.h.

#define evutil_timercmp (   tvp,
  uvp,
  cmp 
)
Value:
(((tvp)->tv_sec == (uvp)->tv_sec) ? \
((tvp)->tv_usec cmp (uvp)->tv_usec) : \
((tvp)->tv_sec cmp (uvp)->tv_sec))

Definition at line 152 of file evutil.h.

#define evutil_timersub (   tvp,
  uvp,
  vvp 
)
Value:
do { \
(vvp)->tv_sec = (tvp)->tv_sec - (uvp)->tv_sec; \
(vvp)->tv_usec = (tvp)->tv_usec - (uvp)->tv_usec; \
if ((vvp)->tv_usec < 0) { \
(vvp)->tv_sec--; \
(vvp)->tv_usec += 1000000; \
} \
} while (0)

Definition at line 135 of file evutil.h.