Classes | Macros | Functions | Variables
uv-common.c File Reference
#include "uv.h"
#include "uv-common.h"
#include <assert.h>
#include <errno.h>
#include <stdarg.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <net/if.h>
#include <sys/un.h>
Include dependency graph for uv-common.c:

Go to the source code of this file.

Classes

struct  uv__allocator_t
 

Macros

#define uv__fs_scandir_free   free
 
#define UV_ERR_NAME_GEN(name, _)   case UV_ ## name: return #name;
 
#define UV_ERR_NAME_GEN_R(name, _)
 
#define UV_STRERROR_GEN(name, msg)   case UV_ ## name: return msg;
 
#define UV_STRERROR_GEN_R(name, msg)
 
#define X(uc, lc)   case UV_##uc: type = #lc; break;
 
#define XX(uc, lc)   case UV_##uc: return sizeof(uv_##lc##_t);
 

Functions

void * uv__calloc (size_t count, size_t size)
 
size_t uv__count_bufs (const uv_buf_t bufs[], unsigned int nbufs)
 
void uv__free (void *ptr)
 
uv_dirent_type_t uv__fs_get_dirent_type (uv__dirent_t *dent)
 
void uv__fs_readdir_cleanup (uv_fs_t *req)
 
void uv__fs_scandir_cleanup (uv_fs_t *req)
 
static unsigned intuv__get_nbufs (uv_fs_t *req)
 
void * uv__malloc (size_t size)
 
static void uv__print_handles (uv_loop_t *loop, int only_active, FILE *stream)
 
void * uv__realloc (void *ptr, size_t size)
 
void * uv__reallocf (void *ptr, size_t size)
 
char * uv__strdup (const char *s)
 
char * uv__strndup (const char *s, size_t n)
 
int uv__udp_check_before_send (uv_udp_t *handle, const struct sockaddr *addr)
 
int uv__udp_is_connected (uv_udp_t *handle)
 
static const char * uv__unknown_err_code (int err)
 
uv_buf_t uv_buf_init (char *base, unsigned int len)
 
uv_loop_tuv_default_loop (void)
 
const char * uv_err_name (int err)
 
char * uv_err_name_r (int err, char *buf, size_t buflen)
 
void uv_free_cpu_info (uv_cpu_info_t *cpu_infos, int count)
 
int uv_fs_event_getpath (uv_fs_event_t *handle, char *buffer, size_t *size)
 
int uv_fs_scandir_next (uv_fs_t *req, uv_dirent_t *ent)
 
size_t uv_handle_size (uv_handle_type type)
 
int uv_has_ref (const uv_handle_t *handle)
 
int uv_ip4_addr (const char *ip, int port, struct sockaddr_in *addr)
 
int uv_ip4_name (const struct sockaddr_in *src, char *dst, size_t size)
 
int uv_ip6_addr (const char *ip, int port, struct sockaddr_in6 *addr)
 
int uv_ip6_name (const struct sockaddr_in6 *src, char *dst, size_t size)
 
int uv_loop_close (uv_loop_t *loop)
 
int uv_loop_configure (uv_loop_t *loop, uv_loop_option option,...)
 
void uv_loop_delete (uv_loop_t *loop)
 
uv_loop_tuv_loop_new (void)
 
size_t uv_loop_size (void)
 
uint64_t uv_now (const uv_loop_t *loop)
 
void uv_os_free_environ (uv_env_item_t *envitems, int count)
 
void uv_print_active_handles (uv_loop_t *loop, FILE *stream)
 
void uv_print_all_handles (uv_loop_t *loop, FILE *stream)
 
int uv_recv_buffer_size (uv_handle_t *handle, int *value)
 
void uv_ref (uv_handle_t *handle)
 
int uv_replace_allocator (uv_malloc_func malloc_func, uv_realloc_func realloc_func, uv_calloc_func calloc_func, uv_free_func free_func)
 
size_t uv_req_size (uv_req_type type)
 
int uv_send_buffer_size (uv_handle_t *handle, int *value)
 
void uv_stop (uv_loop_t *loop)
 
const char * uv_strerror (int err)
 
char * uv_strerror_r (int err, char *buf, size_t buflen)
 
int uv_tcp_bind (uv_tcp_t *handle, const struct sockaddr *addr, unsigned int flags)
 
int uv_tcp_connect (uv_connect_t *req, uv_tcp_t *handle, const struct sockaddr *addr, uv_connect_cb cb)
 
int uv_udp_bind (uv_udp_t *handle, const struct sockaddr *addr, unsigned int flags)
 
int uv_udp_connect (uv_udp_t *handle, const struct sockaddr *addr)
 
int uv_udp_recv_start (uv_udp_t *handle, uv_alloc_cb alloc_cb, uv_udp_recv_cb recv_cb)
 
int uv_udp_recv_stop (uv_udp_t *handle)
 
int uv_udp_send (uv_udp_send_t *req, uv_udp_t *handle, const uv_buf_t bufs[], unsigned int nbufs, const struct sockaddr *addr, uv_udp_send_cb send_cb)
 
int uv_udp_try_send (uv_udp_t *handle, const uv_buf_t bufs[], unsigned int nbufs, const struct sockaddr *addr)
 
void uv_unref (uv_handle_t *handle)
 
void uv_walk (uv_loop_t *loop, uv_walk_cb walk_cb, void *arg)
 

Variables

static uv_loop_tdefault_loop_ptr
 
static uv_loop_t default_loop_struct
 
static uv__allocator_t uv__allocator
 

Macro Definition Documentation

◆ uv__fs_scandir_free

#define uv__fs_scandir_free   free

Definition at line 602 of file uv-common.c.

◆ UV_ERR_NAME_GEN

#define UV_ERR_NAME_GEN (   name,
 
)    case UV_ ## name: return #name;

Definition at line 188 of file uv-common.c.

◆ UV_ERR_NAME_GEN_R

#define UV_ERR_NAME_GEN_R (   name,
 
)
Value:
case UV_## name: \
uv__strscpy(buf, #name, buflen); break;

Definition at line 175 of file uv-common.c.

◆ UV_STRERROR_GEN

#define UV_STRERROR_GEN (   name,
  msg 
)    case UV_ ## name: return msg;

Definition at line 211 of file uv-common.c.

◆ UV_STRERROR_GEN_R

#define UV_STRERROR_GEN_R (   name,
  msg 
)
Value:
case UV_ ## name: \
snprintf(buf, buflen, "%s", msg); break;

Definition at line 198 of file uv-common.c.

◆ X

#define X (   uc,
  lc 
)    case UV_##uc: type = #lc; break;

◆ XX

#define XX (   uc,
  lc 
)    case UV_##uc: return sizeof(uv_##lc##_t);

Definition at line 131 of file uv-common.c.

Function Documentation

◆ uv__calloc()

void* uv__calloc ( size_t  count,
size_t  size 
)

Definition at line 92 of file uv-common.c.

◆ uv__count_bufs()

size_t uv__count_bufs ( const uv_buf_t  bufs[],
unsigned int  nbufs 
)

Definition at line 543 of file uv-common.c.

◆ uv__free()

void uv__free ( void *  ptr)

Definition at line 81 of file uv-common.c.

◆ uv__fs_get_dirent_type()

uv_dirent_type_t uv__fs_get_dirent_type ( uv__dirent_t dent)

Definition at line 658 of file uv-common.c.

◆ uv__fs_readdir_cleanup()

void uv__fs_readdir_cleanup ( uv_fs_t req)

Definition at line 694 of file uv-common.c.

◆ uv__fs_scandir_cleanup()

void uv__fs_scandir_cleanup ( uv_fs_t req)

Definition at line 605 of file uv-common.c.

◆ uv__get_nbufs()

static unsigned int* uv__get_nbufs ( uv_fs_t req)
static

Definition at line 587 of file uv-common.c.

◆ uv__malloc()

void* uv__malloc ( size_t  size)

Definition at line 75 of file uv-common.c.

◆ uv__print_handles()

static void uv__print_handles ( uv_loop_t loop,
int  only_active,
FILE *  stream 
)
static

Definition at line 475 of file uv-common.c.

◆ uv__realloc()

void* uv__realloc ( void *  ptr,
size_t  size 
)

Definition at line 96 of file uv-common.c.

◆ uv__reallocf()

void* uv__reallocf ( void *  ptr,
size_t  size 
)

Definition at line 103 of file uv-common.c.

◆ uv__strdup()

char* uv__strdup ( const char *  s)

Definition at line 55 of file uv-common.c.

◆ uv__strndup()

char* uv__strndup ( const char *  s,
size_t  n 
)

Definition at line 63 of file uv-common.c.

◆ uv__udp_check_before_send()

int uv__udp_check_before_send ( uv_udp_t handle,
const struct sockaddr *  addr 
)

Definition at line 377 of file uv-common.c.

◆ uv__udp_is_connected()

int uv__udp_is_connected ( uv_udp_t handle)

Definition at line 363 of file uv-common.c.

◆ uv__unknown_err_code()

static const char* uv__unknown_err_code ( int  err)
static

Definition at line 165 of file uv-common.c.

◆ uv_buf_init()

uv_buf_t uv_buf_init ( char *  base,
unsigned int  len 
)

Definition at line 157 of file uv-common.c.

◆ uv_default_loop()

uv_loop_t* uv_default_loop ( void  )

Definition at line 733 of file uv-common.c.

◆ uv_err_name()

const char* uv_err_name ( int  err)

Definition at line 189 of file uv-common.c.

◆ uv_err_name_r()

char* uv_err_name_r ( int  err,
char *  buf,
size_t  buflen 
)

Definition at line 178 of file uv-common.c.

◆ uv_free_cpu_info()

void uv_free_cpu_info ( uv_cpu_info_t cpu_infos,
int  count 
)

Definition at line 816 of file uv-common.c.

◆ uv_fs_event_getpath()

int uv_fs_event_getpath ( uv_fs_event_t handle,
char *  buffer,
size_t *  size 
)

Definition at line 562 of file uv-common.c.

◆ uv_fs_scandir_next()

int uv_fs_scandir_next ( uv_fs_t req,
uv_dirent_t ent 
)

Definition at line 621 of file uv-common.c.

◆ uv_handle_size()

size_t uv_handle_size ( uv_handle_type  type)

Definition at line 133 of file uv-common.c.

◆ uv_has_ref()

int uv_has_ref ( const uv_handle_t handle)

Definition at line 527 of file uv-common.c.

◆ uv_ip4_addr()

int uv_ip4_addr ( const char *  ip,
int  port,
struct sockaddr_in *  addr 
)

Definition at line 221 of file uv-common.c.

◆ uv_ip4_name()

int uv_ip4_name ( const struct sockaddr_in *  src,
char *  dst,
size_t  size 
)

Definition at line 267 of file uv-common.c.

◆ uv_ip6_addr()

int uv_ip6_addr ( const char *  ip,
int  port,
struct sockaddr_in6 addr 
)

Definition at line 232 of file uv-common.c.

◆ uv_ip6_name()

int uv_ip6_name ( const struct sockaddr_in6 src,
char *  dst,
size_t  size 
)

Definition at line 272 of file uv-common.c.

◆ uv_loop_close()

int uv_loop_close ( uv_loop_t loop)

Definition at line 761 of file uv-common.c.

◆ uv_loop_configure()

int uv_loop_configure ( uv_loop_t loop,
uv_loop_option  option,
  ... 
)

Definition at line 716 of file uv-common.c.

◆ uv_loop_delete()

void uv_loop_delete ( uv_loop_t loop)

Definition at line 791 of file uv-common.c.

◆ uv_loop_new()

uv_loop_t* uv_loop_new ( void  )

Definition at line 745 of file uv-common.c.

◆ uv_loop_size()

size_t uv_loop_size ( void  )

Definition at line 152 of file uv-common.c.

◆ uv_now()

uint64_t uv_now ( const uv_loop_t loop)

Definition at line 537 of file uv-common.c.

◆ uv_os_free_environ()

void uv_os_free_environ ( uv_env_item_t envitems,
int  count 
)

Definition at line 805 of file uv-common.c.

◆ uv_print_active_handles()

void uv_print_active_handles ( uv_loop_t loop,
FILE *  stream 
)

Definition at line 512 of file uv-common.c.

◆ uv_print_all_handles()

void uv_print_all_handles ( uv_loop_t loop,
FILE *  stream 
)

Definition at line 507 of file uv-common.c.

◆ uv_recv_buffer_size()

int uv_recv_buffer_size ( uv_handle_t handle,
int value 
)

Definition at line 554 of file uv-common.c.

◆ uv_ref()

void uv_ref ( uv_handle_t handle)

Definition at line 517 of file uv-common.c.

◆ uv_replace_allocator()

int uv_replace_allocator ( uv_malloc_func  malloc_func,
uv_realloc_func  realloc_func,
uv_calloc_func  calloc_func,
uv_free_func  free_func 
)

Definition at line 114 of file uv-common.c.

◆ uv_req_size()

size_t uv_req_size ( uv_req_type  type)

Definition at line 141 of file uv-common.c.

◆ uv_send_buffer_size()

int uv_send_buffer_size ( uv_handle_t handle,
int value 
)

Definition at line 558 of file uv-common.c.

◆ uv_stop()

void uv_stop ( uv_loop_t loop)

Definition at line 532 of file uv-common.c.

◆ uv_strerror()

const char* uv_strerror ( int  err)

Definition at line 212 of file uv-common.c.

◆ uv_strerror_r()

char* uv_strerror_r ( int  err,
char *  buf,
size_t  buflen 
)

Definition at line 201 of file uv-common.c.

◆ uv_tcp_bind()

int uv_tcp_bind ( uv_tcp_t handle,
const struct sockaddr *  addr,
unsigned int  flags 
)

Definition at line 277 of file uv-common.c.

◆ uv_tcp_connect()

int uv_tcp_connect ( uv_connect_t req,
uv_tcp_t handle,
const struct sockaddr *  addr,
uv_connect_cb  cb 
)

Definition at line 315 of file uv-common.c.

◆ uv_udp_bind()

int uv_udp_bind ( uv_udp_t handle,
const struct sockaddr *  addr,
unsigned int  flags 
)

Definition at line 296 of file uv-common.c.

◆ uv_udp_connect()

int uv_udp_connect ( uv_udp_t handle,
const struct sockaddr *  addr 
)

Definition at line 335 of file uv-common.c.

◆ uv_udp_recv_start()

int uv_udp_recv_start ( uv_udp_t handle,
uv_alloc_cb  alloc_cb,
uv_udp_recv_cb  recv_cb 
)

Definition at line 438 of file uv-common.c.

◆ uv_udp_recv_stop()

int uv_udp_recv_stop ( uv_udp_t handle)

Definition at line 448 of file uv-common.c.

◆ uv_udp_send()

int uv_udp_send ( uv_udp_send_t req,
uv_udp_t handle,
const uv_buf_t  bufs[],
unsigned int  nbufs,
const struct sockaddr *  addr,
uv_udp_send_cb  send_cb 
)

Definition at line 408 of file uv-common.c.

◆ uv_udp_try_send()

int uv_udp_try_send ( uv_udp_t handle,
const uv_buf_t  bufs[],
unsigned int  nbufs,
const struct sockaddr *  addr 
)

Definition at line 424 of file uv-common.c.

◆ uv_unref()

void uv_unref ( uv_handle_t handle)

Definition at line 522 of file uv-common.c.

◆ uv_walk()

void uv_walk ( uv_loop_t loop,
uv_walk_cb  walk_cb,
void *  arg 
)

Definition at line 456 of file uv-common.c.

Variable Documentation

◆ default_loop_ptr

uv_loop_t* default_loop_ptr
static

Definition at line 730 of file uv-common.c.

◆ default_loop_struct

uv_loop_t default_loop_struct
static

Definition at line 729 of file uv-common.c.

◆ uv__allocator

uv__allocator_t uv__allocator
static
Initial value:
= {
malloc,
realloc,
calloc,
free,
}

Definition at line 48 of file uv-common.c.

buf
voidpf void * buf
Definition: bloaty/third_party/zlib/contrib/minizip/ioapi.h:136
setup.name
name
Definition: setup.py:542
msg
std::string msg
Definition: client_interceptors_end2end_test.cc:372


grpc
Author(s):
autogenerated on Fri May 16 2025 03:01:37