Programmer Guide > Creating an OPI Option > wsdh_offset
  

wsdh_offset
Gets the byte offset of the data area for a named tag in a PV‑WAVE structure variable.
C Usage
long wsdh_offset(wsdh, tagname)
WSDH wsdh;
char *tagname;
FORTRAN Usage
INTEGER*4 LF_WSDH_OFFSET(l_wsdh, tagname)
INTEGER*4 l_wsdh
CHARACTER*31 tagname
64-bit UNIX FORTRAN Usage
INTEGER*8 LF_WSDH_OFFSET(l_wsdh, tagname)
INTEGER*8 l_wsdh
CHARACTER*31 tagname
Input Parameters
wsdh—A Wave structure definition handle.
tagname—The name of the desired tag in the structure.
Returned Value
Returns the offset in bytes of the tag’s data area.
Returns –1 on failure, if the handle argument is not a valid Wave structure definition handle, or if the tag doesn’t exist in the structure.
Discussion
If the given tagname exists in the structure definition, wsdh_offset returns an offset which can be used to find the data associated with this tagname. The unit of offset is number of bytes. Given that (char *)P holds a pointer to the data area of a PV‑WAVE variable of this structure type, (P+offset) points to the data corresponding to this tagname. Note that (P+offset) must be cast to the type of the associated tagname. The pointer to the data area of a PV‑WAVE variable can be retrieved from the wvh_dataptr function and the type of the associated tagname can be retrieved from the wsdh_element function.

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