Provided by: libvistaio-dev_1.2.19-2_amd64
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.
dict May specify a dictionary to be used in translating the value supplied to a keyword that should be returned as the encoded value, or it may be NULL repn Specifies the representation of the value to be encoded. value Specifies the value to be encoded.
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),
``Can't encode from repn.'' The repn argument is not one of VistaIOBitRepn, VistaIOUByteRepn, ..., VistaIOBooleanRepn, or VistaIOStringRepn.
Art Pope <email@example.com> Adaption to vistaio: Gert Wollny <firstname.lastname@example.org>