Programmer Guide > Creating an OPI Option > wave_type_sizeof
  

wave_type_sizeof
Returns the size in bytes associated with a PV‑WAVE variable type.
C Usage
long wave_type_sizeof(opi_type)
FORTRAN Usage
INTEGER*4 LF_WAVE_TYPE_SIZEOF(l_opi_type)
INTEGER*4 l_opi_type
64-bit UNIX FORTRAN Usage
INTEGER*8 LF_WAVE_TYPE_SIZEOF(l_opi_type)
INTEGER*8 l_opi_type
Input Parameters
opi_type—A valid variable type code, excluding OPI_TYP_STRUCT. This function does not recognize OPI_TYP_STRUCT since the structure definition name is needed to know its size (see "wsdh_sizeofdata").
The valid variable type codes (in C) and their corresponding PV‑WAVE types are:
OPI_TYP_UNDEFINEDUndefined.
OPI_TYP_BYTE—Byte.
OPI_TYP_SHORT—16-bit integer (FIX).
OPI_TYP_INT32—32-bit integer (FIX).
OPI_TYP_LONG—Long integer.
OPI_TYP_FLOAT—Floating point.
OPI_TYP_DOUBLE—Double precision.
OPI_TYP_COMPLEX—Complex.
OPI_TYP_DCOMPLEX—Double-precision complex.
OPI_TYP_STRING—String.
In FORTRAN, the valid type codes are:
L_OPI_TYP_UNDEFINED
L_OPI_TYP_BYTE
L_OPI_TYP_SHORT
L_OPI_TYP_INT32
L_OPI_TYP_LONG
L_OPI_TYP_FLOAT
L_OPI_TYP_DOUBLE
L_OPI_TYP_COMPLEX
L_OPI_TYP_DCOMPLEX
L_OPI_TYP_STRING
All these type codes are listed as #define’s in opi_devel.h or (PARAMETERS in opi_f_devel.h).
Returned Values
Returns the size in bytes needed to store a scalar PV‑WAVE variable of the type given.
Returns –1 if opi_type is not one of the basic numeric or string types.
This function does not recognize OPI_TYP_STRUCT since the structure definition name is needed to know its size (see wsdh_sizeofdata).

Version 2017.1
Copyright © 2019, Rogue Wave Software, Inc. All Rights Reserved.