Configuration Guide


Chapter 8. Setup File Utilities

This chapter describes command-line utilities that let you convert Panther setup files from source to binary format. Utilities are listed in alphabetical order; descriptions are organized into the following components, as applicable:


key2bin

Converts an ASCII key translation file into binary format

key2bin [-pv] [-e ext] keyFile ...

Arguments

-p
Places the binary files in the same directories as the key translation files.

-v
Lists the name of each key translation file as it is processed.

-e ext
Replaces default bin extension with the specified extension (ext) on the output file.

keyFile
The name of an ASCII key translation file; more than one key translation file can be included. By convention, the key translation filename is an abbreviation of the terminal's name plus keys. The tag keys helps identify the file as a key translation file; for example, vt100keys is the key translation file for a VT100. key2bin converts an ASCII key translation file that you have edited or created into binary format for use by applications using the Panther library.

Description

key2bin first tries to open its key translation file with the exact name you enter on the command line; if that fails, key2bin appends keys to the name and tries again. The output file is given the name of the successfully opened key translation file plus the default extension (.bin).

To make a key translation file memory-resident, run the bin2c utility on the binary file, compile the resulting program source file, and link it with your application. For a complete description of how to make configuration files memory-resident, refer to "Including Memory-Resident Components," in Application Development Guide.

Errors

The following table describes possible errors, their causes, and the corrective action to take.

Cannot create `Error writing'

Cause

An output file could not be created because of lack of permission or perhaps disk space.

Action

Correct the file system problem and retry the operation.

Duplicate key definition in line:\n '%s'

Cause

The same character-sequence was assigned to more than one logical key in the specified key translation file.

Action

Edit the ASCII file and assign a unique character-sequence to key or keys in question. Then run key2bin again.

Neither '%s' nor '%s' found.

Cause

A key translation file was missing or unreadable.

Action

Check the spelling, presence, and permissions of the file in question.

Unable to allocate memory

Cause

key2bin could not allocate enough memory for its needs.

Action

None.

No key definitions in file '%s'

Cause

Warning only. The key translation file was empty or contained only comments.

Action

None.

Unknown mnemonic in line: '%s'

Cause

The line printed in the message does not begin with a logical key mnemonic.

Action

Refer to smkeys.h for a list of mnemonics, and correct the input.

Extra characters in sequence neglected, in line: '%s'

Cause

The key sequence is longer than the maximum of six characters.

Action

Correct the input.

At least one file name is required.

Cause

One or more options was specified but no key translation file names were given.

Action

Specify file name(s).


var2bin

Converts ASCII setup files to binary format

var2bin [-pv] [-e ext] sourceFile...

-p
Places the binary output file in same directory as the input file.

-v
Lists the name of each input file as it is processed.

-e ext
Replaces the default bin extension on the output file with the specified extension (ext).

Description

The name of an ASCII setup file; you can specify more than one input file.

The output of var2bin is a binary file having the name of the file you have specified, with a default extension of bin. You designate this output file to be used as a setup file in either the SMVARS or SMSETUP variables, or in the system environment.

Errors

The following table describes possible errors, their cause, and the corrective action to take.

%s is an invalid name.

Cause

The indicated line did not begin with a valid variable name.

Action

Refer to Chapter 2, "Application Variables," for lists of variable names. Correct the ASCII input file, and run var2bin again.

At least one file name is required.

Cause

You have failed to give an input filename.

Action

Retype the command, supplying the ASCII setup filename.

Error opening %s.

Cause

An input file was missing or unreadable.

Action

Check the spelling, presence, and permissions of the file in question.

Missing '='.

Cause

An input line did not contain an equal sign after the variable name.

Action

Correct the ASCII input file by inserting the equal sign and run var2bin again.

Unable to allocate memory.

Cause

The utility could not allocate enough memory for its needs.

Action

None.

%s is an invalid parameter.

Cause

An option in the input is misspelled or misplaced, or conflicts with an earlier option.

Action

Check the valid options listed in Chapter 2, "Application Variables.". Correct the ASCII input file and run var2bin again.


vid2bin

Converts a video file to binary

vid2bin [-pv] [-e ext] vidFile...

Arguments

-p
Places the binary output file in same directory as input file.

-v
Lists the name of each video file as it is converted.

-e ext
Replaces the default bin extension with the specified extension (ext) on the output file. vid2bin converts ASCII video files to binary format. The ASCII video files distributed with Panther have been complied and their binary versions reside in the config directory.

vidFile
The name of an ASCII video file. Customarily, it is an abbreviation (mnemonic) of the terminal name followed by the suffix vid—for example sunvid for a terminal, or colvid for a color monitor.

Description

vid2bin searches for vidFile, first trying the mnemonic, then the mnemonic followed by vid. The output file gets the same name as the input file, with the extension bin or the extension (ext) that is specified by the -e option.

To make a video file memory-resident, run the bin2c utility on the binary output, compile the resulting program source file, and link it with your application. For a complete description of how to make configuration files memory-resident, refer to "Including Memory-Resident Components," in Application Development Guide.

vid2bin checks for errors like missing, misspelled, and superfluous keywords, but not for duplicated or conflicting entries. If errors are encountered, up to ten error messages can be displayed; no output file is created.

Errors

The following table describes possible errors, their causes, and the corrective action to take.

A cursor positioning sequence is required.
An erase display sequence is required.

Cause

Both entries (CUP and ED) are required in video files.

Action

Determine what your terminal uses to perform these two operations, and enter them in the ASCII video file; then run vid2bin again.

Invalid entry: '%s'.Entry missing '=': '%s'.

Cause

An input line does not begin with a valid video keyword. An input line does not include and an equal sign.

Action

Correct the ASCII file and run vid2bin again. Be sure that backslashes are placed at the end of lines that continue onto the next line.

Invalid attribute list : '%s'.
Invalid border information (%s):'%s'.
Invalid box information (%s): 's%'
Invalid color specification : '%s'.
Invalid cursor flags specification : '%s'.
Invalid graphics character specification (%s):'%s'.
Invalid graphics type : '%s'.
Invalid label parameter : '%s'.%s
Invalid numeric parameter : '%s'

Cause

There is a misspelled or misplaced keyword in the specified input line.

Action

Correct the ASCII video file, and run vid2bin again.

Neither %s nor %s found.

Cause

The video file was missing or unreadable.

Action

Check the spelling, presence, and permissions of the file in question.

Unable to allocate memory.

Cause

The utility could not allocate enough memory for its needs.

Action

None.