RNAlib-2.4.14
|
|
Functions that provide dynamically buffered stream-like data structures. More...
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_cstr_t | vrna_cstr (size_t size, FILE *output) |
Create a dynamic char * stream data structure. More... | |
void | vrna_cstr_free (vrna_cstr_t buf) |
Free the memory occupied by a dynamic char * stream data structure. More... | |
void | vrna_cstr_close (vrna_cstr_t buf) |
Free the memory occupied by a dynamic char * stream and close the output stream. More... | |
void | vrna_cstr_fflush (struct vrna_cstr_s *buf) |
Flush the dynamic char * output stream. More... | |
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 void( vrna_callback_stream_output) (void *auxdata, unsigned int i, void *data) |
#include <ViennaRNA/datastructures/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.
auxdata | A shared pointer for all calls, as provided by the second argument to vrna_ostream_init() |
i | The index number of the data passed to data |
data | A block of data ready for processing |
vrna_cstr_t vrna_cstr | ( | size_t | size, |
FILE * | output | ||
) |
#include <ViennaRNA/datastructures/char_stream.h>
Create a dynamic char * stream data structure.
size | The initial size of the buffer in characters |
output | An optional output file stream handle that is used to write the collected data to (defaults to stdout if NULL) |
void vrna_cstr_free | ( | vrna_cstr_t | buf | ) |
#include <ViennaRNA/datastructures/char_stream.h>
Free the memory occupied by a dynamic char * stream data structure.
This function first flushes any remaining character data within the stream and then free's the memory occupied by the data structure.
buf | The dynamic char * stream data structure to free |
void vrna_cstr_close | ( | vrna_cstr_t | buf | ) |
#include <ViennaRNA/datastructures/char_stream.h>
Free the memory occupied by a dynamic char * stream and close the output stream.
This function first flushes any remaining character data within the stream then closes the attached output file stream (if any), and finally free's the memory occupied by the data structure.
buf | The dynamic char * stream data structure to free |
void vrna_cstr_fflush | ( | struct vrna_cstr_s * | buf | ) |
#include <ViennaRNA/datastructures/char_stream.h>
Flush the dynamic char * output stream.
This function flushes the collected char * stream, either by writing to the attached file handle, or simply by writing to stdout if no file handle has been attached upon construction using vrna_cstr().
buf | The dynamic char * stream data structure to flush |
vrna_ostream_t vrna_ostream_init | ( | vrna_callback_stream_output * | output, |
void * | auxdata | ||
) |
#include <ViennaRNA/datastructures/stream_output.h>
Get an initialized ordered output stream.
output | A callback function that processes and releases data in the stream |
auxdata | A pointer to auxiliary data passed as first argument to the output callback |
void vrna_ostream_free | ( | vrna_ostream_t | dat | ) |
#include <ViennaRNA/datastructures/stream_output.h>
Free an initialized ordered output stream.
dat | The output stream for which occupied memory should be free'd |
void vrna_ostream_request | ( | vrna_ostream_t | dat, |
unsigned int | num | ||
) |
#include <ViennaRNA/datastructures/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.
dat | The output stream for which the index is requested |
num | The index to request data for |
void vrna_ostream_provide | ( | vrna_ostream_t | dat, |
unsigned int | i, | ||
void * | data | ||
) |
#include <ViennaRNA/datastructures/stream_output.h>
Provide output stream data for a particular index.
dat | The output stream for which data is provided |
i | The index of the provided data |
data | The data provided |