int tsmAddDataSetToDatabase ( TsmDatabase *database, TsmDataSet *dataset )

Add a dataset to a database

Documentation

Add a dataset to a database.

This function will add the contents of a TsmDataSet structure to the specified TsmDatabase. The dataset can contain multiple instances and all of these will be added as necessary. Only data that is not already in the dataset will be added.

This routine will first check to see if an entry already exists for the dataset in the database (i.e. if an entry with the same name field exists in the database). If the dataset does not already exist, then a new entry will be created and all of the fields copied over (strings are strdup'd). If the dataset does exist in the database already, then checks are made that all of the fields are the same (e.g. type, min/max resolution, etc.).

Once a dataset entry has been found or created, the routine will see if it needs to add any instances to this dataset. An instance is deemed to be unique by its URL and formats are the same, and if its server list is the same if the URL is for a DPSS set. If no instance already exists in the database, then one will be added.

If a DPSS instance of the dataset in the database is the same as the instance to be added, except that the set ID differs, then the set id will updated in the database with the new set ID.

Returns:
TRUE if everything worked okay, FALSE if an error occurred.
Parameters:
database - the TsmDatabase to be updated
dataset - the TsmDataSet to add to the database
Author:
Martin Reddy
Version:
11 December 1997
See Also:
tsmReadDatabase, tsmWriteDatabase, TsmDatabase, TsmDataSet


TSMAPI_RELEASE 2.1 - Release Date: 2001/01/10 19:01:12

Back to tsmApi Home Page