screen_ref_stream()

Create a reference to a stream

Synopsis:

#include <screen/screen.h>
int screen_ref_stream(screen_stream_t stream)

Arguments:

stream
The handle of the stream for which the reference is to be created.

Library:

libscreen

Description:

Function Type: Immediate Execution

This function creates a reference to a stream. This function can be used by libraries to prevent the stream or its buffers from disappearing while the library is using it. The stream and its buffers aren't destroyed until all references have been cleared with screen_unref_stream(). In the event that a stream is destroyed before the reference is cleared, screen_unref_stream() causes the stream buffer and/or the stream to be destroyed.

Returns:

0 if successful, or -1 if an error occurred (errno is set; refer to errno.h for more details).