mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice-common
synced 2025-12-29 16:35:58 +00:00
docs: Document to_ptr protocol attribute
Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Snir Sheriber <ssheribe@redhat.com>
This commit is contained in:
parent
5b6878e72c
commit
aee2b91fe2
@ -365,7 +365,30 @@ the attribute was attached to a `len`-sized array).
|
||||
to_ptr
|
||||
~~~~~~
|
||||
|
||||
TODO
|
||||
This specifies that the corresponding C structure field contains a pointer to
|
||||
the data. On marshalling the pointer is used, on demarshalling the data is
|
||||
allocated in the memory block that holds the returned structure.
|
||||
The type of this field must be a structure.
|
||||
|
||||
Example:
|
||||
|
||||
struct test {
|
||||
uint16 num;
|
||||
};
|
||||
|
||||
struct msg {
|
||||
test ptr @to_ptr;
|
||||
};
|
||||
|
||||
Output C structure:
|
||||
|
||||
struct test {
|
||||
uint16_t num;
|
||||
};
|
||||
|
||||
struct msg {
|
||||
struct test *ptr;
|
||||
};
|
||||
|
||||
nocopy
|
||||
~~~~~~
|
||||
|
||||
Loading…
Reference in New Issue
Block a user