Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals  

dt_stream_tree.c File Reference


Detailed Description

Implementation of utilities for converting an in-memory data tree to a stream.

Definition in file dt_stream_tree.c.

Go to the source code of this file.

Data Structures

struct  dt_writer_tree
 Storage for a dt_writer_tree object, subclass of dt_writer. More...


Functions

dt_bool dt_stream_subtree (dt_stream_step *step, dt_node const *src, dt_writer *dst)
 Function used internally by dt_stream_tree() to recursively send sub-nodes to the writer.

dt_bool dt_stream_tree (dt_node const *src, dt_writer *dst)
 Sends an existing in-memory data tree to a dt_writer object.

dt_writerdt_create_tree_writer (dt_node **root)
 Creates a writer object that will store the recived tree into *root.


Function Documentation

dt_writer* dt_create_tree_writer dt_node **  root  ) 
 

Creates a writer object that will store the recived tree into *root.

Precondition:
On entry, *root must be NULL (zero). The writer will set it to a newly created node as soon as it starts receiving the tree.
Note:
The user of the object has the responsibility of releasing the root node that will be stored in *root, at some point after the end of the transmission.

Definition at line 104 of file dt_stream_tree.c.

dt_bool dt_stream_subtree dt_stream_step step,
dt_node const *  src,
dt_writer dst
 

Function used internally by dt_stream_tree() to recursively send sub-nodes to the writer.

Parameters:
step Adress of an initialized dt_stream_step whose key fields have been pre-filled. The contents of this object may be overwritten upon return.
src The node at the root of the sub-tree to be streamed.
dst The stream writer to which the output will be sent.

Definition at line 14 of file dt_stream_tree.c.

dt_bool dt_stream_tree dt_node const *  src,
dt_writer dst
 

Sends an existing in-memory data tree to a dt_writer object.

The tree src is traversed recursively, and information about its nodes are sent to dst. An dt_end step is then sent to the writer. The function exits immediately if the writer reports an error.

Returns:
A non-zero value if the writer accepted the whole tree transmission without error.

Definition at line 75 of file dt_stream_tree.c.


Generated on Sun Jun 1 16:35:38 2003 for datatree by doxygen 1.3.1