protocol-native: improve demarshal

Add flags to demarshal functions and check remap and write access
in just one place.
This commit is contained in:
Wim Taymans 2017-08-01 20:11:38 +02:00
parent 4f08dbcd24
commit e24c934a1b
4 changed files with 109 additions and 94 deletions

View file

@ -33,6 +33,14 @@ extern "C" {
#define PW_TYPE_PROTOCOL__Native PW_TYPE_PROTOCOL_BASE "Native"
#define PW_TYPE_PROTOCOL_NATIVE_BASE PW_TYPE_PROTOCOL__Native ":"
struct pw_protocol_native_demarshal {
bool (*func) (void *object, void *data, size_t size);
#define PW_PROTOCOL_NATIVE_REMAP (1<<0)
#define PW_PROTOCOL_NATIVE_PERM_W (1<<1)
uint32_t flags;
};
/** \ref pw_protocol_native_ext methods */
struct pw_protocol_native_ext {
#define PW_VERSION_PROTOCOL_NATIVE_EXT 0