All but the two biggest .h files have docs.

This commit is contained in:
Cory McWilliams 2024-03-06 12:31:17 -05:00
parent 794804e27f
commit e3c7c86212
3 changed files with 57 additions and 0 deletions

View File

@ -8,8 +8,23 @@
#include "quickjs.h" #include "quickjs.h"
/**
** Register the socket script interface.
** @param context The JS context.
** @return The Socket constructor.
*/
JSValue tf_socket_register(JSContext* context); JSValue tf_socket_register(JSContext* context);
/**
** Get the number of active socket objects.
** @return The count.
*/
int tf_socket_get_count(); int tf_socket_get_count();
/**
** Get the number of connected socket objects.
** @return the count.
*/
int tf_socket_get_open_count(); int tf_socket_get_open_count();
/** @} */ /** @} */

View File

@ -7,14 +7,50 @@
** @{ ** @{
*/ */
/** An SSB instance. */
typedef struct _tf_ssb_t tf_ssb_t; typedef struct _tf_ssb_t tf_ssb_t;
/** An SSB connections tracker instance. */
typedef struct _tf_ssb_connections_t tf_ssb_connections_t; typedef struct _tf_ssb_connections_t tf_ssb_connections_t;
/**
** Create a connection tracker.
** @param ssb The SSB instance.
** @return The connection tracker instance.
*/
tf_ssb_connections_t* tf_ssb_connections_create(tf_ssb_t* ssb); tf_ssb_connections_t* tf_ssb_connections_create(tf_ssb_t* ssb);
/**
** Destroy a connection tracker.
** @param connections The connection tracker to destroy.
*/
void tf_ssb_connections_destroy(tf_ssb_connections_t* connections); void tf_ssb_connections_destroy(tf_ssb_connections_t* connections);
/**
** Store a connection in the connection tracker.
** @param connections The connection tracker.
** @param host The host name or address.
** @param port The network port number.
** @param key The identity on the other end of the connection.
*/
void tf_ssb_connections_store(tf_ssb_connections_t* connections, const char* host, int port, const char* key); void tf_ssb_connections_store(tf_ssb_connections_t* connections, const char* host, int port, const char* key);
/**
** Record that a connection was recently attempted.
** @param connections The connection tracker.
** @param host The host name or address.
** @param port The network port number.
** @param key The identity on the other end of the connection.
*/
void tf_ssb_connections_set_attempted(tf_ssb_connections_t* connections, const char* host, int port, const char* key); void tf_ssb_connections_set_attempted(tf_ssb_connections_t* connections, const char* host, int port, const char* key);
/**
** Record that a connection recently succeeded.
** @param connections The connection tracker.
** @param host The host name or address.
** @param port The network port number.
** @param key The identity on the other end of the connection.
*/
void tf_ssb_connections_set_succeeded(tf_ssb_connections_t* connections, const char* host, int port, const char* key); void tf_ssb_connections_set_succeeded(tf_ssb_connections_t* connections, const char* host, int port, const char* key);
/** @} */ /** @} */

View File

@ -8,8 +8,14 @@
** @{ ** @{
*/ */
/** An SSB instance. */
typedef struct _tf_ssb_t tf_ssb_t; typedef struct _tf_ssb_t tf_ssb_t;
/**
** Export an app to disk.
** @param ssb The SSB instance.
** @param key The app path in the form "/~user/appname".
*/
void tf_ssb_export(tf_ssb_t* ssb, const char* key); void tf_ssb_export(tf_ssb_t* ssb, const char* key);
/** @} */ /** @} */