RNAlib-2.4.5
Functions that provide dynamically buffered stream-like data structures

Detailed Description

+ Collaboration diagram for Functions that provide dynamically buffered stream-like data structures:

Files

file  char_stream.h
 Implementation of a dynamic, buffered character stream.
 
file  stream_output.h
 An implementation of a buffered, ordered stream output data structure.
 

Typedefs

typedef struct vrna_ordered_stream_s * vrna_ostream_t
 An ordered output stream structure with unordered insert capabilities.
 
typedef void() vrna_callback_stream_output(void *auxdata, unsigned int i, void *data)
 Ordered stream processing callback. More...
 

Functions

vrna_ostream_t vrna_ostream_init (vrna_callback_stream_output *output, void *auxdata)
 Get an initialized ordered output stream. More...
 
void vrna_ostream_free (vrna_ostream_t dat)
 Free an initialized ordered output stream. More...
 
void vrna_ostream_request (vrna_ostream_t dat, unsigned int num)
 Request index in ordered output stream. More...
 
void vrna_ostream_provide (vrna_ostream_t dat, unsigned int i, void *data)
 Provide output stream data for a particular index. More...
 

Typedef Documentation

◆ vrna_callback_stream_output

typedef void() vrna_callback_stream_output(void *auxdata, unsigned int i, void *data)

#include <ViennaRNA/stream_output.h>

Ordered stream processing callback.

This callback will be processed in sequential order as soon as sequential data in the output stream becomes available.

Note
The callback must also release the memory occupied by the data passed since the stream will lose any reference to it after the callback has been executed.
Parameters
auxdataA shared pointer for all calls, as provided by the second argument to vrna_ostream_init()
iThe index number of the data passed to data
dataA block of data ready for processing

Function Documentation

◆ vrna_ostream_init()

vrna_ostream_t vrna_ostream_init ( vrna_callback_stream_output output,
void *  auxdata 
)

#include <ViennaRNA/stream_output.h>

Get an initialized ordered output stream.

See also
vrna_ostream_free(), vrna_ostream_request(), vrna_ostream_provide()
Parameters
outputA callback function that processes and releases data in the stream
auxdataA pointer to auxiliary data passed as first argument to the output callback
Returns
An initialized ordered output stream

◆ vrna_ostream_free()

void vrna_ostream_free ( vrna_ostream_t  dat)

#include <ViennaRNA/stream_output.h>

Free an initialized ordered output stream.

See also
vrna_ostream_init()
Parameters
datThe output stream for which occupied memory should be free'd

◆ vrna_ostream_request()

void vrna_ostream_request ( vrna_ostream_t  dat,
unsigned int  num 
)

#include <ViennaRNA/stream_output.h>

Request index in ordered output stream.

This function must be called prior to vrna_ostream_provide() to indicate that data associted with a certain index number is expected to be inserted into the stream in the future.

See also
vrna_ostream_init(), vrna_ostream_provide(), vrna_ostream_free()

dat The output stream for which the index is requested

Parameters
numThe index to request data for

◆ vrna_ostream_provide()

void vrna_ostream_provide ( vrna_ostream_t  dat,
unsigned int  i,
void *  data 
)

#include <ViennaRNA/stream_output.h>

Provide output stream data for a particular index.

Precondition
The index data is provided for must have been requested using vrna_ostream_request() beforehand.
See also
vrna_ostream_request()
Parameters
datThe output stream for which data is provided
iThe index of the provided data
dataThe data provided