[ Previous | Next | Contents | Glossary | Home | Search ]
The graPHIGS Programming Interface : Subroutine Reference

GPPREC - Pack Data Record

GPPREC (numi, iary, numr, rary, nums, swidth, lens, sary, mlodr, errind, lodr, datarec)

Purpose

Use GPPREC to construct a data record for passing to input device initialization routines. The data record constructed by GPPREC consists of a header identifying the number of integers, reals, and character strings in the data record, followed by the actual data. The lodr and datarec output parameters can be passed to the desired input device initialization subroutine.

GPPREC accepts as input a list of integers, a list of reals, and a list of character strings. The list of character strings is passed in a format similar to a pointlist. That is, a width parameter is specified (swidth) which tells the graPHIGS API how many bytes are placed between the starting location of subsequent character strings. The length of each character string is specified in a separate array of lengths (lens)

If the area passed is not large enough to contain the entire data record, the error indicator is set to 509 and no data is placed in the output area.

Parameters

numi -- specified by user, fullword integer

Number of integers in the list of integers which follows (>=0)

iary -- specified by user, array of fullword integers

Array of integers to be placed in data record.

numr -- specified by user, fullword integer

Number of real values in the list of real values which follows (>=0)

rary -- specified by user, array of short floating-point numbers

Array of reals to be placed in the data record.

nums -- specified by user, fullword integer

Number of strings in the list of strings which follows (>=0)

swidth -- specified by user, fullword integer

Width of string array. The number of bytes between subsequent entries in the list of character strings which follows (>=0)

lens -- specified by user, array of fullword integers

List of lengths, in bytes, of character strings in the array which follows (>=0)

sary -- specified by user, variable length character string

Array of character strings to be placed in the data record. The portion of this array which is used is defined by the swidth and lens parameters. The lens parameter specifies the length of each string in the array and the swidth parameter specifies the spacing between subsequent entries in the array of strings.

mlodr -- specified by user, fullword integer

Maximum length, in bytes, of data record to be constructed by the graPHIGS API (>=12)

The application provided area for construction of the data record must be large enough to accommodate the data provided. This consists of three fullwords (12 bytes) of header information and one byte length field per string. Therefore, the length of the data record in bytes can be computed using the following formula:

mlodr >
= 12 + (4*numi)
+ (4*numr) + nums +
(lens(1) + (lens(2) + ... +lens(nums))

errind -- returned by the graPHIGS API, fullword integer

Error indicator. If zero, the request has been completed. Otherwise, one of the following errors has been encountered:
108
NUMBER OF CHARACTERS IN TEXT STRING < ZERO
505
LENGTH OF RETURN ARRAY < ZERO
506
NUMBER OF INITIAL VALUES < ZERO
509
DATA LENGTH VALUE < ZERO OR REQUIRED LENGTH
557
WIDTH PARAMETER < MINIMUM ALLOWED

lodr -- returned by the graPHIGS API, fullword integer

Actual length, in bytes, of data record constructed by the graPHIGS API

datarec -- returned by the graPHIGS API, variable length character string

Data record as specified by the input parameters. The returned data record is in the proper format for passing to input device initialization routines.

Error Codes

None

Related Subroutines

GPINCH
Initialize Choice
GPINLC
Initialize Locator
GPINPK
Initialize Pick
GPINSK
Initialize Stroke
GPINST
Initialize String
GPINVL
Initialize Valuator

RCP code

201330958 (X'0C00110E')


[ Previous | Next | Contents | Glossary | Home | Search ]