How fwrd-compatible is using dlopen and core only?

Pekka Paalanen ppaalanen at gmail.com
Tue Aug 14 07:57:27 UTC 2018


On Fri, 10 Aug 2018 18:31:03 +0000
ferreiradaselva <ferreiradaselva at protonmail.com> wrote:

> Oh,
> 
> I solved the problem with the extern variable
> (wl_registry_interface), I could get a pointer to it using
> `dlsym(handler, "wl_registry_interface")`.
> 
> The other question remains: can I use the content of the inline
> functions directly (to avoid the need to include protocol headers)?
> Is forward-compatibility guaranteed?

Hi,

yes, you can.

The inline functions and everything that is in the installed headers of
libwayland, generated or not, will always get built into user programs.
We try hard to not break any already compiled user programs (this is
the promise of a stable library ABI), which means you should be safe.

The above naturally also applies to headers generated by
wayland-scanner for extensions from e.g. wayland-protocols. A user
project may get the XML file from a wayland-protocols dependency, but
it is only used at build time. Once the user project is built,
libwayland must guarantee that it will keep working ABI wise.

I belive e.g. libSDL is already doing what you intend, see
src/video/wayland/.

Another design would be to make your own plugin to your library and
dlopen that plugin which was linked to libwayland during the build as
usual. Whether that's better or worse depends on your scope.


Thanks,
pq
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20180814/4be04e01/attachment-0001.sig>


More information about the wayland-devel mailing list