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

📄 atoarray.3

📁 speech signal process tools
💻 3
字号:
.\" Copyright (c) 1986-1990 Entropic Speech, Inc..\" Copyright (c) 1991 Entropic Research Laboratory, Inc.; All rights reserved.\" @(#)atoarray.3	1.6 09 May 1997 ESI/ERL.ds ]W (c) 1991 Entropic Research Laboratory, Inc..TH ATOARRAY 3\-ESPSu 09 May 1997.SH NAME.nfatoarrayf \- convert ASCII file to data array of floatsatoarray \- convert ASCII file to data array of specified numeric typeatoarrays \- convert ASCII file to data array of strings.fi.SH SYNOPSIS.nf.ft B#include <esps/esps.h>float *atoarrayf(strm, nvalues, max)FILE *strm;long *nvalues;float *max;char *atoarray(strm, type, nvalues, max)FILE *strm;int type;long *nvalues;double *max;char **atoarrays(strm, nvalues, max)FILE    *strm;	long    *nvalues;int      *max;	.ft.fi.SH DESCRIPTION.I atoarrayfand.I atoarrayread the Ascii file stream.I strm,which is assumed to contain a series of numerical valuesseparated by white space or new lines;they convert the values to the required typeand return a pointer to the converted data..PPThe required data type is FLOAT for.I atoarrayf.For.I atoarrayit is indicated by the value of.I type,which must be one of the integer constantsDOUBLE, FLOAT, LONG, SHORT, BYTE,DOUBLE_CPLX, FLOAT_CPLX, LONG_CPLX, SHORT_CPLX, and BYTE_CPLXdefined in.I esps/esps.h.See the table in the.RI FEA (5-ESPS)man page; non-numeric types are not allowed.If the type is complex, the input values are taken in pairs;the first value in a pair gives the real part of a complex number,and the second value gives the imaginary part.An input value is written as an optionally signed string of decimal digits,which, for types DOUBLE, FLOAT, DOUBLE_CPLX, and FLOAT_CPLX,may contain a decimal point and may be followed by an.I Eor.I eand an optionally signed integer..PP\fIatoarrays\fP reads the Ascii file stream \fIstrm\fP and returns anarray of strings, one string per line in file stream.  Trailing linefeeds are dropped before each line is added to the string array.  .PPFor all three functions, the number of values read is returned throughthe parameter.I nvalues.(For complex types, that is the number of complex values,not the number of real values.).PPThe maximum absolute value or maximum string length (in the case of \fIatoarrays\fP) encountered is returned through.I maxif.I maxis non-NULL.A NULL value for.I maxis treated as an error by.I atoarrayf.A value of NULL for.I maxis a signal to.I atoarrayand.I atoarraysthat the maximum absolute value or maximum string length is not wanted..PPThe returned values from .I atoarrayfand .I atoarrayis a pointer to the first byte of the storage area for the results.The storage is allocated by.IR malloc (3c)and may be freed by.IR free (3c).Before being used, the pointer returned by.I atoarraymust be cast to a pointer type depending on.I type.RI ( "e.g."(double *) for DOUBLE, (byte_cplx *) for BYTE_CPLX).The value returned by.I atoarrayfdoes not require a cast..PP.I atoarrayf,.I atoarrayand.I atoarrayscan be used on standard input.  .SH EXAMPLE.nf    float   *sdata;	     float   maxvalf;    double  maxvald;    long    points;    FILE    *instrm;     .     .     .    sdata = atoarrayf(instrm, &points, &maxvalf);    	/* or */    sdata = (float *) atoarray(instrm, FLOAT, &points, &maxvald);    /*     * process data in sdata     */.fi.SH DIAGNOSTICSThe functions will an assertion failure and a diagnostic message if any ofthe following are true:.PPThe function is unable to allocate sufficient memory..PPA NULL pointer is passed for  .I strmor.I nvalues..PPA NULL pointer is passed to.I atoarrayffor.I max..PPAn illegal value is passed to.I atoarrayfor.I type..PPThe function encounters an illegal format in the input..PP.I atoarrayfinds an odd number of real input values while reading complex data..SH BUGSNone known..SH "FUTURE CHANGES"Version of.I atoarraythat will read into a user-supplied data areaand will stop reading after a specified maximum number of elements..SH SEE ALSO\fIaddstr\fP (3\-\s-1ESPS\s+1), malloc(3c), free(3c)..SH AUTHOR.I atoarrayfand.I atoarraysby John Shore..I atoarrayby Rodney Johnson, based on.I atoarrayf.

⌨️ 快捷键说明

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