int QccDatasetWriteWholefile(QccDataset
*dataset);
int QccDatasetWriteHeader(QccDataset *dataset);
int QccDatasetStartWrite(QccDataset
*dataset);
int QccDatasetEndWrite(QccDataset *dataset);
int QccDatasetWriteBlock(QccDataset
*dataset);
QccDatasetWriteWholefile() writes the DAT-format file whose filename is given by dataset->filename. The whole file, including the header and all vectors of the dataset, is written at once. dataset->vectors is assumed to be allocated and to contain all dataset -> num_vectors vectors of the dataset.
QccDatasetWriteHeader() writes header information to the DAT-format file pointed to by dataset->fileptr, which must be already open for writing and positioned at the start of the file. The magic number and version information is supplied automatically by QccFileWriteMagicNumber(3) .
QccDatasetStartWrite() must be called before any block-based write to dataset. QccDatasetStartWrite() opens the file with QccFileOpen(3) and writes the file's header with QccDatasetWriteHeader(3) . If the vector array is not already allocated (i.e., if dataset->vectors is NULL) the vector array is allocated by calling QccDatasetAlloc(3) . Prior to calling QccDatasetStartWrite(), dataset->filename must contain the name of the file, dataset->vector_dimension must give the dimension of the vectors, dataset->num_vectors must give the total number of vectors of the dataset, and dataset->access_block_size must give the block size desired for subsequent block-based writes. After QccDatasetStartWrite() returns, dataset->fileptr contains the FILE pointer to the open file, and the file is positioned immediately after the header, ready for writing the first block of vectors.
QccDatasetEndWrite() closes a dataset file opened by a previous call to QccDatasetStartWrite(); additionally, the vector array, dataset->vectors, is freed with a call to QccDatasetFree(3) .
QccDatasetWriteBlock() writes the next block of vectors in the dataset. dataset must be prepared by a prior call to QccDatasetStartWrite(); that is, dataset->fileptr must point to an open file and dataset->access_block_size must contain the size of the block of vectors to write. Additionally, dataset->vectors must contain the block of vectors to be written. QccDatasetWriteBlock() writes non-overlapping blocks of data to the file; after QccDatasetWriteBlock() returns, the file is positioned to write the subsequent block.