|
|
|
|
@ -2,11 +2,12 @@
|
|
|
|
|
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
|
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
|
|
|
|
|
|
|
|
#include "export.h"
|
|
|
|
|
#include "eventloop_platform.h"
|
|
|
|
|
#include "public/container_of.h"
|
|
|
|
|
#include "public/list.h"
|
|
|
|
|
|
|
|
|
|
int tlsl_eventloop_init(struct tlsl_eventloop *el) {
|
|
|
|
|
EXPORT int tlsl_eventloop_init(struct tlsl_eventloop *el) {
|
|
|
|
|
int platform_res;
|
|
|
|
|
|
|
|
|
|
intrusive_list_init_empty(&el->event_list);
|
|
|
|
|
@ -18,7 +19,7 @@ int tlsl_eventloop_init(struct tlsl_eventloop *el) {
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void tlsl_eventloop_cleanup(struct tlsl_eventloop *el) {
|
|
|
|
|
EXPORT void tlsl_eventloop_cleanup(struct tlsl_eventloop *el) {
|
|
|
|
|
struct intrusive_list *li;
|
|
|
|
|
struct tlsl_event *e;
|
|
|
|
|
|
|
|
|
|
@ -34,7 +35,7 @@ void tlsl_eventloop_cleanup(struct tlsl_eventloop *el) {
|
|
|
|
|
el->valid = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int tlsl_eventloop_wait(
|
|
|
|
|
EXPORT int tlsl_eventloop_wait(
|
|
|
|
|
struct tlsl_eventloop *el,
|
|
|
|
|
tlsl_event_id_t *id_out,
|
|
|
|
|
uint32_t *flags_out,
|
|
|
|
|
@ -43,16 +44,16 @@ int tlsl_eventloop_wait(
|
|
|
|
|
return tlsl_platform_el_wait(el, id_out, flags_out, timeout_ms);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int tlsl_eventloop_clear(struct tlsl_eventloop *el, struct tlsl_event *e) {
|
|
|
|
|
EXPORT int tlsl_eventloop_clear(struct tlsl_eventloop *el, struct tlsl_event *e) {
|
|
|
|
|
return tlsl_platform_el_event_clear(el, e);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void tlsl_eventloop_remove(struct tlsl_eventloop *el, struct tlsl_event *e) {
|
|
|
|
|
EXPORT void tlsl_eventloop_remove(struct tlsl_eventloop *el, struct tlsl_event *e) {
|
|
|
|
|
tlsl_platform_el_event_remove(el, e);
|
|
|
|
|
tlsl_platform_el_event_cleanup(el, e);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int tlsl_eventloop_add_timer(
|
|
|
|
|
EXPORT int tlsl_eventloop_add_timer(
|
|
|
|
|
struct tlsl_eventloop *el,
|
|
|
|
|
struct tlsl_event *e,
|
|
|
|
|
uint64_t millis,
|
|
|
|
|
@ -66,7 +67,7 @@ int tlsl_eventloop_add_timer(
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int tlsl_eventloop_add_fd(
|
|
|
|
|
EXPORT int tlsl_eventloop_add_fd(
|
|
|
|
|
struct tlsl_eventloop *el,
|
|
|
|
|
struct tlsl_event *e,
|
|
|
|
|
int fd,
|
|
|
|
|
|