|
|
UDI_BUF_ALLOC(3udi)
Allocate and initialize a new buffer
#include <udi.h>#define \ UDI_BUF_ALLOC( \ callback, gcb, init_data, size, path_handle) \ udi_buf_write(callback, gcb, init_data, \ size, NULL, 0, \ 0, path_handle)ARGUMENTS callback, gcb are standard arguments described in the "Asynchronous Service Calls" section of "Calling Sequence and Naming Conventions".
init_data is a pointer to the initial data to use to fill the buffer. If set to NULL, the initial data values are unspecified.
size is the initial size of the buffer data, in bytes.
path_handle is the handle identifying the intended use and dispatching of this buffer. Path handle usage is determined by the driver, but by associating the use of a specific path_handle with buffers allocated for a specific purpose, the driver allows the environment to predict and optimize the allocated buffer requirements.
DESCRIPTION UDI_BUF_ALLOC allocates a new logical buffer with a valid data length of size. The initial data will be copied from init_data if non-NULL. If init_data is NULL, the buffer will still have size bytes of valid data, but the initial value of these bytes is unspecified.
The macro UDI_BUF_ALLOC must be called as if it had the following functional interface, as can be derived from the above macro definition and the definition of udi_buf_write:
void UDI_BUF_ALLOC ( udi_buf_write_call_t *callback, udi_cb_t *gcb, void *init_data, udi_size_t size, udi_buf_path_t path_handle ); typedef void udi_buf_write_call_t ( udi_cb_t *gcb, udi_buf_t *new_buf );