Add gdbus-codegen annotations and options for making it easier to deal with 'ay' instances
@walters
Submitted by Colin Walters Assigned to David Zeuthen
Link to original bug (#674017)
Description
"ay" in GVariant and DBus means "arbitrary sequence of bytes"; there could be a NUL byte in the middle, or the entire thing could be NUL bytes, or it could not have a NUL at all.
Now, it is common to use 'ay' for "bytestrings" - a sequence of non-NUL bytes, followed by a NUL terminator. For example, filenames read from disk fall into this class. And GVariant has utility functions for loading these.
But it's wrong to default "ay" to "gchar*" in the C code generator. In modern GLib, GBytes is a good choice. Failing that, you can use an explicit 'guchar *', gsize len pair.
We probably can't change this now...applications will just have to work around it by forcing GVariants. However if we decide later to have say a --enable-v2-types mode which fixes up the type mapping (at the cost of an opt-in ABI break), we should include this fix then.