Add functions for listing clients

pull/83/head
Andri Yngvason 2022-11-20 12:03:18 +00:00
parent 8a7509bd3a
commit 79f26924ea
2 changed files with 16 additions and 0 deletions

View File

@ -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);

View File

@ -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)
{