PhUnpack()

Unpack transport data

Synopsis:

char * PhUnpack( PhTransportHdr_t *hdr, 
                 void **ret_struct );

Library:

ph

Description:

This function unpacks data packed using one of the PhTransport* or PtTransport* functions. Any memory required for the extraction is allocated via malloc().

The hdr parameter describes the data to be unpacked and is itself extracted from the packed data stream. See PhGetTransportHdr().

The pointer referenced by ret_struct is set to point to the newly unpacked data. The actual data representation of the data extracted is described in the hdr that's passed as the first parameter to this function.

As the data is unpacked, it's automatically endian-corrected.

Use PhFreeTransportType() to free data unpacked using this function.

Returns:

A pointer to the byte in the data stream following the data just extracted.

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

PhAllocPackType(), PhFindTransportType(), PhFreeTransportType(), PhMallocUnpack(), PhPackEntry(), PhRegisterTransportType(), PhTransportRegEntry_t, PhTransportType()

Drag and Drop chapter of the Photon Programmer's Guide