VistaIOExtractAttr(3)
β¨ NAME β¨
VistaIOExtractAttr β bestie, this is the one that fetches an attribute AND deletes it in one go π
(Also, hi, this is from the Library Functions Manual, section 3, the VistaIO crew π«Ά)
πΈ SYNOPSIS πΈ
VistaIOBoolean VistaIOExtractAttr (list, name, dict, repn, value, required)
VistaIOAttrList list;
VistaIOStringConst name;
VistaIODictEntry *dict;
VistaIORepnKind repn;
VistaIOPointer value;
VistaIOBoolean required;
π ARGUMENTS π
listβ the list of attributes we're gonna search through, by name, looking for the one you want. πnameβ the name of the attribute you're manifesting.dictβ may specify a dictionary used to recognize a keyword stored as the attribute's valueβ¦ or it can just beNULL, no pressure. πrepnβ the representation you want the attribute value handed back to you in.valueβ the location where the attribute value gets returned. πrequiredβ isTRUEif not finding the attribute should count as an error. yes, it's that serious.
π DESCRIPTION π
VistaIOExtractAttr locates the first attribute named name in list, removes it if it's found, and returns its value. It's giving "grab your stuff and go" energy, fr fr.
So if a dictionary, dict, has been provided and the attribute's value is stored as a character string, the routine checks whether that string is a keyword defined in the dictionary. If it is, it uses the value associated with that keyword instead of the attribute's original value. (Peep the VistaIOdictionary(3) manual page for the deets.) π
The value obtained β either directly from the attribute or indirectly via the dictionary β gets converted to the representation repn and then stored at the location pointed to by value. The repn argument may have any VistaIORepnKind value, or any of the values returned by VistaIORegisterType(3). However β and this is the part you can't skip, bestie β an attribute value that is a string can only be returned as a string or a number, and other attribute values can only be returned in the representation with which they are stored. (You can use the VistaIOGetAttrRepn(3) macro to figure out an attribute value's representation.) π
π₯ RETURN VALUES π₯
VistaIOExtractAttr returns FALSE if required is TRUE and no attribute named name is found. It also returns FALSE if an attribute is found but its value cannot be converted to the desired representation. π
Otherwise, VistaIOExtractAttr returns TRUE while perhaps modifying the list list and storing a value at value. slay. β¨
π SEE ALSO π
VistaIOGetAttr(3), VistaIOGetAttrValue(3), VistaIOLookupAttr(3), VistaIODeleteAttr(3), VistaIOInsertAttr(3), VistaIOattribute(3), VistaIOdictionary(3),
π¦ NOTES π¦
VistaIOExtractAttris meant for use with attribute lists representing sets, where each attribute name occurs at most once. Iflistcontains multiple attributes namedname, only the first is located. first come first served, iykyk. π- The
valueargument must point to sufficient storage to contain a value of the representation requested. Neither the routine nor the C compiler can automatically check that this is so. π no cap, you gotta get this right yourself. - If a string value is returned, it will be in newly-allocated storage. Release the storage with
VistaIOFree(3)when you're done with the string. don't leave it hanging, bestie π«Ά
π DIAGNOSTICS π
- **``name attribute missing.''
** β No attribute named *name* could be found, and *required* isTRUE`. - ``name attribute has bad value.''` β The attribute was found, but its value cannot be converted to the desired representation.
π AUTHOR π
Art Pope <pope@cs.ubc.ca>
Adaption to vistaio: Gert Wollny <gw.fossdev@gmail.com>
okay that's the whole page, you ate that π this was VistaIO Version 1.2.14, dated 24 April 1993 β iconic behavior, honestly. mwah πβ¨
π¦ where this page comes from
- debian bookworm: libvistaio-dev 1.2.19-3 Β· libvista-orig
- debian trixie: libvistaio-dev 1.2.19-3+b2 Β· libvista-orig
- ubuntu jammy: libvistaio-dev 1.2.19-3 Β· libvista-orig
- ubuntu noble: libvistaio-dev 1.2.19-3 Β· libvista-orig
- ubuntu questing: libvistaio-dev 1.2.19-4
- ubuntu resolute: libvistaio-dev 1.2.19-4build1 Β· libvista-orig
- ubuntu stonking: libvistaio-dev 1.2.19-4build1 Β· libvista-orig
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms