Macros | Typedefs | Enumerations | Functions
Nopoll Declarations: Common Nopoll declarations, Types, macros, and support functions.

Macros

#define FD_SETSIZE   4096
 Set a default I/O wait limit from the default, which is 64 sockets to 4096. More...
 
#define INT_TO_PTR(integer)   ((noPollPtr) (long) ((int)integer))
 Allows to convert integer value (including constant values) into a pointer representation. More...
 
#define INT_TO_PTR(integer)   ((noPollPtr) (integer))
 Allows to convert integer value (including constant values) into a pointer representation. More...
 
#define INT_TO_PTR(integer)   IntToPtr(integer)
 Allows to convert integer value (including constant values) into a pointer representation. More...
 
#define NOPOLL_64BIT_PLATFORM   (1)
 Indicates that this platform have support for 64bits. More...
 
#define NOPOLL_EWOULDBLOCK   EWOULDBLOCK
 Portable definition for EWOULDBLOCK errno code. More...
 
#define nopoll_false   ((int)0)
 Common definition to have false (nopoll_false) value (which is defined to 0 integer value). More...
 
#define NOPOLL_HAVE_SSLv23_ENABLED   (1)
 Indicates where we have support for SSL v.3 support. More...
 
#define NOPOLL_HAVE_SSLv3_ENABLED   (1)
 Indicates where we have support for SSL v3.0 support. More...
 
#define NOPOLL_HAVE_TLSv10_ENABLED   (1)
 Indicates where we have support for TLSv1.0 support. More...
 
#define NOPOLL_HAVE_TLSv10_ENABLED   (1)
 Indicates where we have support for TLSv1.0 support. More...
 
#define NOPOLL_HAVE_TLSv10_ENABLED   (1)
 Indicates where we have support for TLSv1.0 support. More...
 
#define NOPOLL_HAVE_TLSv11_ENABLED   (1)
 Indicates where we have support for TLSv1.1 support. More...
 
#define NOPOLL_HAVE_TLSv11_ENABLED   (1)
 Indicates where we have support for TLSv1.1 support. More...
 
#define NOPOLL_HAVE_TLSv11_ENABLED   (1)
 Indicates where we have support for TLSv1.1 support. More...
 
#define NOPOLL_HAVE_TLSv12_ENABLED   (1)
 Indicates where we have support for TLSv1.2 support. More...
 
#define NOPOLL_HAVE_TLSv12_ENABLED   (1)
 Indicates where we have support for TLSv1.2 support. More...
 
#define NOPOLL_HAVE_TLSv12_ENABLED   (1)
 Indicates where we have support for TLSv1.2 support. More...
 
#define nopoll_new(type, count)   (type *) nopoll_calloc (count, sizeof (type))
 Support macro to allocate memory using nopoll_calloc function, making a casting and using the sizeof keyword. More...
 
#define NOPOLL_OS_UNIX   (1)
 Allows to get current platform configuration. More...
 
#define NOPOLL_OS_WIN32   (1)
 Allows to get current platform configuration. More...
 
#define NOPOLL_OS_WIN32   (1)
 Allows to get current platform configuration. More...
 
#define NOPOLL_OS_WIN64   (1)
 If defined to1, it means we are compiling in a windows platform running 64 bit version. More...
 
#define nopoll_return_if_fail(ctx, expr)   if (!(expr)) {__nopoll_log (ctx, __function_name__, __file__, __line__, NOPOLL_LEVEL_CRITICAL, "Expresion '%s' have failed at %s (%s:%d)", #expr, __NOPOLL_PRETTY_FUNCTION__, __NOPOLL_FILE__, __NOPOLL_LINE__); return;}
 Allows to check a condition and return if it is not meet. More...
 
#define nopoll_return_val_if_fail(ctx, expr, val)   if (!(expr)) { __nopoll_log (ctx, __function_name__, __file__, __line__, NOPOLL_LEVEL_CRITICAL, "Expresion '%s' have failed, returning: %s at %s (%s:%d)", #expr, #val, __NOPOLL_PRETTY_FUNCTION__, __NOPOLL_FILE__, __NOPOLL_LINE__); return val;}
 Allows to check a condition and return the given value if it is not meet. More...
 
#define nopoll_true   ((int)1)
 Common definition to have true (nopoll_true) value (which is defined to 1 integer value). More...
 
#define PTR_TO_INT(ptr)   ((int) (long) (ptr))
 Allows to convert a pointer reference (noPollPtr), which stores an integer that was stored using INT_TO_PTR. More...
 
#define PTR_TO_INT(ptr)   ((int) (ptr))
 Allows to convert a pointer reference (noPollPtr), which stores an integer that was stored using INT_TO_PTR. More...
 
#define PTR_TO_INT(ptr)   PtrToInt((const void *) (ptr))
 Allows to convert a pointer reference (noPollPtr), which stores an integer that was stored using INT_TO_PTR. More...
 

Typedefs

typedef int nopoll_bool
 Bool definition for the Nopoll toolkit. More...
 
typedef struct _noPollConn noPollConn
 Abstraction that represents a connection that maybe be a listener created by nopoll_listener_new or because the connection was received as a consequence of that call, or because it is a client connection created by nopoll_conn_new. More...
 
typedef struct _noPollConnOpts noPollConnOpts
 Optional connection options to change default behaviour. More...
 
typedef struct _noPollCtx noPollCtx
 Execution context object used by the API to provide default settings. More...
 
typedef struct _noPollHandshake noPollHandShake
 Abstraction that represents the status and data exchanged during the handshake. More...
 
typedef struct _noPollIoEngine noPollIoEngine
 Abstraction that represents a selected IO wait mechanism. More...
 
typedef struct _noPollMsg noPollMsg
 Abstraction that represents a single websocket message received. More...
 
typedef void * noPollPtr
 Pointer to any structure definition. More...
 

Enumerations

enum  noPollDebugLevel { NOPOLL_LEVEL_DEBUG, NOPOLL_LEVEL_WARNING, NOPOLL_LEVEL_CRITICAL }
 Nopoll debug levels. More...
 
enum  noPollIoEngineType { NOPOLL_IO_ENGINE_DEFAULT, NOPOLL_IO_ENGINE_SELECT, NOPOLL_IO_ENGINE_POLL, NOPOLL_IO_ENGINE_EPOLL }
 List of supported IO waiting mechanism available. More...
 
enum  noPollOpCode {
  NOPOLL_UNKNOWN_OP_CODE = -1, NOPOLL_CONTINUATION_FRAME = 0, NOPOLL_TEXT_FRAME = 1, NOPOLL_BINARY_FRAME = 2,
  NOPOLL_CLOSE_FRAME = 8, NOPOLL_PING_FRAME = 9, NOPOLL_PONG_FRAME = 10
}
 Type of frames and opcodes supported by noPoll. More...
 
enum  noPollRole { NOPOLL_ROLE_UNKNOWN, NOPOLL_ROLE_CLIENT, NOPOLL_ROLE_LISTENER, NOPOLL_ROLE_MAIN_LISTENER }
 Describes the connection role (how it was initiated). More...
 
enum  noPollSslProtocol {
  NOPOLL_METHOD_SSLV23 = 2, NOPOLL_METHOD_SSLV3 = 3, NOPOLL_METHOD_TLSV1 = 4, NOPOLL_METHOD_TLSV1_1 = 5,
  NOPOLL_METHOD_TLSV1_2 = 6
}
 SSL/TLS protocol type to use for the client or listener connection. More...
 
enum  noPollTransport { NOPOLL_TRANSPORT_IPV4 = 1, NOPOLL_TRANSPORT_IPV6 = 2 }
 Transport indication to be used by various internal and public APIs. More...
 

Functions

noPollPtr nopoll_calloc (size_t count, size_t size)
 Calloc helper for nopoll library. More...
 
void nopoll_free (noPollPtr ref)
 Allows to deallocate memory referenced by ref but checking before that the reference is different from null. More...
 
noPollPtr nopoll_realloc (noPollPtr ref, size_t size)
 Realloc helper for nopoll library. More...
 

Detailed Description