VistaIOEncodeAttrValue(3) | Library Functions Manual | VistaIOEncodeAttrValue(3) |
VistaIOEncodeAttrValue - encode an attribute value
VistaIOStringConst VistaIOEncodeAttrValue (dict, repn, value)
VistaIODictEntry *dict; VistaIORepnKind repn; type value;
where type, according to repn, is VistaIOBit, VistaIOUByte, VistaIOSByte, VistaIOShort, VistaIOLong, VistaIOFloat, VistaIODouble, VistaIOBoolean, or VistaIOString.
VistaIOEncodeAttrValue takes a value and an optional dictionary, and encodes the value as a character string suitable for storage in an attribute list or output to a data file.
With the dict argument you can provide a dictionary for mapping value to a keyword that will be returned as the encoded value (see VistaIOdictionary(3)). For example, if you pass a value of 1 and a dictionary that associates the value 1 with the keyword ubyte (as the dictionaryVistaIORepnDict does), then the string ubyte will be returned. Dictionaries may be used to map both numeric values and strings to keywords. If you supply a dictionary but value is not mentioned in that dictionary, then value itself will be encoded as a string and returned.
If successful, VistaIOEncodeAttrValue returns a string that is valid until the next VistaIOEncodeAttrValue, VistaIOSetAttr, or VistaIOSetAttrValue call. If, on the other hand, it fails because repn is not one of the representations supported, it returns NULL
VistaIODecodeAttrValue(3), VistaIOSetAttr(3), VistaIOattribute(3),
Art Pope <pope@cs.ubc.ca>
Adaption to vistaio: Gert Wollny <gw.fossdev@gmail.com>
24 April 1993 | VistaIO Version 1.2.14 |