addsourcef.3

来自「speech signal process tools」· 3 代码 · 共 78 行

3
78
字号
.\" Copyright 1987, 1990 Entropic Speech Inc., all rights reserved.\" @(#)addsourcef.3	1.5 29 Apr 1997 ESI.TH ADD_SOURCE_FILE 3\-ESPSu 29 Apr 1997.ds ]W "\fI\s+4\ze\h'0.05'e\s-4\v'-0.4m'\fP\(*p\v'0.4m'\ Entropic Speech, Inc..SH NAMEadd_source_file \- add a source file name and header to header.SH SYNOPSIS.ft Bvoid add_source_file(hd, name, srchd).brstruct header *hd, *srchd;.brchar *name;.ft.SH DESCRIPTION.I add_source_fileinserts a source file name (\fIname\fR) and header (\fIsrchd\fR) into the next available .I variable.source and .I variable.srchead positions in the header pointed to by \fIhd\fR.The fields \fIvariable.nnames\fR and \fIvariable.nheads\fR are incremented.  Only pointers are copied, so the source fields must not bealtered before \fIwrite_header\fR is called.   Note that either \fIname\fP or \fIsrchd\fPmay be NULL. If \fIname\fP is NULL,the name "NONE" is added to \fIvariable.source\fP, and\fIsrchd\fP is added to \fIvariable.srchead\fP.If \fIsrchd\fP is NULL,\fIvariable.source\fP is updated with \fIname\fP, but\fIvariable.srchead\fP is left unchanged..PPIf the destination header does not have a foreign header (i.e.\fIforeign_hd_length\fR generic is not defined or it is zero) and thesource header does have \fIforeign_hd_length\fR defined and greater thanzero and \fIforeign_hd_ptr\fR defined and non-NULL these generics arecopied from the source header to the destination header.   This has theside effect of causing the foreign header of a source file to become aforeign header of the destination header.   Since there can be only oneforeign header in a file, only the first foreign header encountered by\fIadd_source_file\fR will be copied..SH EXAMPLE.if n .ta 33.if t .ta 3iin_fd = fopen(in_name, "r");	/* get input file */.brout_fd = fopen(out_name, "w");	/* get output file */.brin_hd = read_header(in_fd);	/* read input header */.brout_hd = new_header(FT_ANA);	/* make new header .br				   for output file */.bradd_source_file(out_hd, in_name, in_hd);.brwrite_header(out_hd, out_fd);	/* write the new header */.SH DIAGNOSTICSThere can be MAX_SOURCES included headers and source names.  If this is exceeded, thenan error message is printed and the calling program is terminated.Therefore, application programs should be careful to compare .I variable.nheadswith MAX_SOURCES before trying to add a header and.I variable.nnameswith MAX_SOURCES before trying to add a source name..SH SEE ALSO.nfESPS(5\-ESPS), \fIwrite_header\fR(3\-ESPSu), \fInew_header\fR(3\-ESPSu), \fIread_header\fR(3\-ESPSu), \fIeopen\fR(3\-ESPSu), \fIadd_comment\fR(3\-ESPSu), \fIcopy_header\fR(3\-ESPSu).fi.SH AUTHOROriginal version by Joe Buck..brModified by Alan Parker for new header structures.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?