Libraries and Packages: The VOS Interface

2.12 Miscellaneous -- etc


cl Environment Variables

These
procedures return the value of a cl environment variable. There is a separate procedure for each of the data types bool, int, real, double, and character strings. There is no distinction made between the variously sized integer variables. If the variable is not found or cannot be converted to the appropriate data type, the procedures abort.

Table 2.86: Reading Environment Variables.

Time and Timing

These
procedures deal with absolute local time as well as relative CPU clock time.

Table 2.87: Clock and Timing Procedures.

The clktime() procedure gets the current clock time (local standard time) in units of seconds since 00:00:00 1 January 1980. This can be broken down into days, hours, seconds, etc. with brktime(), or printed as a date and time string with cnvtime(). The brktime() breaks the long integer time returned by clktime() into the fields of the structure defined in <time.h>. The procedure is valid from 00:00:00 on 1 January 1980 to 23:23:59 28 on February 2100. cnvdate() converts a time in integer seconds since midnight on 1 January 1980 into a short string such as "May 15 18:24". cnvtime() converts a time in integer seconds since midnight on 1 January 1980 into a string, i.e., "Mon 16:30:05 17-Mar-82". The length of the output strings for the procedures is given by the parameter SZ_DATE in <time.h>.



Table 2.88: Time Parameters.

Process Information

These procedures
return information about the current process.

Table 2.89: Process Information Functions.

The getpid() procedure returns an integer process identifier, while the others return a string value. The sysid() procedure returns a line of text identifying the current user, machine, and version of IRAF, and containing the current date and time of the form:

NOAO/IRAF V1.3 username@lyra Tue 09:47:50 27-Aug-85
The string NOAO/IRAF V1.3 is given by the value of the cl environment variable version. The string username is the value of the environment variable userid, defined by the user in the login.cl file. The output string is not terminated by a newline.

Convert Flags

These procedures convert between bool variables and int logical flags having the values YES or NO.

Table 2.90: Flag Conversion Functions.

Miscellaneous Functions



Table 2.91: Miscellaneous Functions.

The oscmd() procedure sends a machine dependent command to the host operating system. It tries to spool the standard output and error output in the named files if the names for the files are not null. The integer flag OK is returned if the command executes successfully. The qsort() procedure is a general quicksort for arbitrary objects. The argument x is an int array indexing the array to be sorted. The user supplied function compare(x1,x2) is used to compare objects indexed by x. The value returned by compare has the following significance for sorting in increasing order:

cl Environment Variables
Table 2.86: - Reading Environment Variables.
Time and Timing
Table 2.87: - Clock and Timing Procedures.
Table 2.88: - Time Parameters.
Process Information
Table 2.89: - Process Information Functions.
Convert Flags
Table 2.90: - Flag Conversion Functions.
Miscellaneous Functions
Table 2.91: - Miscellaneous Functions.

Generated with CERN WebMaker