Are all Wayland registry interfaces unique?

David Piper drppublic at gmail.com
Sun Oct 12 00:05:10 PDT 2014


Hi,

I’m just getting started with Wayland - I’m at the stage where I can start writing my own mini-clients.
I am just wondering if there is a guarantee that all interfaces only ever have a single entry in the registry.

If there is no guarantee, I would have to change my code from:
-------------------
static void global_registry_handler(void *data, struct wl_registry *registry, uint32_t id, const char *interface, uint32_t version) {
	if (strcmp(interface, “wl_something”) == 0)
		something = wl_registry_bind(registry, id, &wl_something_interface, 1);
	// ...
}
-------------------
to
-------------------
static void global_registry_handler(void *data, struct wl_registry *registry, uint32_t id, const char *interface, uint32_t version) {
	if (strcmp(interface, “wl_something”) == 0)
		vector_of_somethings.push_back(wl_registry_bind(registry, id, &wl_something_interface, 1));
	// …
}
-------------------

My hunch is that the vectors (arrays, etc) are unnecessary and there is in fact only one instance of every interface string in the registry, at least for wl_* strings, but I haven’t managed to find confirmation as yet - any direction here would be much appreciated :)


More information about the wayland-devel mailing list