mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-11-02 09:01:39 -05:00
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:
parent
5eeaac6e11
commit
b258d5f361
14 changed files with 720 additions and 4 deletions
|
|
@ -80,11 +80,20 @@ enum intf_A_foo {
|
|||
* @since 2
|
||||
*/
|
||||
INTF_A_FOO_THIRD = 2,
|
||||
/**
|
||||
* this is a negative value
|
||||
* @since 2
|
||||
*/
|
||||
INTF_A_FOO_NEGATIVE = -1,
|
||||
};
|
||||
/**
|
||||
* @ingroup iface_intf_A
|
||||
*/
|
||||
#define INTF_A_FOO_THIRD_SINCE_VERSION 2
|
||||
/**
|
||||
* @ingroup iface_intf_A
|
||||
*/
|
||||
#define INTF_A_FOO_NEGATIVE_SINCE_VERSION 2
|
||||
#endif /* INTF_A_FOO_ENUM */
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue