inq_content(3G)
NAME
inq_content_sizes, inq_content − return information about the parameters of the current element of the currently open segment
SYNOPSIS
C Syntax:
void inq_content_sizes(fildes, params, num_ints,
num_floats, num_chars)
int fildes, *params, *num_ints, *num_floats, *num_chars;
void inq_content(fildes, param_types, counts,
int_array, float_array, char_array)
int fildes, param_types[], counts[], int_array[];
float float_array[];
char char_array[];
FORTRAN77 Syntax:
subroutine inq_content_sizes(fildes, params, num_ints,
num_floats, num_chars)
integer*4 fildes, params, num_ints, num_floats, num_chars
subroutine inq_content(fildes, param_types, counts,
int_array, float_array, char_array)
integer*4 fildes, param_types(*), counts(*), int_array(*)
real*4 float_array(*)
character*(*) char_array
Pascal Syntax:
procedure inq_content_sizes(fildes: integer;
var params, num_ints, num_floats, num_chars:integer);
procedure inq_content(fildes: integer;
var param_types: array [lo1..hi1:integer] of integer;
var counts: array [lo2..hi2:integer] of integer;
var int_array: array [lo3..hi3:integer] of integer;
var float_array: array [lo4..hi4:integer] of real;
var char_array: packed array [lo5..hi5:integer] of char);
DESCRIPTION
Input Parameters
fildes Integer file descriptor returned by gopen when an I/O path to a graphics device is opened.
Output Parameters
params The number of parameters of the element.
num_ints The total number of integer parameters in the element, including array elements.
num_floats The total number of real parameters in the element, including array elements.
num_chars The total number of characters in strings and character arrays in the element.
param_types The type of each parameter in the element.
counts The size of each array parameter in the element, or 1 if the corresponding parameter is not an array.
int_array All the integers that make up integer and integer array parameters of the element.
float_array All the float_array that make up real and real array parameters of the element.
char_array All the characters that make up strings and character array parameters of the element.
Discussion
Inq_content_sizes and inq_content return information about the parameters of the current element of the currently open segment of the specified graphics device.
Inq_content_sizes returns the sizes of various arrays needed to store all the parameter information about the current element. Params receives the total number of parameters, excluding the file descriptor, to the element. The param_types and counts parameters passed to inq_content must be able to hold at least this many integers. Num_ints, num_floats, and num_chars receive the total number of integers, reals, and characters needed to represent the parameters of the element, respectively. The int_array, float_array, and char_array parameters of inq_content must be able to hold at least num_ints, num_floats, and num_chars elements, respectively.
Inq_content returns the actual information about the parameters used in the original function call that created the current element. Param_types will contain an entry for each of the params parameters, indicating each parameter’s type by means of one of the following constants:
TYPE_INT if the parameter is a single integer
TYPE_INT_ARRAY if the parameter is an array of integers
TYPE_FLOAT if the parameter is a single real
TYPE_FLOAT_ARRAY if the parameter is an array of reals
TYPE_STRING if the parameter is a null-terminated string
TYPE_CHAR_ARRAY if the parameter is an arbitrary array of bytes
Counts will also have an entry for each of the params parameters. If the parameter is of type TYPE_INT or TYPE_FLOAT, the corresponding entry in the counts array will contain 1. If the parameter is of type TYPE_INT_ARRAY or TYPE_FLOAT_ARRAY, the corresponding entry will contain the number of integers or reals in the int_array or float_array array, respectively, that belongs to that array. If the parameter is of type TYPE_STRING or TYPE_CHAR_ARRAY, the corresponding entry will contain the number of characters in the char_array array that belongs to that string or character array.
Ints will contain, in sequence, every integer parameter or element of an integer array parameter that exists in the element. Similarly, float_array will contain every real parameter or element of a real array that exists in the element, and char_array will contain every character that is part of a string or character array parameter in the element. To determine where a given parameter begins or ends in these arrays, refer to the counts parameter.
Examples
Assuming the current element of the currently open segment of the specified graphics device is an element that represents the call:
move2d(fd, 0.5, 0.75)
inq_content_sizes would return the following:
params would receive 2 (one for the 0.5, and one for the 0.75)
num_ints would receive 0 (no integer parameters, since the file descriptor is never counted)
num_floats would receive 2 (one for the 0.5, and one for the 0.75)
num_chars would receive 0 (no character array or string parameters)
and inq_content would return the following:
param_types would contain {TYPE_FLOAT, TYPE_FLOAT}
counts would contain {1, 1} (since both parameters are non-arrays)
int_array would not be changed
float_array would contain {0.5, 0.75}
char_array would not be changed.
If the current element represents the call
polygon3d(fd, clist, 5, 0)
(i.e. a 5-point 3-D polygon, without move/draw flags, with the default vertex format), then inq_content_sizes would return the following:
params would receive 3 (for clist, 5, and 0)
num_ints would receive 2 (for 5 and 0)
num_floats would receive 15 (5 points by 3 coordinates per point)
num_chars would receive 0 (no character arrays or strings)
and inq_content would return the following:
param_types would receive {TYPE_FLOAT_ARRAY, TYPE_INT, TYPE_INT}
counts would receive {15, 1, 1}
int_array would receive {5, 0}
float_array would receive the clist array
char_array would not be changed.
ERRORS
1 Graphics device not initialized for this operation.
24 Segment not open.
36 Element pointer at element 0.
SEE ALSO
print_element(3G), inq_ele(3G), inq_ele_type(3G).
Hewlett-Packard Company — HP-UX Release 9.10: April 1995