librsync  2.3.4
util.h File Reference

Misc utility functions used by librsync. More...

Include dependency graph for util.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define rs_alloc_struct(type)
 Allocate and zero-fill an instance of TYPE.
#define UNUSED(x)

Functions

void * rs_alloc (size_t size, char const *name)
void * rs_realloc (void *ptr, size_t size, char const *name)
void * rs_alloc_struct0 (size_t size, char const *name)
void rs_bzero (void *buf, size_t size)
int rs_long_ln2 (rs_long_t v)
int rs_long_sqrt (rs_long_t v)

Detailed Description

Misc utility functions used by librsync.

Definition in file util.h.

Macro Definition Documentation

◆ rs_alloc_struct

#define rs_alloc_struct ( type)
Value:
((type *) rs_alloc_struct0(sizeof(type), #type))

Allocate and zero-fill an instance of TYPE.

Definition at line 41 of file util.h.

◆ UNUSED

#define UNUSED ( x)
Value:
x

Definition at line 49 of file util.h.

Function Documentation

◆ rs_alloc()

void * rs_alloc ( size_t size,
char const * name )

Definition at line 49 of file util.c.

◆ rs_realloc()

void * rs_realloc ( void * ptr,
size_t size,
char const * name )

Definition at line 60 of file util.c.

◆ rs_alloc_struct0()

void * rs_alloc_struct0 ( size_t size,
char const * name )

Definition at line 38 of file util.c.

◆ rs_bzero()

void rs_bzero ( void * buf,
size_t size )

Definition at line 33 of file util.c.

◆ rs_long_ln2()

int rs_long_ln2 ( rs_long_t v)

Definition at line 70 of file util.c.

◆ rs_long_sqrt()

int rs_long_sqrt ( rs_long_t v)

Definition at line 79 of file util.c.