External functions

Wrapper around commonly used libuv functions: init, close, run

#ifndef ch_libchirp_wrappers_h
#define ch_libchirp_wrappers_h

Project includes

#include "common.h"

Declarations

CH_EXPORT int ch_loop_init(uv_loop_t* loop)

An alias for uv_loop_init. Please refer to the libuv documentation.

Parameters:
  • loop (uv_loop_t*) – Loop struct allocated by user.
Returns:

the status of the initialization.

Return type:

int

CH_EXPORT int ch_loop_close(uv_loop_t* loop)

An alias for uv_loop_close. Please refer to the libuv documentation.

Parameters:
  • loop (uv_loop_t*) – Loop struct allocated by the user.
Returns:

the status of the closing action.

Return type:

int

CH_EXPORT int ch_run(uv_loop_t* loop)

A wrapper for uv_run. Runs the loop once again, in case closing chirp’s resources caused additional requests/handlers.

Please refer to the libuv documentation.

Parameters:
  • loop (uv_loop_t*) – Loop struct allocated by user.
Returns:

the status of the action.

Return type:

int

#endif // ch_libchirp_wrappers_h