int QccDatasetReadWholefile(QccDataset *dataset);
int QccDatasetReadHeader(QccDataset
*dataset);
int QccDatasetStartRead(QccDataset *dataset);
int QccDatasetEndRead(QccDataset
*dataset);
int QccDatasetReadBlock(QccDataset *dataset);
int QccDatasetReadSlidingBlock(QccDataset
*dataset);
QccDatasetReadWholefile() reads the DAT-format file whose filename is given by dataset->filename. The entire file is read, including the header, and the vectors are returned in the vector array dataset->vectors. If dataset->vectors is NULL, dataset->vectors is allocated via a call to QccDatasetAlloc() prior to reading; otherwise, it is assumed that sufficient space has already been allocated.
QccDatasetReadHeader() reads the header information of the DAT-format file pointed to by dataset->fileptr, which must be already open and positioned at the start of the file. Information read from the header is returned in the fields of dataset.
QccDatasetStartRead() must be called before any block-based read of dataset. QccDatasetStartRead() opens the file with QccFileOpen(3) , reads the file's header with QccDatasetReadHeader(3) , and allocates storage space, if needed, for the vector array by calling QccDatasetAlloc(3) (note that allocation is performed only if dataset->vectors is NULL). Prior to calling QccDatasetStartRead(), dataset->filename must contain the name of the file and dataset->access_block_size must give the block size desired for subsequent block-based reads. The remaining fields of dataset are filled in from the file's header. After QccDatasetStartRead() returns, dataset->fileptr contains the FILE pointer to the open file, and the file is positioned at the start of the vector-array data, ready for reading the first block of vectors.
QccDatasetEndRead() closes a dataset file opened by a previous call to QccDatasetStartRead(); additionally, the vector array, dataset->vectors, is freed with a call to QccDatasetFree(3) .
QccDatasetReadBlock() reads the next block of vectors in the dataset. dataset must be prepared by a prior call to QccDatasetStartRead(); that is, dataset->fileptr must point to an open file, dataset->access_block_size must contain the size of the block of vectors to read, and dataset->vectors must be allocated with space sufficient for storing the block of vectors. QccDatasetReadBlock() reads non-overlapping blocks of data from the file; after QccDatasetReadBlock() returns, the file is positioned at the start of the subsequent block.
QccDatasetReadSlidingBlock() reads the next block of vectors in the dataset; however, contrary to QccDatasetReadBlock(), which reads non-overlapping blocks, the block of vectors returned by a call to QccDatasetReadSlidingBlock() overlaps the block returned by the preceding call. That is, the start of the block returned by QccDatasetReadSlidingBlock() is one vector after the block returned by the preceding call. Consequently, the block of data vectors returned by QccDatasetReadSlidingBlock() "slides" along the dataset with subsequent calls. When the requested block size starts to reach beyond the end of the file, the size of the block returned starts to shrink, and dataset->access_block_size is decremented.