[an error occurred while processing this directive]
![]() |
![]() HP OpenVMS Systems Documentation |
![]() |
HP OpenVMS RTL Library (LIB$) Manual
LIB$GET_EF
The Get Event Flag routine allocates one local event flag from a processwide pool and returns the number of the allocated flag to the caller. If no flags are available, LIB$GET_EF returns an error as its function value. FormatLIB$GET_EF event-flag-number RETURNS
Argument
DescriptionLIB$GET_EF and LIB$FREE_EF cause local event flags to be allocated and deallocated at run time, so that your routine remains independent of other routines executing in the same process. Condition Values Returned
LIB$GET_FOREIGN
The Get Foreign Command Line routine requests the calling image's command language interpreter (CLI) to return the contents of the "foreign command" line that activated the current image. FormatLIB$GET_FOREIGN resultant-string [,prompt-string] [,resultant-length] [,flags] RETURNS
Arguments
DescriptionLIB$GET_FOREIGN returns the contents of the command line that you use to activate an image. It can be used to give your program access to the qualifiers of a foreign command or to prompt for further command line text. Condition Values Returned
A condition value returned by OpenVMS RMS. SYS$INPUT was prompted for command text and RMS returned an error. The most typical error will be RMS$_EOF, end-of-file. Example
LIB$GET_FULLNAME_OFFSET
The Get the Offset to the Starting Position of the Most Significant Part of a Full Name routine returns the offset to the starting position of the most significant part of a full name.+ The most significant part of a full name is determined by the underlying network services. FormatLIB$GET_FULLNAME_OFFSET fullname, offset RETURNS
Arguments
DescriptionThis routine returns the byte offset of the starting position of the most significant part of the input full name. The returned offset can be used to position the display of a full name in a fixed-size output region, for example, scroll regions in DECwindows applications. The most significant part of a full name is determined by the underlying network services. Condition Values Returned
Any condition value returned by the $IPC DECnet service.
|
Full Name | Offset |
---|---|
NODE | 0 |
DEC:.FOO.NODE | 9 |
+ No support for arguments passed by 64-bit address reference or for use of 64-bit descriptors, if applicable, is planned for this routine. |
The Get Host Node Name routine returns the host node name of the local system.
Note
No support for arguments passed by 64-bit address reference or for use of 64-bit descriptors, if applicable, is planned for this routine.
LIB$GET_HOSTNAME hostname [,resultant-length] [,flags]
OpenVMS usage: cond_value type: longword (unsigned) access: write only mechanism: by value
hostname
OpenVMS usage: char_string type: character string access: write only mechanism: by descriptor
The host node name. The hostname argument contains the address of a descriptor pointing to the host node name. LIB$GET_HOSTNAME writes the host node-name string into the buffer pointed to by the hostname descriptor.The error LIB$_INVSTRDES is returned if hostname is an invalid descriptor.
The length field of the hostname descriptor is not updated unless hostname is a dynamic descriptor with a length less than the host node name to be returned. Refer to the OpenVMS RTL String Manipulation (STR$) Manual for dynamic string descriptor usage.
The hostname argument contains an unusable result when LIB$GET_HOSTNAME returns in error.
resultant-length
OpenVMS usage: word_unsigned type: word (unsigned) access: write only mechanism: by reference
Length of the host node name. The resultant-length argument is the address of an unsigned word that contains this length in bytes.The resultant-length argument contains an unusable result when LIB$GET_HOSTNAME returns in error.
flags
OpenVMS usage: mask_longword type: longword (unsigned) access: read only mechanism: by value
The value LIB$GET_HOSTNAME uses to control the form of the host node name that it returns in the output descriptor hostname. If flags is equal to 0, or if flags is omitted, the host node name returned is in the network usable form. If flags is equal to 1, the host node name returned is in the parsable form.Unused bits in flags must be 0. Nonzero unused bits result in the error condition LIB$_INVARG.
This routine returns the host node name. The routine searches for the first host node name using the following order:
- Get host node name from $GETSYI system service.
- Translate the executive mode logical SYS$NODE_FULLNAME once.
- Translate the executive mode logical SYS$NODE once.
The error LIB$_NOHOSNAM is returned if no host node name is found.
LIB$GET_HOSTNAME can return the host node name in the following two forms:
- Network usable form --- The form that can be passed directly to the network. This form does not contain unnecessary double quotation marks (double quotation marks ["] that are not part of the node name) and also does not contain trailing double colons, for example: DEC:.FOO."simple name with spaces" .
- Parsable form --- The form that can be passed directly to the part of the system that does node-name syntax parsing, for example, $FILESCAN and DCL command parsing. This form contains trailing double colons and is fully quoted if there are special characters. Individual double quotation marks (") that are part of a simple name are doubled (""), for example: "DEC:.FOO.""simple name with spaces""":: .
You must use double quotation marks for a node name with special characters to facilitate correct parsing.If the returned node name overflows the buffer pointed to by hostname, the host node name is truncated at the end, and the alternate success status LIB$_STRTRU is returned.
The resultant-length argument, if supplied, is set to the length of the node-name string copied to the output buffer pointed to by hostname.
SS$_NORMAL Routine successfully completed. LIB$_STRTRU Routine successfully completed. Characters are truncated in the output buffer pointed to by hostname. LIB$_INVARG Invalid input argument. Unused bits in flags are not set to 0. LIB$_INVSTRDES Invalid string descriptor. LIB$_WRONUMARG Wrong number of arguments. LIB$_NOHOSNAM No host node name found.
Any condition value returned by LIB$SCOPY_R_DX, or the $FILESCAN system service.
The Get Line from SYS$INPUT routine gets one record of ASCII text from the current controlling input device, specified by SYS$INPUT.
LIB$GET_INPUT resultant-string [,prompt-string] [,resultant-length]
OpenVMS usage: cond_value type: longword (unsigned) access: write only mechanism: by value
resultant-string
OpenVMS usage: char_string type: character string access: write only mechanism: by descriptor
String that LIB$GET_INPUT gets from the input device. The resultant-string argument is the address of a descriptor pointing to the character string into which LIB$GET_INPUT writes the text received from the current input device.prompt-string
OpenVMS usage: char_string type: character string access: read only mechanism: by descriptor
Prompt message that is displayed on the controlling terminal. The prompt-string argument is the address of a descriptor containing the prompt. Any string can be a valid prompt. By convention however, a prompt consists of text followed by a colon (:), a space, and no carriage-return/line-feed combination. The maximum size of the prompt message is 255 characters. If the controlling input device is not a terminal, this argument is ignored.resultant-length
OpenVMS usage: word_unsigned type: word (unsigned) access: write only mechanism: by reference
Number of bytes written into resultant-string by LIB$GET_INPUT, not counting padding in the case of a fixed string. The resultant-length argument is the address of an unsigned word containing this number. If the input string is truncated to the size specified in the resultant-string descriptor, resultant-length is set to this size. Therefore, resultant-length can always be used by the calling program to access a valid substring of resultant-string.
LIB$GET_INPUT uses the OpenVMS RMS $GET service to get one record of ASCII text from the current controlling input device, specified by SYS$INPUT. (For more information about the RMS $GET service, see the OpenVMS Record Management Services Reference Manual.)When you log in, the OpenVMS operating system creates three files as default I/O control streams for your process.
- SYS$INPUT, your default input device
- SYS$OUTPUT, your default output device
- SYS$COMMAND, the device that supplies the commands to your process
These files remain open until you log out. They are the interface between your interactive input and output or your batch commands and the OpenVMS software. Initially, all three names are equated with the terminal. However, with the DCL command ASSIGN, you can change these assignments to obtain information from a file or put information into a file. SYS$INPUT and SYS$COMMAND are usually identical, but the input and command streams can be different. For example, during the execution of an indirect command file from an interactive terminal, SYS$COMMAND refers to the terminal and SYS$INPUT refers to the command file.
LIB$GET_INPUT opens file SYS$INPUT on the first call. The RMS internal stream identifier (ISI) is stored in the routine's static storage for subsequent calls.
If prompt-string is provided and the SYS$INPUT device is a terminal, LIB$GET_INPUT displays the prompt message. If the device is not a terminal, the prompt-string argument is ignored.
If you want to get input from some source other than the current input stream, use LIB$GET_COMMAND.
SS$_NORMAL Routine successfully completed. RMS completion status. LIB$_FATERRLIB An internal consistency check on Run-Time Library data structures has failed. This may indicate a programming error in the Run-Time Library, or that your program may have overwritten those data structures. LIB$_INPSTRTRU The input string has been truncated to the size specified in the resultant-string descriptor (fixed-length strings only). The resultant-length argument is also set to this size. This is an error (as opposed to LIB$_STRTRU, which is a success) because the truncation is not under program control. LIB$_INSVIRMEM Insufficient virtual memory to allocate the dynamic string. LIB$_INVARG Invalid arguments. The descriptor class field is not a recognized code or is zero.
Previous | Next | Contents | Index |