#ifndef SWIFT_NET_MONITOR_H
#define SWIFT_NET_MONITOR_H

#include <swift/atomic.h>
#include <swift/stdlib.h>

#include <swift/net/api.h>

typedef struct swift_monitor_t swift_monitor_t;
typedef struct swift_sock_t swift_sock_t;

struct swift_monitor_t {
	swift_ref_t ref;
	void *data;
};

SWIFT_NET_API bool swift_init_monitor(swift_monitor_t *monitor,
	unsigned int thread_count);
SWIFT_NET_API void swift_term_monitor(swift_monitor_t *monitor);
SWIFT_NET_API swift_monitor_t *swift_new_monitor(
	unsigned int thread_count);
SWIFT_NET_API void swift_del_monitor(swift_monitor_t *monitor);
SWIFT_NET_API swift_monitor_t *swift_ref_monitor(
	swift_monitor_t *monitor);
SWIFT_NET_API bool swift_monitor_sock(swift_monitor_t *monitor,
	swift_sock_t *sock);
SWIFT_NET_API void swift_poll_monitor(void *user_data);

#endif /* SWIFT_NET_MONITOR_H */
