screen_attach_window_buffers()

Associate an externally allocated buffer with a window.

Synopsis:

#include <screen/screen.h>
 
int screen_attach_window_buffers(screen_window_t win,
                                 int count,
                                 screen_buffer_t *buf)

Arguments:

win

The handle of a window that doesn't already share a buffer with another window, and that doesn't have one or more buffers created or associated to it.

count

The number of buffers to be attached.

buf

An array of count buffers to be attached that was allocated by the application.

Library:

libscreen

Description:

Function Type: Flushing Execution

This function can be used by drivers and other middleware components that must allocate their own buffers. The client must ensure that all usage constraints are met when allocating the buffers. Failure to do so may prevent the buffers from being successfully attached, or may result in artifacts and system instability. Calling both screen_attach_window_buffers() and screen_create_window_buffers() is not permitted.

Returns:

0 if the buffers were successfully attached to the specified window, or -1 if an error occurred (errno is set; refer to /usr/include/errno.h for more details). Note that the error may also have been caused by any delayed execution function that's just been flushed.