Previous: Using Binary Labels Up: Dealing with Binary Labels

Binary Label Type

Historically, there has been no way to determine what kind of binary label was on a file, just the size of it. You could guess it was a certain kind (like a Voyager label), but if you were incorrect you would get invalid data, with no error checking. You simply had to know beforehand what kind of data you had.

In order to solve this problem, a new system label has been added, called BLTYPE (Binary Label TYPE). While BLTYPE does not affect portability per se, it does greatly improve the documentation of files and it makes the VICAR system more robust. Everyone using binary labels, whether they are working on a portable program or not, is encouraged to make use of BLTYPE.

BLTYPE is simply a string that describes the kind of binary label present in the file. It may be set via x/ zvadd or x/ zvopen, or by calling x/ zladd on an already open file. No error checking or valid values are enforced by the RTL, so it is up to application programmers to make sure it is used properly.

The BLTYPE string should be a short string (maximum 32 characters) that gives a name to the binary label type. It does not attempt to describe the fields in the binary label at all, but merely provides a pointer to how the fields could be determined. Some of the currently registered names are ``GLL_SSI_EDR'', ``IBIS'', and ``M94_HRSC''.

In order to maintain a consistent set of names, a name registry (similar to the one for properties) has been established for BLTYPE. Every value for BLTYPE must be entered into this registry, with a pointer to documentation describing the layout of the binary label. If you want to create a new kind of binary label, simply tell the keeper of the registry what name you want to use and what the layout is (either explicitly or by stating that it is in document ). The registrar will check for duplicates, approve your request, and enter your name into the registry.

At the present time, the keeper of this registry is the VICAR system programmer.

It is important to note that the RTL makes no checks on the validity of the names used. It is the responsibility of each individual programmer to make sure that they use this system. Failure to do so may result in your program not being accepted for delivery.

Application programs that expect a certain kind of binary label should check the value of BLTYPE to make sure that they have been given the correct type, and should issue an error message if it is incorrect. If BLTYPE is not present or blank, assume that the binary label is of the correct type for backwards compatibility.

More sophisticated application programs could use the BLTYPE field to enable them to read several different kinds of binary labels. These could be different versions of the same basic binary label (e.g. a type of ``X V2.0'' for version 2 of the X label type), or they could be completely different labels from different projects. Widespread use of BLTYPE will eventually allow a general-purpose program to be written that understands most if not all of the binary label types.