|
|
G2 is a simple data language which provides a visible and program-independent form for data records. G2 records are just sequences of ASCII characters on a byte stream. They ``look'' like indented outlines and contain only visible characters.
Though G2 records are program-independent, a simple interface mechanism makes it quite easy to read and write G2 records from C programs: A G2 record definition is compiled to yield (1) a C typedef and (2) a typedef descriptor, which is an initialized C data structure describing the physical layout of the type defined by the typedef. Typedef descriptors are used by I/O functions to provide direct record-level I/O between C structures and ASCII streams. An interpretive C interface is also provided which presents G2 records to the C program in a navigable tree structure.