App Icon MetaKit sample code - Struct


This application highlights some low-level aspects of the MetaKit library.

What it does: Struct is a little utility which displays the data structure of any MetaKit datafile on standard output. The output uses a text-mode graph to display the data structure, which can be useful to determine what information is stored in a specific MetaKit datafile.

What it illustrates: For demonstration purposes, Struct has been compiled as a real-mode small-model MS-DOS utility program. It shows how you can extract structural information from a MetaKit datafile without knowing anything about it. The sample code includes a general "StructureMap" class to generate text-based graphs. The size of the STRUCT.EXE program demonstrates how small a fully self-contained application using MetaKit can be.

Note that although Struct must respect the very severe 64 K memory limit imposed by small-model MS-DOS, you can still use this program to examine the structure of files of any reasonable size. The reason for this is that MetaKit implements on-demand loading, and that Struct never accesses the actual data itself.

How to use it: To examine the structure of a datafile, simply run STRUCT.EXE from the MS-DOS prompt with the filename as argument. There are a few command-line options to control the output format, these are listed when you start Struct without a filename. They are:

You can redirect the output to file, just as with any other MS-DOS program.

Known problems: None.

Files in EXAMPLES\STRUCT:

STRUCT.CPP - Struct main program
STRUCT.MAK - MSVC 1.52 project makefile


||   Roadmap   Class Index   Sample Index   ||   Introduction   Tips and Tricks   ||