Skip to content

Commit

Permalink
Renamed ev_get_ev_context -> get_ev_context
Browse files Browse the repository at this point in the history
  • Loading branch information
codepr committed Nov 24, 2023
1 parent 4d0e9ad commit 5d31040
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ static void on_connection(ev_tcp_handle *server) {

int main(void) {

ev_context *ctx = ev_get_ev_context();
ev_context *ctx = ev_get_context();
ev_tcp_server server;
int err = 0;
if ((err = ev_tcp_server_init(&server, ctx, 128)) < 0) {
Expand Down
6 changes: 3 additions & 3 deletions ev.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,10 @@ int ev_is_running(const ev_context *);

/*
* By design ev library can instantiate a default `ev_context`, calling
* `ev_get_ev_context` the first time will create the loop as a singleton,
* `ev_get_context` the first time will create the loop as a singleton,
* subsequent calls will retrieve the same first context allocated
*/
ev_context *ev_get_ev_context(void);
ev_context *ev_get_context(void);

/*
* Call custom destroy function based on the api type set up calling `ev_init`
Expand Down Expand Up @@ -895,7 +895,7 @@ static inline int ev_get_event_type(ev_context *ctx, int idx) {
return ev_api_get_event_type(ctx, idx);
}

ev_context *ev_get_ev_context(void) {
ev_context *ev_get_context(void) {
if (ev_default_ctx_inited == 0) {
#ifdef __linux__
quit_sig = eventfd(0, EFD_NONBLOCK);
Expand Down
2 changes: 1 addition & 1 deletion examples/ev_tcp_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ static void on_stdin(ev_context *ctx, void *ptr) {

int main(void) {

ev_context *ctx = ev_get_ev_context();
ev_context *ctx = ev_get_context();
ev_tcp_handle client = {.ctx = ctx, .addr = HOST, .port = PORT};

int err = 0;
Expand Down
2 changes: 1 addition & 1 deletion examples/ev_tcp_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ static void on_connection(ev_tcp_handle *server) {

int main(void) {

ev_context *ctx = ev_get_ev_context();
ev_context *ctx = ev_get_context();
ev_tcp_server server;
int err = 0;
if ((err = ev_tcp_server_init(&server, ctx, BACKLOG)) < 0) {
Expand Down
2 changes: 1 addition & 1 deletion examples/ev_tcp_server_stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ static void on_connection(ev_tcp_handle *server) {

int main(void) {

ev_context *ctx = ev_get_ev_context();
ev_context *ctx = ev_get_context();
ev_register_cron(ctx, print_stats, NULL, STATS_PERIOD, 0);
ev_tcp_server server;
int err = 0;
Expand Down
2 changes: 1 addition & 1 deletion examples/ev_tls_tcp_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ static void on_connection(ev_tcp_handle *server) {

int main(void) {

ev_context *ctx = ev_get_ev_context();
ev_context *ctx = ev_get_context();
ev_tcp_server server;
struct ev_tls_options tls_opt = {
.ca = CA,
Expand Down

0 comments on commit 5d31040

Please sign in to comment.