NAME

Rivl_DirectSource - find the direct source of a signal if it exists

SYNOPSIS

#include <rivl.h>
Rivl_Signal
Rivl_DirectSource (interp, signal);

ARGUMENTS

Tcl_Interp *interp (in)
The Tcl interpreter.
Rivl_Signal outSignal (in)
Signal to find source of.

DESCRIPTION

Rivl_DirectSource determines if the contents of signal come directly from a single leaf node. It does this by working backwards in the graph til a leaf node is reached, making sure that the only intervening nodes, if any, are those that do not affect the content of the signal (such as Dup and Cache nodes). If a direct source is found, its outgoing signal is returned. Otherwise, NULL is returned.

This function is useful for detecting direct-transfer in write commands. For example, if a signal that we are writing to JPEG has a direct JPEG-read source with the right size and type, then we can copy the JPEG file directly. See Rivl_CreateFileFormat.