Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ inquire_string_device_state(3P) — PHIGS 1.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

INQUIRE STRING DEVICE STATE(3P)  —  SUNPHIGS LIBRARY

NAME

INQUIRE STRING DEVICE STATE − inquire state of a STRING device

SYNOPSIS

C Syntax

void
pinqstringst ( ws, dev, size, error_ind, buffer, total_size, state )
Pintws;workstation identifier
Pintdev;string device number
Pintsize;size of application buffer
Pint∗error_ind;OUT error indicator
Pchar∗buffer;OUT pointer to buffer
Pint∗total_size;OUT actual size of buffer
Pstringst∗state;OUT string device state

FORTRAN Syntax

SUBROUTINE pqsts ( WKID, STDNR, MLDR, ERRIND, MODE, ESW, LOSTR, ISTR, PET, EAREA,
    BUFLEN, INIPOS, LDR, DATREC )
INTEGERWKIDworkstation identifier
INTEGERSTDNRstring device number
INTEGERMLDRdimension of data record array
INTEGERERRINDOUT error indicator
INTEGERMODEOUT operating mode (PREQU, PSAMPL, PEVENT)
INTEGERESWOUT echo switch (PNECHO, PECHO)
INTEGERLOSTROUT number of characters returned
CHARACTER∗(∗)ISTR OUT initial string
INTEGERPETOUT prompt/echo type
REALEAREA(4)OUT echo area in device coordinates
INTEGERBUFLENOUT input buffer size
INTEGERINIPOSOUT initial cursor position
INTEGERLDROUT number of array elements used
in data record
CHARACTER∗80DATREC(MLDR) OUT data record

FORTRAN Subset Syntax

SUBROUTINE pqsts ( WKID, STDNR, MLDR, ERRIND, MODE, ESW, LOSTR, ISTR, PET, EAREA,
    BUFLEN, INIPOS, LDR, DATREC )
INTEGERWKIDworkstation identifier
INTEGERSTDNRstring device number
INTEGERMLDRdimension of data record array
INTEGERERRINDOUT error indicator
INTEGERMODEOUT operating mode (PREQU, PSAMPL, PEVENT)
INTEGERESWOUT echo switch (PNECHO, PECHO)
INTEGERLOSTROUT number of characters returned
CHARACTER∗80ISTR OUT initial string
INTEGERPETOUT prompt/echo type
REALEAREA(4)OUT echo area in device coordinates
INTEGERBUFLENOUT input buffer size
INTEGERINIPOSOUT initial cursor position
INTEGERLDROUT number of array elements used
in data record
CHARACTER∗80DATREC(MLDR) OUT data record

Required PHIGS Operating States

(PHOP, WSOP, ∗, ∗)

DESCRIPTION

Purpose

Use INQUIRE STRING DEVICE STATE to determine the current state of the specified STRING device. 

C Input Parameters

Applications using the C binding must allocate a buffer to be used by this function as memory space for storing data associated with the device state.  This buffer is passed as the buffer argument.  The size of the buffer, in bytes, must be passed in the size argument.  The required size is returned in the argument total_size.  The caller can determine the required size by calling this function with size set to zero, in which case PHIGS will return the size needed in total size.  The size in general will not be zero but in some cases it may be, depending on the device state. 

Even if the buffer size specified is too small, including the case of its being zero, some values will be returned.  These are the total size, the operating mode, the echo switch, the prompt/echo type and the echo area.  Error PEBUFSPAC (2200) is returned if size is too small, but not if it’s zero. 

wsWorkstation identifier. An integer specifying the workstation with which the specified STRING device is associated. 

devThe device number of the string device.  See the Available Devices section of INITIALIZE STRING for a description of the available devices. 

sizeThe size, in bytes, of buffer. 

error_ind
The error indicator.  See the Execution section below for a description of its use.  See the Errors section below for the possible values it may return. 

bufferA pointer to the buffer, allocated by the application, to be used by PHIGS to store portions of the returned data. 

total_size
A pointer to an integer in which PHIGS returns the size of the buffer needed, in bytes, to return all the information. 

stateA pointer to a Pstringst structure containing the current state of the specified string device.  Pstringst is defined in phigs.h as follows:

typedef struct {
Pimodemode;/∗ operating mode ∗/
Peswesw;/∗ echo switch ∗/
Pchar∗string;/∗ initial string ∗/
Pintpet;/∗ prompt/echo type ∗/
Plimite_area;/∗ echo area ∗/
Pstringrecrecord;/∗ data record ∗/
} Pstringst;

FORTRAN Input Parameters

Applications using the FORTRAN binding must supply a CHARACTER array to this function, into which the system will place the contents of the device’s input data record.  The contents of the data record are subsequently extracted by the application with the function UNPACK DATA RECORD.  The allocated dimension of the character array is passed in the MLDR argument.  The dimension needed is returned in the LDR argument.  The caller can determine the required dimension by calling this function with MLDR set to zero. 

Even if the dimension specified in MLDR is too small, including the case of its being zero, some values will be returned.  These are LDR, the operating mode, the echo switch, the initial string, the prompt/echo type, the buffer length, the edit position, and the echo area. 

Error 2001 is returned if MLDR is too small, but not if it is zero. 

WKIDThe workstation identifier of the workstation associated with the device. 

STDNR
The device number of the STRING device.  See the Available Devices section of INITIALIZE STRING for a description of the available devices. 

MLDR
The dimension of the data record array, DATREC. 

ERRIND
The error indicator.  See the Execution section below for a description of its use.  See the Errors section below for the possible values it may return. 

MODE
The operating mode.

ESWThe echo switch. 

LOSTR
The number of characters in the initial string.

STRThe array in which to store the initial string.  The size of this array should be at least as large as the buffer size of the device. 

PETThe prompt/echo type. 

EAREA
An array containing the limits of the echo area, XMIN, XMAX, YMIN, YMAX, in Device Coordinates. 

BUFLEN
The buffer size of the device.

INIPOS
The edit position.

LDRThe required dimension of the data record array, DATREC. 

DATREC
The data record array.

Execution

INQUIRE STRING DEVICE STATE returns the current state of the specified string device, which is stored in the workstation state list of the workstation associated with the device.  The current state includes the operating mode, echo switch, initial string, prompt/echo type, echo area, buffer length, edit position,  and data record.  See SET STRING MODE for a description of the operating mode and the echo switch and how to set these values.  See INITIALIZE STRING for a description of the initial string, prompt/echo type, echo area and data record contents and how to set these values. 

Except in the cases mentioned in the C and FORTRAN Parameters sections above, if an error is detected by this function the error indicator will indicate the error number of the error detected and no other output data will be returned.  If no error is detected, the error indicator will be set to zero and the inquired information will be available in the output parameters.  Since this is an inquiry function, ERROR HANDLING is not invoked when an error is detected by this function. 

ERRORS

003Ignoring function, function requires state (PHOP, WSOP, ∗, ∗)

054Ignoring function, the specified workstation is not open

061Ignoring function, specified workstation is neither of category INPUT nor of category OUTIN

250Ignoring function, the specified device is not available on the specified workstation

2200C: Buffer overflow in input or inquiry function

2001FORTRAN: Ignoring function, output parameter size insufficient -- a FORTRAN array or string being passed as an output parameter is too small to contain the returned value. 

SEE ALSO

SET STRING MODE (3P)
INITIALIZE STRING (3P)
INQUIRE STRING DEVICE STATE 3 (3P)

Sun Release 4.0  —  Last change: 10 July 1989

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026