fdds_put - put one field into a DDS type buffer
SYNOPSIS
#include <fdds.h> (fixed-format sources)
#include <f90dds.h> (free-format sources)
integer function fdds_putxx(bin, tag, out_buf, offset, in_array[, count])
-
integer bin
integer tag
array out_buf(*)
integer offset
HostType in_array(*)
integer count
DESCRIPTION
These functions put data into a type field of an output array from
an array variable. The data is converted from the host array type,
into the type defined for the field. The array type is implied by
the function name suffix ("xx"). Vectors are truncated or
padded, depending upon the source and destination count.
INPUT
The first four arguments describe an output field within a type buffer.
bin is a binary tag, previously obtained from
fdds_open.
tag identifies a specific field associated with bin
obtained from fdds_member. Note that there is
a distinct difference between tags generated from different bin
values. This means that you should not be using a tag from the
in_bin for anything related to the out_bin. If tag is
zero, the default target (trace) is used.
out_buf is the output type buffer into which the output field
is found.
offset is a byte offset into out_buf from where the
tag is referenced (typically 0).
in_array is the input array from which the data is obtained.
The type of in_array is implied by the function name suffix
("xx").
count is the number of elements to convert. This is
NOT to be used for fdds_putcb, but is required
by each of the other routines.
OUTPUT
The put functions copy (or convert) data from an input array
into the output field. Vectors are truncated or padded, depending upon
the source and destination count.
The function return value is count, or zero if an error occurred.
A simple byte copy is performed, if the binary formats are the same.
The put functions convert between most numeric representations.
The allowed combinations are implementation dependent.
The functions also convert between ascii and ebcdic character formats.
Byte fields can be copied, without conversion, from any array.
Conversion is not allowed between numeric and character types.
If conversion is not possible, an error is reported and
the output field is not changed.
Function Host Type in_array Pad
fdds_put byte zero
fdds_putcb character blank
fdds_puti integer zero
fdds_puti2 integer*2 zero
fdds_putr real zero
fdds_putff real zero (USP fake float)
fdds_putd real*8 zero
fdds_putc complex zero
C assignment rules are used to convert float arrays to integer
and unsigned fields. Character arrays passed by fdds_putcb
are assumed to be padded with blanks. Trailing pad characters are
ignored during put processing; they effectively shorten input
character arrays. A null character, within a fdds_putcb
character array, effectively reduces its count.
fdds_putff stuffs floats into consecutive 4-bytes (fake floats).
EXAMPLES
integer :: out_bin, tag, ier
integer out_buf(*)
integer in_array(*)
...
tag = fdds_member(out_bin, 0, 'TagName')
...
! Store 100 integers of 'TagName' header from in_array in out_buf at correct offsets
ier = fdds_puti(out_bin, tag, out_buf, 0, in_array, 100)
! Write a single trace to output
ier = fddx_write(out_bin, out_buf, 1)
SEE ALSO
fdds_get
AUTHOR
R. L. Selzler, EPTG (May, 1994)
Jerry Ehlers, BP America (May 2003)
|