VistaIOReadFile - read a Vista data file
#include <stdio> #include <vistaio.h> VistaIOAttrList VistaIOReadFile (file, filter) FILE *file; VistaIOReadFileFilterProc *filter; typedef VistaIOBoolean VistaIOReadFileFilterProc (VistaIOBundle, VistaIORepnKind);
file Specifies the open stream from which the data file should be read. filter May specify a function that determines which attributes' binary data is read from the file, or it may be NULL to indicate that all binary data should be read.
VistaIOReadFile reads the contents of a Vista data file. It returns a list of the attributes found in the file. Attribute values in that list will have been converted to internal form, as described by VistaIOattribute(3) and VistaIOtype(3). With the filter argument you may 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. This mechanism allows you to avoid the expense of reading binary data that is not of interest (e.g., image pixel values when images are not of concern). However, you need only supply a filter function if you are particularly concerned about efficiency. Your filter function should be declared: 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 will be passed a VistaIOBundle representing the object (including its type name and attribute list, but not its binary data), and the repn value obtained 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). If no filter function is supplied (i.e., filter is NULL), VistaIOReadFile will read all binary data associated with all objects. For backwards compatibility VistaIOReadFile will recognize and read the contents of a UBC image file format (IFF) file. If the first character read from the stream is ``I'', VistaIOReadFile uses VistaIOReadUbcIff to read a single UBC IFF image. The image is returned as a VistaIOImage attribute value in a list containing a single attribute. In this case, the filter argument has no effect.
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.
VistaIOReadObjects(3), VistaIOReadUbcIff(3), stdio(3), VistaIOBundle(3), VistaIOattribute(3), VistaIOtype(3)
Data is read from the stream sequentially, permitting the stream to be a pipe. No rewind is performed either before reading or after.
``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.
Art Pope <pope@cs.ubc.ca> Adaption to vistaio: Gert Wollny <gw.fossdev@gmail.com>
Personal Opportunity - Free software gives you access to billions of dollars of software at no cost. Use this software for your business, personal use or to develop a profitable skill. Access to source code provides access to a level of capabilities/information that companies protect though copyrights. Open source is a core component of the Internet and it is available to you. Leverage the billions of dollars in resources and capabilities to build a career, establish a business or change the world. The potential is endless for those who understand the opportunity.
Business Opportunity - Goldman Sachs, IBM and countless large corporations are leveraging open source to reduce costs, develop products and increase their bottom lines. Learn what these companies know about open source and how open source can give you the advantage.
Free Software provides computer programs and capabilities at no cost but more importantly, it provides the freedom to run, edit, contribute to, and share the software. The importance of free software is a matter of access, not price. Software at no cost is a benefit but ownership rights to the software and source code is far more significant.
Free Office Software - The Libre Office suite provides top desktop productivity tools for free. This includes, a word processor, spreadsheet, presentation engine, drawing and flowcharting, database and math applications. Libre Office is available for Linux or Windows.
The Free Books Library is a collection of thousands of the most popular public domain books in an online readable format. The collection includes great classical literature and more recent works where the U.S. copyright has expired. These books are yours to read and use without restrictions.
Source Code - Want to change a program or know how it works? Open Source provides the source code for its programs so that anyone can use, modify or learn how to write those programs themselves. Visit the GNU source code repositories to download the source.
Study at Harvard, Stanford or MIT - Open edX provides free online courses from Harvard, MIT, Columbia, UC Berkeley and other top Universities. Hundreds of courses for almost all major subjects and course levels. Open edx also offers some paid courses and selected certifications.
Linux Manual Pages - A man or manual page is a form of software documentation found on Linux/Unix operating systems. Topics covered include computer programs (including library and system calls), formal standards and conventions, and even abstract concepts.