Airframe Application Utilities
libairframe 0.7.2 API documentation

Main Page | Data Structures | File List | Data Fields | Globals

mio_sink_multi.h File Reference

MIO multisink initializer and utilities. More...

#include <airframe/mio.h>

Go to the source code of this file.


Defines

#define mio_smc(_s_)   (GPOINTER_TO_UINT((_s_)->cfg))
 Convenience macro to retrieve the subordinate sink count for a given multisink.
#define mio_smn(_s_, _n_)   (((MIOSink *)(_s_)->vsp)[(_n_)])
 Convenience macro to access a given subordinate sink by index for a given multisink.

Functions

gboolean mio_sink_init_multi (MIOSink *sink, const char *spec, MIOType vsp_type, void *cfg, GError **err)
 Initialize a multisink for writing to multiple subordinate sinks.

Detailed Description

MIO multisink initializer and utilities.


Define Documentation

#define mio_smn _s_,
_n_   )     (((MIOSink *)(_s_)->vsp)[(_n_)])
 

Convenience macro to access a given subordinate sink by index for a given multisink.

Evaluates to a structure; use the address operator to get a pointer to the subordinate sink.


Function Documentation

gboolean mio_sink_init_multi MIOSink sink,
const char *  spec,
MIOType  vsp_type,
void *  cfg,
GError **  err
 

Initialize a multisink for writing to multiple subordinate sinks.

A multisink simply distributes its operations (next, close, free) among its subordinates. This function creates a multisink with all of its subordinate sinks zeroed - after initializing, each subordinate sink must in turn be initialized by a specific sink initializer.

Parameters:
sink pointer to MIOSink to initialize. This MIOSink will be overwritten.
spec input specifier to initialize MIOSource with. Ignored; may be NULL.
vsp_type requested sink pointer type, or MIO_T_ANY for default. Must be ANY or MULTISINK.
cfg Number of subordinate sinks to allocate cast to a void pointer using GUINT_TO_POINTER.
err An error description pointer.
Returns:
TRUE if the MIOSink was successfully initialized.