Functions

kate_packet

Functions

int kate_packet_wrap (kate_packet *kp, size_t nbytes, const void *data)
int kate_packet_init (kate_packet *kp, size_t nbytes, const void *data)
int kate_packet_clear (kate_packet *kp)

Function Documentation

int kate_packet_clear ( kate_packet kp  ) 

Clears a kate_packet previously initialized by kate_packet_init

Parameters:
kp the kate_packet to clear
Returns:
0 success
KATE_E_* error

References kate_packet::data.

int kate_packet_init ( kate_packet kp,
size_t  nbytes,
const void *  data 
)

Returns a kate_packet created from the given data. The data is copied, so can be freed once the kate_packet is created. The kate_packet should be cleared when not needed anymore.

Parameters:
kp the kate_packet to create
nbytes the number of bytes in the data to wrap
data a pointer to the data to wrap
Returns:
0 success
KATE_E_* error

References kate_packet_wrap().

int kate_packet_wrap ( kate_packet kp,
size_t  nbytes,
const void *  data 
)

Returns a kate_packet wrapping the given data. The data is not copied, so should stay valid throughout the use of the kate_packet. The kate_packet should not be cleared.

Parameters:
kp the kate_packet to wrap
nbytes the number of bytes in the data to wrap
data a pointer to the data to wrap
Returns:
0 success
KATE_E_* error

References kate_packet::data, and kate_packet::nbytes.

Referenced by kate_packet_init().