Up | Previous | Next | Title Page | Contents

8.2 Utility API

8.2.1 abend/zabend—Terminate processing abnormally

call abend() 
zabend() 
abend issues a message indicating that abend was called, and then calls x/zvend with a status of zero to indicate a program failure. Any open VICAR files are closed and write buffers flushed before termination.

8.2.2 x/zmove—Move bytes from one buffer to another

call xmove(from, to, len) 
zmove(from, to, len);
Move bytes from one buffer to another. Overlapping moves are handled correctly, unlike the C routine memcpy().

Arguments:

8.2.3 x/zvbands—Return band usage information

call xvbands(sb, nb, nbi)
zvbands(sb, nb, nbi);

x/zvbands is analogous to x/zvsize in its usage. It returns information from the command line given in either the BANDS or the SB, NB parameters, or, if the parameters were not specified, from the input file size.

Arguments:

8.2.4 x/zvcmdout—Sends a command string to TAE to be executed

call xvcmdout(command, status) 
status = zvcmdout(command);
Sends a command string to TAE to be executed, and returns output values in the interactive parblock, accessible by the x/zviparm family of routines. The command must be a TAE intrinsic command, or a procedure PDF that uses only intrinsic commands, i.e. no processes, no DCL or shell. This is mainly intended for running VIDS procedures from within a program, but it may have other applications as well.
This routine is quite similar to x/zvcommand. The only difference is that x/zvcmdout makes any output variables accessible. This is most useful with the VIDS JGET command, which returns values to the caller in TAE variables. These variables are placed in the interactive parblock.

Arguments:

8.2.5 x/zvcommand—Execute a VICAR command string

call xvcommand(command,status) 
status =zvcommand(command,status) 

x/zvcommand passes a command string on to the VICAR supervisor (TAE) for execution.

The command may be a VICAR intrinsic command or a procedure PDF that uses only VICAR intrinsic commands (or other procedure PDF's). Process PDF's and DCL commands are not allowed. Examples of commands that are allowed are VIDS commands and tape mounting commands (but NOT tape initialization since it uses DCL commands).

Arguments:

8.2.6 x/zvfilename—Returns a filename suitable for use with a system open() call

call xvfilename(in_name, out_name, status) 
status = zvfilename(in_name,out_name, out_len);
Given a filename as input by the user, this function returns a filename suitable for use with a system open() call or other non-VICAR file operation. For UNIX, this means that environment variables and ~username are expanded. For VMS, this means the old-style temporary filename suffix. Z xx is added. For both systems, the “ + “ form of temporary file is expanded.
This function does not need to be called if the RTL is used for I/O (it is called internally by x/zvopen). But, any program that gets a filename from the user for use in non-RTL I/O should make use of this function.
Because this function is only intended for use with non-VICAR I/O, only diskfile names are supported. Names specifying tape files or memory files will be treated as if they were disk files, which could provide surprising results. “ *” as a wildcard character is legal in this function, and is passed through unchanged (so the output has a “ *” in it).
For UNIX, the expansions are as follows:
For VMS, the expansions are as follows:
Under VMS, both expansions may occur on the same name.
The temporary filename locations ( $VTMP and vtmp) are set up in vicset2.

Arguments:

8.2.7 x/zvfilpos—Return the current tape position

POSITION = x/zvfilpos(UNIT) 
x/zvfilpos looks up the current file position of the given unit if it is a tape, and returns it in POSITION. If the file is not on tape, -1 is returned.
This routine assumes that file UNIT has already been opened with x/zvopen.

Arguments:

8.2.8 x/zvmessage—Log a user message

call xvmessage(message, key) 
zvmessage(message, key) 
x/zvmessage is the primary subroutine to be used to print messages on the user terminal or in log files. It will work whether or not the program is under the VICAR supervisor, and allows the specification of a “key” for help on the message.

Arguments:

8.2.9 x/zvselpi—Selects the file to use as the primary input

call xvselpi(instance) 
zvselpi(instance);
Selects the file to use as the primary input. The primary input is normally the first file given in the INP parameter. It is used for several purposes. If file attributes like size, type, etc. aren’t specified when opening a file, defaults are taken from the primary input. When creating a new output file, history and property labels for it are copied from the primary input, in order to maintain the processing history and file attributes.
In the rare cases where the first INP file is not appropriate for the primary input, calling x/zvselpi allows you to change the file that is used as the primary input, or to disable the primary input altogether. The file selected must still be one of the files in the INP parameter. For example, you might be taking n input files and creating n output files after doing the same processing to each. You would want to set the primary input for each output file to the corresponding input file, in order to preserve the history labels. Or, you may want to create a file with no history labels whatsoever (except for the current task).
This routine should be called before the x/zvopen of the output file you want associated with the input. The only routines that use the primary input directly are x/zvopen, x/zvsize, and x/zvbands. The primary input in effect at the time each of these routines is called determines which input file is used. You may change x/zvselpi after the x/zvopen statement, even if you do more processing to the file. It will still use the primary input in effect at the time the file was opened.
It is slightly more efficient to call x/zvselpi before you open the primary input file for other reasons, because it avoids an extra file open. However, this should not have a big impact.
There is no status return from this routine.

Arguments:

8.2.10 x/zvselpiu—Selects the file to use as primary input

call xvselpiu(unit) 
zvselpiu(unit);
Selects the file to use as the primary input. The primary input is normally the first file given in the INP parameter. It is used for several purposes. If file attributes like size, type, etc. aren’t specified when opening a file, defaults are taken from the primary input. When creating a new output file, history and property labels for it are copied from the primary input, in order to maintain the processing history and file attributes.
In the rare cases where the first INP file is not appropriate for the primary input, calling x/zvselpiu allows you to change the file that is used as the primary input. This unit then becomes the primary input. This allows any file, not just one associated with the INP parameter, to be the primary input. The file associated with the unit may be open or closed,but you should not free the unit (CLOS_ACT, FREE) as long as it is the primary input. A primary input unit of 0 is valid. To disable the primary input completely, call x/zvselpi(0); do not use x/zvselpiu() for this case.
This routine should be called before the x/zvopen of the output file you want associated with the input. The only routines that use the primary input directly are x/zvopen, x/zvsize, and x/zvbands. The primary input in effect at the time each of these routines is called determines which input file is used. You may change x/zvselpiu after the x/zvopen statement, even if you do more processing to the file. It will still use the primary input in effect at the time the file was opened.
It is slightly more efficient to call x/zvselpiu before you open the primary input file for other reasons, because it avoids an extra file open. However, this should not have a big impact.
There is no status return from this routine.

Arguments:

8.2.11 x/zvsize—Return image size values

call xvsize(sl, ss, nl, ns, nli, nsi)
zvsize(sl, ss, nl, ns, nli, nsi); 
x/zvsize searches the user parameters and the first input file for image size values. The values are returned as described below under “arguments”. If there is an input file, it must be opened before calling x/zvsize.
For 3 dimensional files x/zvsize must be supplimented with x/zvbands, which returns infomation about bands..

Arguments:


Up | Previous | Next | Title Page | Contents