Daylight v4.9
Release Date: 1 February 2008


dt_thor_tdtmerge - merge one TDT with another

Generic Prototype

dt_thor_tdtmerge(dt_Handle, dt_Handle) => dt_Handle

C Prototype

#include "dt_thor.h"

dt_Handle dt_thor_tdtmerge(dt_Handle tdt1, dt_Handle tdt2)

FORTRAN Prototype

include ''

integer*4 dt_f_thor_tdtmerge(tdt1, tdt2)

integer*4 tdt1
integer*4 tdt2


Merges the data from the TDT object 'tdt2' into the TDT object 'tdt1'. Then, deallocates 'tdt2' and revokes its handle. When the merge is complete, 'tdt1' contains the set of all unique dataitems from both 'tdt1' and 'tdt2'. The timestamp of the resulting TDT is the newer of the timestamps of 'tdt1' and 'tdt2'.

Two dataitems are considered identical when both have the same datatype and when the string values of all corresponding datafields in the two dataitems are identical (see dt_stringvalue(3) relating to THOR datafields).

If the root identifiers of the two TDTs are identical, all data and subtrees from 'tdt2'are merged into 'tdt1'.

If the root identifiers of the two TDTs are not identical, then 'tdt1' must be a SMILES-rooted tree and 'tdt2' must be a non-SMILES-rooted tree. In this case, 'tdt2' is demoted to a subtree of 'tdt1' and merged at this level.

Return Value

Returns the handle of 'tdt1' or the NULL_OB if an error is detected. If NULL_OB is returned, neither 'tdt1' or 'tdt2' are altered in any way. In particular, 'tdt2' is still a valid object if the merge fails.

Related Topics

dt_thor_str2tdt(3) dt_thor_tdt2str(3) dt_thor_tdtget(3) dt_thor_tdtput(3) dt_thor_tdtputforced(3) dt_thor_tdtputraw(3) dt_thor_tdtremove(3) dt_thor_tdtrevise(3) dt_thor_xrefget(3)