1. File Formats compound_var(4)
NAME
compound_var - format of serialised compound variable
DESCRIPTION
An serialised compound variable file is text representing
the value of a compound variable. A compound variable has the form
name=(assignment ...) where "assignment" is a sequence of zero
or more shell variable assignments in the form
[<datatype><blank>]<name>=<value> (if <datatype><blank> is
omitted the default shell datatype "string" will be used)
seperated by newline or ';'.
* DataTypes:
<needs to be written.
* Material:
string
integer (and unsigned integer)
float (conformant to IEEE 754-2008)
hexfloat (conformant to C99 and IEEE 754-2008)
Array, indexed+associative
binary (mime base64)
compound variable
>
* Value encodings:
<needs to be written.
* Material:
1. plain strings
2. plain strings in double-quotes
3. ANSI-C strings $'...'
>
* Indexed arrays, sets, associative arrays:
<needs to be written>
SEE ALSO
ksh93(1), XML(4), libcompoundvar(3c)
NOTES
It is recommended that applications implement compund variable
output using the option "-C compound" or - if "-C" is already
used - use option "-# compound".
The format supports multibyte charatcers for both variable names
and values but the users but ensure that the creator and consumers
use a compatible character encoding.
The recommended file extension for serialised compound variables
is *.cpv
EXAMPLES
1. Empty compound variable:
-- snip --
(
)
-- snip --
2. 2. Compound variable with a string member variable "foo"
-- snip --
(
foo="bar"
)
-- snip --
3. Compound variable with an indexed array with values "1", "2" and "3":
-- snip --
(
typeset -a a=(
1
2
3
)
)
-- snip --
4. Compound variable with an indexed array with string values "1",
"2" and "3":
-- snip --
(
typeset -a a=(
1
2
3
)
)
-- snip --
5. Compound variable with a sparse indexed array containing strings:
-- snip --
(
typeset -a a=(
[0]=1
[3]=3
[5]=2
)
)
-- snip --
6. Compound variable with a sparse indexed array containing
compound variables:
-- snip --
(
typeset -C -a a=(
[4]=(
msg="hello world"
food="roasted chicken"
)
[7]=(
msg="thank you for the fish"
food="tuna"
)
[9]=(
typeset -l -E temp=0.1
typeset -C nested_node=(
name="text node"
description="a text node"
value="hello fish"
)
)
)
3. )
-- snip --
7. Compound variable with an associative array containing
compound variables:
-- snip --
(
typeset -C -a a=(
['a meal node']=(
msg="hello world"
food="roasted chicken"
)
['another meal node']=(
msg="thank you for the fish"
food="tuna"
)
['temperature difference']=(
typeset -l -E temp=0.1
)
)
)
-- snip --
#### Material: ####
* Use sccsfile(4) as template
* String literals:
1. plain strings
2. Plain strings in double-quotes
3. ANSI-C strings $'...'
* Datatypes:
string
integer (and unsigned integer)
float (conformant to IEEE 754-2008)
hexfloat (conformant to C99 and IEEE 754-2008)
Array, indexed+associative
binary (mime base64)
compound variable
* ToDo:
-- snip --
<plocher> define the stability and specs for the following: Name,
Grammer/Syntax,
Producer(s) and Consumer(s), as well as a Description of what the file is used
for,
how its content can evolve (i.e., presume the parser stays same, but the grammer
grows, how can Consumers deal with change...)
-- snip --