DDS Developers Documentation → Fortran API → index


Index
fdds_addaxis
fdds_align
fdds_axis_prod
fdds_binfd
fdds_calloc
fdds_calloc8
fdds_check
fdds_close
fdds_closepr
fdds_closepr2
fdds_copy
fdds_count
fdds_datadefn
fdds_dict
fdds_errors
fdds_fflush
fdds_free
fdds_genus
fdds_get
fdds_history
fdds_in
fdds_index
fdds_info
fdds_initmpi
fdds_initmpix
fdds_initopenmp
fdds_isreg
fdds_key
fdds_lseek
fdds_lseek8
fdds_malloc
fdds_malloc8
fdds_map
fdds_member
fdds_memuse
fdds_mod
fdds_name
fdds_newer
fdds_next
fdds_object
fdds_offset
fdds_open
fdds_openm
fdds_openpr
fdds_out
fdds_parent
fdds_prec
fdds_prev
fdds_prime
fdds_printf
fdds_printt
fdds_printv
fdds_prtcon
fdds_prterr
fdds_prthdr
fdds_prtmsg
fdds_ptr
fdds_put
fdds_read
fdds_readm
fdds_realloc
fdds_realloc8
fdds_rmaxis
fdds_savepr
fdds_scale
fdds_scanf
fdds_scank
fdds_scant
fdds_scantn
fdds_scanv
fdds_sprintf
fdds_sscanf
fdds_switch
fdds_write
fdds_writem

fdds_index - field index within DDS type


SYNOPSIS

#include <fdds.h> (fixed-format sources)
#include <f90dds.h> (free-format sources)

integer function fdds_index(bin_tag, field_tag, prime)

integer bin_tag
integer field_tag
integer prime

DESCRIPTION

This function returns the index of a field within a DDS type. The index is an array subscript relative to a DDS prime type. This allows the field value to be accessed within a type buffer.

INPUT

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

field_tag is a tag that identifies a field within bin_tag obtained from fdds_member.

Prime is a tag that identifies a DDS prime type. It must be compatible with the field's prime type. (For a simple byte offst, use fdds_offset.) The field offset must be compatible with the type's precision a fractional index would be useless. An error is issued, if these assumptions are violated.

Symbolic names for DDS prime types are provided in fdds.h. They correspond to Fortran types on the host computer. This allows the prime argument to be host independent. Possible values include:

Host Dependent values
prime                   Host Type
-----                   ---------
DDS_CHARACTER           character
DDS_INTEGER             integer
DDS_INTEGER2            integer2
DDS_LOGICAL             logical
DDS_LOGICAL1            logical1
DDS_REAL                real
DDS_DOUBLE              double
DDS_COMPLEX             complex
DDS_DBL_CPX             double complex
        

OUTPUT

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

EXAMPLE

      integer bin, field
      integer i_RecNum, RecNum
      integer*2 buf_i2(*)
      ...
      ! index to RecNum field (integer*2)
      field = fdds_member(bin, 0, 'RecNum')
      i_RecNum = 1 + fdds_index(bin, field, DDS_INTEGER2)
      ...
      RecNum = buf_i2(i_RecNum)
    

SEE ALSO

fdds_offset
    

AUTHOR

R. L. Selzler, EPTG (May, 1994)
For additional help, open an issue here