⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 skipheader.3

📁 speech signal process tools
💻 3
字号:
.\" Copyright (c) 1990 Entropic Research Laboratory, Inc. All rights reserved..\" @(#)skipheader.3	1.2	02 May 1997	ERL.TH SKIP_HEADER 3\-ESPSu 02 May 1997.ds ]W "\fI\s+4\ze\h'0.05'e\s-4\v'-0.4m'\fP\(*p\v'0.4m'\ Entropic Research Laboratory, Inc..if t .ds - \(em\h'-0.2m'\(em.if n .ds - ---.SH NAMEskip_header \- skip over an ESPS file header in an input stream without reading it into memory..SH SYNOPSIS.ft Bint.brskip_header(strm).brFILE *strm;.ft.SH DESCRIPTIONIf.I strmis open for reading and positioned at the beginning of an ESPS file,.I skip_headerattempts to skip over the header.Upon success, the file is positioned after the header,at the beginning of the data records.The function returns the value 1.RI ( YES )upon success;upon failure, it prints an error message to.I stdoutand returns 0.RI ( NO )..PPThe function fails when it detects certain forms of bad inputor errors of other kinds (see ``Diagnostics'' below).This version of.I skip_headerwill also fail on files that have been created by writing to a piperather than to a regular disk file (see ``Bugs'' below).Finally, it will fail on files created by versions of ESPSthat predate roughly August, 1987 (see ``Bugs'').More precisely,.I hdversin the header (see.IR ESPS (5-ESPS))must be 1.47 or higher;this is shown in.IR psps (1-ESPS)printouts as ``header version: 1.47'' or higher..SH EXAMPLEThe codeint     ch;if (skip_header(stdin) == NO){    Fprintf(stderr, "skip_header failed.\n");    exit(1);}while ((ch = getchar()) != EOF) putchar(ch);acts like a rudimentary version of.IR bhd (1-ESPS):it skips the header of a file on standard inputand copies the data records to standard output..SH DIAGNOSTICSThe following two messages indicate errors that cause the calling programto exit with an assertion failure..PP``file is NULL''\*-function argument.I strmis a NULL pointer..br``couldn't alloc preamble''\*-memory allocation failure..PPThe following messages indicate errors that cause the functionto return the value 0 to indicate failure..PP``couldn't read preamble''\*-read failure..br``no preamble''\*-input not an ESPS file at all, or created by a versionof the ESPS header library earlier than.I hdvers= "1.47"..br``no data offset in preamble''\*-probably an ESPS file written to a pipe;possibly just garbage input..br``premature end of file''\*-means just what it says..br``fseek error''\*-failure in the standard C I/O library function.IR fseek (3)..PPThe ``preamble'' mentioned in some of the messages is explained in thenext section, ``Bugs''..SH BUGSTo position the file to the end of the header,.I skip_headerrelies on an offset value in the.I preamble,which is a sort of mini-header that comes before the ESPS header proper.Consequently.I skip_headermay fail on a well formed input in two cases.The first is an ESPS file written to a pipe.When it first writes out the preamble,.IR write_header (3-ESPSu)has not yet determined the space the header will occupy in the fileand so cannot put the correct offset value in the preamble.Later, after writing the entire header,.I write_headergoes back, if possible, and fills in the right value.It is possible to go back in an ordinary disk file, but not in a pipe.An ESPS file written to a pipe, therefore,has an invalid offset value in its preamble, and.I skip_headerwill fail on such a file.The second case is an ESPS file that lacks a preamble.Preambles were introduced with the version of the ESPS header librarywith.I hdvers= "1.47" (see.IR ESPS (5-ESPS));.I skip_headerwill fail on files written by earlier versions of the header library.(An up-to-date version of.IR copysps (1-ESPS)will read an ESPS file without a preambleand write a copy of it with a preamble.).SH SEE ALSObhd(1\-ESPS), copysps(1\-ESPS) psps(1\-ESPS),.brcopy_header(3\-ESPSu), free_header(3\-ESPSu), .brnew_header(3\-ESPSu),read_header(3\-ESPSu), .brwrite_header(3\-ESPSu),ESPS(5\-ESPS).SH AUTHORRodney Johnson.

⌨️ 快捷键说明

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