Skip to content

Commit

Permalink
chore: rename hooks_init to enable_hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
XavierChanth committed Jun 10, 2024
1 parent 519d3a5 commit 13f29c1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions packages/atclient/include/atclient/connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ typedef struct atclient_connection {
* if it is ATCLIENT_CONNECTION_TYPE_ROOT, then '\\n' will be used to check if it is connected.
* if it is ATCLIENT_CONNECTION_TYPE_ATSERVER, then 'noop:0\r\n' will be used to check if it is connected
*
* @note hooks have a separate init method, called atlcient_connection_hooks_init. After this method, call
* atclient_connection_hooks_init, if you intend to use hooks.
*/
void atclient_connection_init(atclient_connection *ctx, atclient_connection_type type);

Expand Down Expand Up @@ -136,7 +134,7 @@ int atclient_connection_get_host_and_port(atclient_atstr *host, int *port, const
*
* @param ctx the struct for the connection
*/
void atclient_connection_hooks_init(atclient_connection *ctx);
void atclient_connection_enable_hooks(atclient_connection *ctx);

/**
* @brief Add a hook to be called during the connection lifecycle
Expand Down
2 changes: 1 addition & 1 deletion packages/atclient/src/connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ int atclient_connection_get_host_and_port(atclient_atstr *host, int *port, const
exit: { return ret; }
}

void atclient_connection_hooks_init(atclient_connection *ctx) {
void atclient_connection_enable_hooks(atclient_connection *ctx) {
ctx->hooks = malloc(sizeof(atclient_connection_hooks));
memset(ctx->hooks, 0, sizeof(atclient_connection_hooks));
ctx->hooks->readonly_src = true;
Expand Down

0 comments on commit 13f29c1

Please sign in to comment.