DDS Developers Documentation → "C" API → offset


Index
cdds_addaxis
cdds_align
cdds_axis_prod
cdds_binfd
cdds_calloc
cdds_check
cdds_close
cdds_closepr
cdds_closepr2
cdds_copy
cdds_count
cdds_datadefn
cdds_dict
cdds_errors
cdds_fflush
cdds_free
cdds_genus
cdds_get
cdds_history
cdds_in
cdds_index
cdds_info
cdds_initmpi
cdds_initmpix
cdds_initopenmp
cdds_isreg
cdds_key
cdds_lseek
cdds_lseek8
cdds_malloc
cdds_map
cdds_member
cdds_memuse
cdds_mod
cdds_name
cdds_newer
cdds_next
cdds_object
cdds_offset
cdds_open
cdds_openm
cdds_openpr
cdds_out
cdds_parent
cdds_prec
cdds_prev
cdds_prime
cdds_printf
cdds_printt
cdds_printv
cdds_prtcon
cdds_prterr
cdds_prthdr
cdds_prtmsg
cdds_put
cdds_read
cdds_readm
cdds_realloc
cdds_rmaxis
cdds_savepr
cdds_scale
cdds_scanf
cdds_scank
cdds_scant
cdds_scantn
cdds_scanv
cdds_switch
cdds_write
cdds_writem
setargcv

cdds_offset - field offset within DDS type

SYNOPSIS

#include "cdds.h"

int cdds_offset(bin_tag, field_tag);

BIN_TAG bin_tag
FIELD_TAG field_tag

DESCRIPTION

This function returns the byte offset of a field within a DDS binary.

INPUT

bin_tag is a binary tag, previously obtained from cdds_open. It specifies a particular binary stream.

field_tag is a tag that identifies a field within bin_tag.

OUTPUT

The return value is the byte offset of field_tag within bin_tag, or -1 if an error occurred.

EXAMPLE

          
            BIN_TAG bin;
            char *buf;
            short *RecNum;
            ...
            /* find RecNum field within buf (short int) */
            field = cdds_member(bin, 0, "RecNum");
            RecNum = (short*)(buf + cdds_offset(bin, field));
          

SEE ALSO

      cdds_index Field index with DDS type
    

AUTHOR

R. L. Selzler, EPTG (Oct 1995)
For additional help, open an issue here