diff --git a/include/neatvnc.h b/include/neatvnc.h index a0ccbb7..ee778ff 100644 --- a/include/neatvnc.h +++ b/include/neatvnc.h @@ -134,6 +134,9 @@ bool nvnc_client_supports_cursor(const struct nvnc_client* client); const char* nvnc_client_get_hostname(const struct nvnc_client* client); const char* nvnc_client_get_auth_username(const struct nvnc_client* client); +struct nvnc_client* nvnc_client_first(struct nvnc* self); +struct nvnc_client* nvnc_client_next(struct nvnc_client* client); + void nvnc_set_name(struct nvnc* self, const char* name); void nvnc_set_key_fn(struct nvnc* self, nvnc_key_fn); diff --git a/src/server.c b/src/server.c index 423079f..95cc3fd 100644 --- a/src/server.c +++ b/src/server.c @@ -1603,6 +1603,19 @@ const char* nvnc_client_get_auth_username(const struct nvnc_client* client) { return client->username; } +EXPORT +struct nvnc_client* nvnc_client_first(struct nvnc* self) +{ + return LIST_FIRST(&self->clients); +} + +EXPORT +struct nvnc_client* nvnc_client_next(struct nvnc_client* client) +{ + assert(client); + return LIST_NEXT(client, link); +} + EXPORT bool nvnc_client_supports_cursor(const struct nvnc_client* client) {