diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2011-10-03 14:27:15 +0100 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2011-10-03 14:30:43 +0100 |
commit | 61cac41994051bbc85fdcee1198349f1100ad32c (patch) | |
tree | 74565dcc48be2f0983a43b460b9361c0a269f089 | |
parent | fc4829c5c0137147a70338606632ac9813e59dc2 (diff) |
In the GVariant intro, mention lack of built-in endianness, and rationalegvariant-docs
Presumably, the rationale for not storing the endianness is that
GVariant is a recursive type system, and in a sane format, endianness
only needs to be stored once per blob of data (once per D-Bus message,
once per file on disk, etc.).
-rw-r--r-- | glib/gvariant.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/glib/gvariant.c b/glib/gvariant.c index 89b7ec34b..a5e83a961 100644 --- a/glib/gvariant.c +++ b/glib/gvariant.c @@ -72,6 +72,14 @@ * as the serialisation format of a D-Bus message body: use #GDBusMessage, * in the gio library, for those.) * + * For space-efficiency, the #GVariant serialisation format does not + * automatically include the variant's type or endianness, which must + * either be implied from context (such as knowledge that a particular + * file format always contains a little-endian %G_VARIANT_TYPE_VARDICT) + * or supplied out-of-band (for instance, a type and/or endianness + * indicator could be placed at the beginning of a file, network message + * or network stream). + * * For convenience to C programmers, #GVariant features powerful * varargs-based value construction and destruction. This feature is * designed to be embedded in other libraries. |