scanner: add validators for enums

Right now compositors need to manually check that enum values sent
by the client are valid. In particular:

- Check that the value sent by the client is not outside of the enum.
- Check that the version of the enum entry is consistent with the
  object version.

Automatically generate validator functions to perform these tasks.

Signed-off-by: Simon Ser <contact@emersion.fr>
Closes: https://gitlab.freedesktop.org/wayland/wayland/-/issues/104
This commit is contained in:
Simon Ser 2022-09-17 10:53:56 +02:00
parent 5eeaac6e11
commit b258d5f361
14 changed files with 720 additions and 4 deletions

View file

@ -25,6 +25,7 @@
* SOFTWARE.
*/
#include <stdbool.h>
#include <stdlib.h>
#include <stdint.h>
#include "wayland-util.h"