mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-19 07:00:10 -05:00
pod: add more functions for easy pod+body parsing
Add functions to parse an object and struct from pod+body.
This commit is contained in:
parent
45ed70d480
commit
ede1924ded
1 changed files with 9 additions and 4 deletions
|
|
@ -854,20 +854,25 @@ SPA_API_POD_PARSER int spa_pod_parser_get(struct spa_pod_parser *parser, ...)
|
|||
_res; \
|
||||
})
|
||||
|
||||
#define spa_pod_parse_object(pod,type,id,...) \
|
||||
#define spa_pod_body_parse_object(pod,body,type,id,...) \
|
||||
({ \
|
||||
struct spa_pod_parser _p; \
|
||||
spa_pod_parser_pod(&_p, pod); \
|
||||
spa_pod_parser_init_pod_body(&_p, pod, body); \
|
||||
spa_pod_parser_get_object(&_p,type,id,##__VA_ARGS__); \
|
||||
})
|
||||
|
||||
#define spa_pod_parse_struct(pod,...) \
|
||||
#define spa_pod_parse_object(pod,type,id,...) \
|
||||
spa_pod_body_parse_object(pod,SPA_POD_BODY_CONST(pod),type,id,##__VA_ARGS__)
|
||||
|
||||
#define spa_pod_body_parse_struct(pod,body,...) \
|
||||
({ \
|
||||
struct spa_pod_parser _p; \
|
||||
spa_pod_parser_pod(&_p, pod); \
|
||||
spa_pod_parser_init_pod_body(&_p, pod, body); \
|
||||
spa_pod_parser_get_struct(&_p,##__VA_ARGS__); \
|
||||
})
|
||||
|
||||
#define spa_pod_parse_struct(pod,...) \
|
||||
spa_pod_body_parse_struct(pod,SPA_POD_BODY_CONST(pod),##__VA_ARGS__)
|
||||
/**
|
||||
* \}
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue