Airframe Application Utilities
libairframe 2.12.0 API documentation

Macros | Functions
mio_sink_multi.h File Reference

MIO multisink initializer and utilities. More...

#include <airframe/mio.h>

Go to the source code of this file.

Macros

#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. More...
 

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. More...
 

Detailed Description

MIO multisink initializer and utilities.

Macro Definition Documentation

◆ mio_smn

#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

◆ mio_sink_init_multi()

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
sinkpointer to MIOSink to initialize. This MIOSink will be overwritten.
specinput specifier to initialize MIOSource with. Ignored; may be NULL.
vsp_typerequested sink pointer type, or MIO_T_ANY for default. Must be ANY or MULTISINK.
cfgNumber of subordinate sinks to allocate cast to a void pointer using GUINT_TO_POINTER.
errAn error description pointer.
Returns
TRUE if the MIOSink was successfully initialized.