diff --git a/README.md b/README.md index e1cdc24..b636050 100644 --- a/README.md +++ b/README.md @@ -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) { diff --git a/ev.h b/ev.h index aa6b2a8..42e146d 100644 --- a/ev.h +++ b/ev.h @@ -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` @@ -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); diff --git a/examples/ev_tcp_client.c b/examples/ev_tcp_client.c index c0014f6..1fd0676 100644 --- a/examples/ev_tcp_client.c +++ b/examples/ev_tcp_client.c @@ -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; diff --git a/examples/ev_tcp_server.c b/examples/ev_tcp_server.c index f22a46b..c1aef19 100644 --- a/examples/ev_tcp_server.c +++ b/examples/ev_tcp_server.c @@ -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) { diff --git a/examples/ev_tcp_server_stats.c b/examples/ev_tcp_server_stats.c index fe9c499..de5de10 100644 --- a/examples/ev_tcp_server_stats.c +++ b/examples/ev_tcp_server_stats.c @@ -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; diff --git a/examples/ev_tls_tcp_server.c b/examples/ev_tls_tcp_server.c index a9040bf..5e6b5bf 100644 --- a/examples/ev_tls_tcp_server.c +++ b/examples/ev_tls_tcp_server.c @@ -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,