📄 qccdatasetwrite.3
字号:
.TH QCCDATASETWRITE 3 "QCCPACK" "".SH NAMEQccDatasetWriteWholefile,QccDatasetWriteHeader,QccDatasetStartWrite,QccDatasetEndWrite,QccDatasetWriteBlock\- writing of QccDataset structures to DAT-format files.SH SYNOPSIS.B #include "libQccPack.h".sp.BI "int QccDatasetWriteWholefile(QccDataset *" dataset );.br.BI "int QccDatasetWriteHeader(QccDataset *" dataset );.br.BI "int QccDatasetStartWrite(QccDataset *" dataset );.br.BI "int QccDatasetEndWrite(QccDataset *" dataset );.br.BI "int QccDatasetWriteBlock(QccDataset *" dataset );.SH DESCRIPTIONThese routines implement the writing of.B QccDatasetdatasets to.BR DAT -formatfiles.There are two distinct modes in which the vector-array datain datasets may be written:the whole file may be written at once, orthe file may be written in non-overlapping blocks.For each of these routines,appropriate values must be supplied in.IR dataset -> num_vectors ,.IR dataset -> vector_dimension ,.IR dataset -> min_val ,and.IR dataset -> max_val prior to calling the routines..LP.B QccDatasetWriteWholefile()writes the.BR DAT -formatfile whose filename is given by.IR dataset -> filename .The whole file, including the header and all vectors of the dataset,is written at once..IR dataset -> vectorsis assumed to be allocated and to contain all.I dataset -> num_vectorsvectors of the dataset..LP.B QccDatasetWriteHeader()writes header information to the.BR DAT -formatfile pointed to by.IR dataset -> fileptr ,which must be already open for writingand positioned at the start of the file.The magic number and version information is suppliedautomatically by.BR QccFileWriteMagicNumber (3)..LP.B QccDatasetStartWrite()must be called before any block-based write to.IR dataset ..B QccDatasetStartWrite()opens the file with .BR QccFileOpen (3)and writes the file's header with.BR QccDatasetWriteHeader (3).If the vector array is not already allocated(i.e., if.IR dataset -> vectorsis.BR NULL )the vector array is allocated by calling.BR QccDatasetAlloc (3).Prior to calling.BR QccDatasetStartWrite() ,.IR dataset -> filenamemust contain the name of the file,.IR dataset -> vector_dimensionmust give the dimension of the vectors,.IR dataset -> num_vectorsmust give the total number of vectors of the dataset,and.IR dataset -> access_block_sizemust give the block size desired for subsequent block-based writes.After.B QccDatasetStartWrite()returns,.IR dataset -> fileptrcontains the.B FILEpointer to the open file, and the fileis positioned immediately after the header, ready for writing thefirst block of vectors..LP.B QccDatasetEndWrite()closes a dataset file opened by a previous call to.BR QccDatasetStartWrite() ;additionally, the vector array,.IR dataset -> vectors ,is freed with a call to .BR QccDatasetFree (3)..LP.B QccDatasetWriteBlock()writes the next block of vectors in the dataset..I datasetmust be prepared by a prior call to.BR QccDatasetStartWrite() ;that is, .IR dataset -> fileptrmust point to an open fileand.IR dataset -> access_block_sizemust contain the size of the block of vectors to write.Additionally,.IR dataset -> vectorsmust contain the block of vectors to be written..B QccDatasetWriteBlock()writes non-overlapping blocks of data to the file;after.B QccDatasetWriteBlock()returns, the file is positioned to write the subsequent block..SH "RETURN VALUE"These routines return 0 on successful completion, 1 if an error occurswhile writing the file..SH "SEE ALSO".BR QccDatasetRead (3),.BR QccFileWriteMagicNumber (3),.BR QccPack (3).SH AUTHORCopyright (C) 1997-2009 James E. Fowler.\" The programs herein are free software; you can redistribute them an.or.\" modify them under the terms of the GNU General Public License.\" as published by the Free Software Foundation; either version 2.\" of the License, or (at your option) any later version..\" .\" These programs are distributed in the hope that they will be useful,.\" but WITHOUT ANY WARRANTY; without even the implied warranty of.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the.\" GNU General Public License for more details..\" .\" You should have received a copy of the GNU General Public License.\" along with these programs; if not, write to the Free Software.\" Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -