2021-10-24 11:46:30 -04:00
|
|
|
#pragma once
|
|
|
|
|
2024-02-20 21:41:37 -05:00
|
|
|
/**
|
|
|
|
** \defgroup tls_js TLS Interface
|
|
|
|
** Exposes \ref tls to JS.
|
|
|
|
** @{
|
|
|
|
*/
|
|
|
|
|
2021-10-24 11:46:30 -04:00
|
|
|
#include "quickjs.h"
|
|
|
|
|
2024-02-28 21:18:59 -05:00
|
|
|
/**
|
|
|
|
** A TLS context instance.
|
|
|
|
*/
|
2021-10-24 11:46:30 -04:00
|
|
|
typedef struct _tf_tls_context_t tf_tls_context_t;
|
|
|
|
|
2024-02-28 21:18:59 -05:00
|
|
|
/**
|
|
|
|
** Register TLS script interface.
|
|
|
|
** @param context The TLS context.
|
|
|
|
** @return the TlsContext constructor.
|
|
|
|
*/
|
2021-10-24 11:46:30 -04:00
|
|
|
JSValue tf_tls_context_register(JSContext* context);
|
2024-02-28 21:18:59 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
** Get a TLS context instance from its JS object.
|
|
|
|
** @param value A TlsContext JS object.
|
|
|
|
** @return The corresponding instance.
|
|
|
|
*/
|
2021-10-24 11:46:30 -04:00
|
|
|
tf_tls_context_t* tf_tls_context_get(JSValue value);
|
2024-02-28 21:18:59 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
** Get the number of active TLS context instances.
|
|
|
|
** @return The number of TlsContext objects created that have not been
|
|
|
|
** finalized.
|
|
|
|
*/
|
2021-10-24 11:46:30 -04:00
|
|
|
int tf_tls_context_get_count();
|
2024-02-20 21:41:37 -05:00
|
|
|
|
|
|
|
/** @} */
|