Ruby 2.7.0p0(2019-12-25revision647ee6f091eafcce70ffb75ddf7e121e192ab217)

Macros | Functions | Variables
option.c File Reference
`#include "rubysocket.h"`

Go to the source code of this file.

## Macros
#define | pack_var(v) rb_str_new((const char *)&(v), sizeof(v))
#define | CAT(x, y) x##y
#define | XCAT(x, y) CAT(x,y)
#define | TYPE_IP_MULTICAST_LOOP byte
#define | TYPE_IP_MULTICAST_TTL byte
#define | USE_INSPECT_BYTE 1
#define | check_size(len, size)
#define | inspect_ipv4_multicast_loop(a, b, c, d) XCAT(inspect_,TYPE_IP_MULTICAST_LOOP)(a,b,c,d)
#define | inspect_ipv4_multicast_ttl(a, b, c, d) XCAT(inspect_,TYPE_IP_MULTICAST_TTL)(a,b,c,d)
#define | IFNAMSIZ (sizeof(unsigned int)*3+1)

## Functions
VALUE | rsock_sockopt_new (int family, int level, int optname, VALUE data)
const char * | inet_ntop (int af, const void *addr, char *numaddr, size_t numaddr_len)
void | rsock_init_sockopt (void)

## Variables
VALUE | rb_cSockOpt

## Macro Definition Documentation

## ◆ CAT

#define CAT | ( |  | x,
|  |  | y
| ) |  | x##y

Definition at line 7 of file option.c.

## ◆ check_size

#define check_size | ( |  | len,
|  |  | size
| ) |  |

Value:
((len) == (size) ? \
(void)0 : \
rb_raise(rb_eTypeError, "size differ. expected as "#size"=%d but %ld", \
(int)size, (long)(len)))

Definition at line 30 of file option.c.

## ◆ IFNAMSIZ

#define IFNAMSIZ (sizeof(unsigned int)*3+1)

## ◆ inspect_ipv4_multicast_loop

#define inspect_ipv4_multicast_loop | ( |  | a,
|  |  | b,
|  |  | c,
|  |  | d
| ) |  | XCAT(inspect_,TYPE_IP_MULTICAST_LOOP)(a,b,c,d)

Definition at line 430 of file option.c.

## ◆ inspect_ipv4_multicast_ttl

#define inspect_ipv4_multicast_ttl | ( |  | a,
|  |  | b,
|  |  | c,
|  |  | d
| ) |  | XCAT(inspect_,TYPE_IP_MULTICAST_TTL)(a,b,c,d)

Definition at line 481 of file option.c.

## ◆ pack_var

#define pack_var | ( |  | v | ) | rb_str_new((const char *)&(v), sizeof(v))

Definition at line 5 of file option.c.

## ◆ TYPE_IP_MULTICAST_LOOP

#define TYPE_IP_MULTICAST_LOOP byte

Definition at line 25 of file option.c.

## ◆ TYPE_IP_MULTICAST_TTL

#define TYPE_IP_MULTICAST_TTL byte

Definition at line 26 of file option.c.

## ◆ USE_INSPECT_BYTE

#define USE_INSPECT_BYTE 1

Definition at line 27 of file option.c.

## ◆ XCAT

#define XCAT | ( |  | x,
|  |  | y
| ) |  | CAT(x,y)

Definition at line 8 of file option.c.

## Function Documentation

## ◆ inet_ntop()

const char* inet_ntop | ( | int | af,
|  | const void * | addr,
|  | char * | numaddr,
|  | size_t | numaddr_len
| ) |  |

Definition at line 651 of file option.c.

References memcpy(), and snprintf().

## ◆ rsock_init_sockopt()

void rsock_init_sockopt | ( | void |  | ) |

Definition at line 1438 of file option.c.

References rb_cObject, rb_cSocket, rb_cSockOpt, rb_define_class_under(), and rb_define_method().

Referenced by rsock_init_socket_init().

## ◆ rsock_sockopt_new()

VALUE rsock_sockopt_new | ( | int | family,
|  | int | level,
|  | int | optname,
|  | VALUE | data
| ) |  |

Definition at line 107 of file option.c.

References NEWOBJ_OF, obj, rb_cSockOpt, StringValue(), and T_OBJECT.

## Variable Documentation

## ◆ rb_cSockOpt

VALUE rb_cSockOpt

Definition at line 3 of file option.c.

Referenced by rsock_init_sockopt(), and rsock_sockopt_new().

void
void
Definition: rb_mjit_min_header-2.7.0.h:13273
rb_raise
void rb_raise(VALUE exc, const char *fmt,...)
Definition: error.c:2669
long
#define long
Definition: rb_mjit_min_header-2.7.0.h:2880
rb_eTypeError
VALUE rb_eTypeError
Definition: error.c:922
size
int size
Definition: encoding.c:58
len
uint8_t len
Definition: escape.c:17