IP_MsgResize

IP_MsgResize — resizes the IP_MsgBuffer, if possible.

Syntax

#include <cogent.h>
int IP_MsgResize(IP_Msg*  message,
 int  datalen);

Arguments

message

A pointer to a message.

datalen

The new length of the data portion of the IP_MsgBuffer, pointed to as message->msg.

Returns

0 on success, -1 on failure and errno is set:

    ENOSYS - the message is either not resizable or not dynamic.

    ENOMEM - the memory reallocation returned NULL.

The msg portion of message is set to NULL.

Description

This function assumes that the message encapsulates an IP_MsgBuffer, and resizes the data portion of that IP_MsgBuffer to datalen bytes through a call to ME_Realloc.

See Also

Messages, IP_MsgDefaultSize