diff options
author | Trumeet <yuuta@yuuta.moe> | 2022-07-20 20:37:37 -0700 |
---|---|---|
committer | Trumeet <yuuta@yuuta.moe> | 2022-07-20 20:37:37 -0700 |
commit | 41ac44c30b9d165dd90255eec5b817fc21b8f7ff (patch) | |
tree | cf4fb9a61eef24a96365f54409f47e373ff2e3da /client/libacron/include/net.h | |
parent | e2452adee6ba683cbfe093301650503a936a1a94 (diff) | |
download | acron-41ac44c30b9d165dd90255eec5b817fc21b8f7ff.tar acron-41ac44c30b9d165dd90255eec5b817fc21b8f7ff.tar.gz acron-41ac44c30b9d165dd90255eec5b817fc21b8f7ff.tar.bz2 acron-41ac44c30b9d165dd90255eec5b817fc21b8f7ff.zip |
docs(libacron): add library docs
Signed-off-by: Trumeet <yuuta@yuuta.moe>
Diffstat (limited to 'client/libacron/include/net.h')
-rw-r--r-- | client/libacron/include/net.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/client/libacron/include/net.h b/client/libacron/include/net.h index 5b10470..8fb33f8 100644 --- a/client/libacron/include/net.h +++ b/client/libacron/include/net.h @@ -20,10 +20,29 @@ typedef struct ac_connection_parameters { char *url; } ac_connection_parameters_t; +/** + * Connect to the server. + * @param parameters Connection parameters. Untouched. + * @param out Output connection reference if succeeds. Not-NULL. + * @return AC_E_OK or an error code. When failed, *out will be untouched. + * MT-Safe + */ int ac_connect(ac_connection_parameters_t parameters, void **out); +/** + * Disconnect the connection. + * @param connection A non-NULL and connected connection passed as-is from ac_connect. + * @return AC_E_OK or an error code. When failed, connection is undefined. When succeeds, connection is freed and invalid. + * MT-Unsafe + */ int ac_disconnect(void *connection); +/** + * Blocks the current thread until a new response or event arrives. + * @param connection A non-NULL and connected connection passed as-is from ac_connect. + * @param response Output response of either an event or a response. May be NULL even if it succeeds. + * @return AC_E_OK or an error code. When failed, *response is NULL. + */ int ac_receive(void *connection, ac_obj_t **response); #endif /* LIBAC_NET_H */ |