IP_MsgCascade

Cogent API and Utilities: Version 4.1
Prev |  | Next

# `IP_MsgCascade`

`IP_MsgCascade` -- writes message data to an `IP_MsgBuffer`.

## Syntax

``int IP_MsgCascade`(IP_Msg* message, void* data, int len, int subtype, int status);`

## Arguments

`message`

  A pointer to a message.

`data`

  Data to copy into `message->msg->data`.

`len`

  The amount of data to copy.

`subtype`

  The message subtype to be set.

`status`

  The message status to be set.

## Returns

`0` on success, or `-1` if the message could not be resized, 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 points to an `IP_MsgBuffer`, and writes `data` into its data portion for `len` bytes. If `len` is greater than the currently allocated message length, the message is resized. If the `data` argument points to the same location as the message's data, then no copy is performed. The message's length, status and subtype are all updated regardless. The message type is set to `IP_MSG_COGENT`.

## See Also

Messages, `IP_MsgResize`

Prev | Home | Next
`IP_ListenToService` | Up | `IP_MsgCreate`

Copyright 1995-2002 by Cogent Real-Time Systems, Inc.