structmap command

Use the structmap command to display the format of IRIS structures. This is useful when writing applications that access IRIS data.

To make structmap available on your system, install IRIS with the –headers option .

structmap options

To show a list of structmap options, enter the command without options or parameters:

$ structmap
Command Line Options:
<struct name> :   Display internal contents of IRIS structure(s)
–include <dir> :  Override default 'include' directory name
–nopack :         Force no packing of structure elements
–scan :           Produce list of all defined structures
–scanlocal :      Like 'scan', but do local directory only
–noflags :        Suppress error flags in output
–recursive :      Descend into substructures
–data :           Show numeric data read from std.input
–dimension N :    Use with '-data' for N-dimensional printout

For example structmap 'structmap –scan' displays everything.

structmap <structure name> option

Invoke structmap with the name of a structure to display the name of the include file where the structure is defined and a description of each element in the structure.

It offsets from the beginning of the structure, its size, the number of times it occurs, its data type, and name.

For example, to display information about the tape_header_record structure:

$ structmap tape_header_record

tape_header_record /usr/include/irisrda/output.h
0       12        1	struct structure_header hdr
12      16       16	char stape_id[]
28      16       16	char sitename[]
44      12        1	struct ymds_time init_time
56       2        1	SINT2 idrive
58       2        2	char ipad58x2[]
60       8        8	char sversion[]
68     252      252	char ipad_end[]
320	

The example shows that the structure is defined in /include/irisrda/output.h and contains:

  • hdr, a structure of type structure_header, taking up the first 12 bytes.
  • stape_id and sitename, arrays of 16 characters each, at offsets 12 and 28.
  • init_time is a ymds_time, structures taking up 12 bytes starting at offset 44.
  • idrive, a long integer at offset 56.
  • ipad58x2, sversion, and ipad_end, arrays of 2, 8, and 252 characters, at offsets 58, 60, and 68, respectively.

The total size of the structure is 320 bytes.

–scan Option

The –scan option lists the names of the structure defined by IRIS.

You can use the –scan option to recursively call structmap and display the format of all the structures in the system.

$ structmap -scan
ant_manual_setup
bitex_field_def
bitex_top_def
cappi_psi_struct
.
.
.

To redirect the output to a file, type:

$ structmap 'structmap –scan' > allstructs.out