VistaIOReadFile(3)
π VistaIOReadFile(3) β the "read a Vista data file" glow-up π
okay bestie, sit down, hydrate, because today we're reading Vista data files and we're gonna slay it. this is a page from the Library Functions Manual, and it's literally about one function: VistaIOReadFile. no cap.
β¨ NAME β¨
VistaIOReadFile β read a Vista data file πΈ
π SYNOPSIS π
#include <stdio>
#include <vistaio.h>
VistaIOAttrList VistaIOReadFile (file, filter)
FILE *file;
VistaIOReadFileFilterProc *filter;
typedef VistaIOBoolean VistaIOReadFileFilterProc (VistaIOBundle, VistaIORepnKind);
look at her. so demure. so mindful. π
π ARGUMENTS π
fileβ the open stream you want the data file read from. hand her the stream, she does the rest π«Άfilterβ may be a function that decides which attributes' binary data actually gets read. or it can beNULL, which is the "idk just give me everything" option and means all binary data gets read π
π¦ DESCRIPTION π¦
okay so here's the tea: VistaIOReadFile reads the contents of a Vista data file. it hands you back a list of the attributes it found in that file. the attribute values in that list will have been converted to internal form, exactly as described by VistaIOattribute(3) and VistaIOtype(3). β¨
now the filter argument? that's your moment of control, bestie. you can supply a function that gets to decide, for each attribute value that is an object, whether or not that object's binary data should be read. the whole point of this mechanism is to let you dodge the expense of reading binary data that is not of interest β like, say, image pixel values when images are not of concern. iconic efficiency behavior π
but listen: you only need to supply a filter function if you are particularly concerned about efficiency. no pressure. your filter function should be declared like this:
VistaIOBoolean MyFilter (bundle, repn)
VistaIOBundle bundle;
VistaIORepnKind repn;
your filter function will be called once for each object encountered at any level in the file. it gets passed a VistaIOBundle representing the object β that's including its type name and attribute list, but not its binary data β plus the repn value you get by looking up its type name (i.e., the value returned by VistaIOLookupType(3) on the type name, which could be VistaIOUnknownRepn). π§
the object's binary data will be read only if the filter function returns TRUE. if it returns FALSE, the object will be represented in the attribute list as a VistaIOBundle, without binary data β it will not be converted to internal form (e.g., not to a VistaIOImage). and if no filter function is supplied at all (i.e., filter is NULL), VistaIOReadFile will read all binary data associated with all objects. periodt. π
for backwards compatibility,VistaIOReadFilewill recognize and read the contents of a UBC image file format (IFF) file. if the first character read from the stream is`I`,VistaIOReadFileusesVistaIOReadUbcIffto read a single UBC IFF image. the image is returned as aVistaIOImageattribute value in a list containing a single attribute. in this case, thefilterargument has no effect. π
β RETURN VALUE β
VistaIOReadData returns an attribute list representing the file's contents, or NULL if an error is encountered. in the case of an error, the stream may not have been completely read. π
πΈ SEE ALSO πΈ
VistaIOReadObjects(3)VistaIOReadUbcIff(3)stdio(3)VistaIOBundle(3)VistaIOattribute(3)VistaIOtype(3)
the whole friend group, fr fr π«Ά
π NOTES π
data is read from the stream sequentially, which means the stream is allowed to be a pipe. and ngl, no rewind is performed either before reading or after. not before, not after. she doesn't look back π
π DIAGNOSTIC π
okay these are the little messages she might hit you with. don't panic, just read them:
`EOF encountered in name attribute.`β the end-of-file was encountered unexpectedly while reading the value of the named attribute. π`File continues beyond expected EOF.`β the end-of-file wasn't encountered immediately after all expected binary data.`Invalid name attribute.`β the named attribute is encoded incorrectly in the stream. it may, for example, be missing the`:`that should separate its name and value.`Missing {.`β the`{`marking the start of an attribute list is missing.`Missing }.`β the`}`marking the end of an attribute list is missing.`name attribute has data but not length.`β the named attribute's value is an object whose attribute list contains a data attribute but not a length attribute. both attributes must be present to specify binary data. (a similar diagnostic is produced if there is a length attribute but no data attribute.) π`name attribute's attr attribute incorrect.`β the named attribute's value is an object whose attribute list indicates it has binary data. however, its data attribute specifies an offset too early in the binary data portion of the file, or its data or length attribute has a non-integer value.`Read from stream failed.`β an attempt to read a block of binary data failed, perhaps because of a premature end-of-file. π`Vista data file delimiter not found.`β the FORMFEED NEWLINE sequence terminating the attribute list portion of the data file wasn't found.`Vista data file isn't version 2.`β the data file's header indicates a file format version other than 2, the current version. version 2 or nothing, bestie.
π AUTHOR π
- Art Pope
<pope@cs.ubc.ca> - Adaption to vistaio: Gert Wollny
<gw.fossdev@gmail.com>
and that's the whole page, babes. this was VistaIOReadFile(3) from VistaIO Version 1.2.14, dated 26 January 1994 β yeah she's vintage and she still ate π
β¨ no cap. mwah, go read some files π«Άπ
π¦ 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