Data structure that describes data to be transported


typedef struct ph_transport_reg_entry {
    char *type;
    int unsigned packing;
    int unsigned size;
    int unsigned num_fixups;
    PhTransportFixupRec_t const *fixups;
    int unsigned const *endians;
    } PhTransportRegEntry_t;


The PhTransportRegEntry_t structure describes how data is to be packed for the Photon transport mechanism, taking into account endian-ness and references to memory outside of the data type.

This structure includes the following:

The name of the type being registered.
The packing method to be used (Ph_PACK_RAW, Ph_PACK_STRING, or Ph_PACK_STRUCT).
The size, in bytes, of the data type.
The number of entries in the fixups arrays.
A list of instructions for dealing with references to data outside the type being defined. For more information, see Fixup manifests,” below.
A zero-terminated array of endian information for the members of the data type. All types or references to types correct the endian-ness of their members based on the endian array defined for the type. For more information, see Endian information,” below.

Fixup manifests

The fixup manifests are:

Member type Fixup Manifest
Scalar None
Scalar Array None
Reference (string) Tr_STRING( type, member )
Reference (scalar array) Tr_REF_ARRAY( type, member, number_of_elements )
Registered type Tr_TYPE( type, member, type_name )
Registered type array Tr_TYPE_ARRAY( type, member, type_name )
Reference (registered type) Tr_REF_TYPE( type, member, type_name )
Reference (registered type array) Tr_REF_TYPE_ARRAY( type, member, num_elements, type_name )
Reference( registered type reference array ) Tr_REF_TYPE_REF_ARRAY( type, member, num_elements, type_name )

Endian information

The classifications of endian-sensitive members are:

Members of type Example Classification
int, long, or short (signed or unsigned) unsigned int my_scalar Tr_ENDIAN( typedef_name, member )
Arrays of short or int entries short short_nums[10] Tr_ENDIAN_ARRAY( typedef_name, member )
References to endian scalars int *nums Tr_ENDIAN_REF( typedef_name, member, num )



See also:

PhFindTransportType(), PhFreeTransportType(), PhMallocUnpack(), PhPackEntry(), PhRegisterTransportType(), PhTransportType(), PhUnpack()

Registering new transport types in the Drag and Drop chapter of the Photon Programmer's Guide