findespsfi.3
来自「speech signal process tools」· 3 代码 · 共 161 行
3
161 行
.\" Copyright (c) 1993 Entropic Research Laboratory, Inc.; All rights reserved.\" @(#)findespsfi.3 1.10 24 Sep 1997 ERL.TH FIND_ESPS_FILE 3\-Eu 24 Sep 1997.SH NAMEfind_esps_file \- finds full path to an ESPS or waves+ file..SH SYNOPSIS.nf#include <esps/esps.h>char *find_esps_file(fullpath,filename,defpath,env_var_name)char* fullpath;char* filename; char *defpath;char *env_var_name.fi.SH DESCRIPTION.PPLooks along a path for \fIfilename\fR. If the file is found and isreadable then return the the string containing the full Unix path tothe file. If the file is not found NULL is returned..PPEnvironment variables may also be used in the requested file.Variable \fBESPS_BASE\fR is treated specially (see below). An exampleof this would be:.nf find_esps_file(fullpath,"bin/$ARCH/xwaves",defpath,env_var_name);.fi.PPThe parameter \fIfilename\fR should the basename of the file to bediscovered. If \fIfilename\fR already specifies a full path (beginswith / or ./), then that path is returned (if it points to a readablefile). The parameter \fIfullpath\fRshould be a string large enough to hold the longest path on yoursystem, or NULL in which case a new string will be allocated andreturned containing the file path. You should deallocate the stringwhen you do not need it anymore. Parameter \fIfilename\fR (provided or anewly allocated) is returned..PPThe first two paramaters may be the same string. However, rememberthat it is \fBVERY\fR important that the string be large enough tohold the resulting path. .PPParameter \fIdefpath\fR specifies the default search path. Thesyntax of the search path (just like Unix) is given below..PPThe default search path can be overridden by the environment variablespecified in \fBenv_var_name\fR. If the environment variable specifiedby \fBenv_var_name\fR is not set, or cannot be parsed thenthe default file path (as specified by \fIdefpath\fR ) is used..PPThe syntax of the search path is a colon separated list ofdirectories; just like the normal Unix path. An example path is:.PP.nf $ESPS_BASE/bin:/usr/local/bin/$ARCH:/usr/esps/demo:$HOME/esps/bin.fiEnvironment variables may be used in the path by prefixing themwith a $ sign. The value of environment variable \fBESPS_BASE\fR isretrieved by calling \fIget_esps_base\fR(3\-\s-1ESPSu\s+1) . If theenvironment variable is not set then it is replaced in the pathwith nothing..SH EXAMPLES.nf/* provide string */char datafile[255];(void) find_esps_file(datafile,"speech.sd","/usr/esps/bin:/usr/esps/demo","ESPS_PATH"); /* allocate new string */char *datafile;datafile = find_esps_file(NULL,"speech.sd","/usr/esps/bin:/usr/esps/demo","ESPS_PATH"); .fi.SH CONVIENENCE MACROS.PPSeveral macros are provided in include file $ESPS_BASE/include/esps/epaths.h. They provide standard environment variables to specify paths andstandard default paths if the standard environment variable is notset..PPParameter \fIa\fR is the string to fill the path in (or NULL)(corresponds find_esps_file(3) parameter \fIfullpath\fR).Paramater \fIb\fR is the file desired (corresponds to \fIfind_esps_file\fR(3)parameter \fBfilename\fI)..PPFIND_ESPS_MENU(a,b) \- find ESPS menu files. .PPFIND_ESPS_BIN(a,b) \- find ESPS executable files..PPIFIND_ESPS_PARAM_FILE(a,b) \- find ESPS paramater files..PPFIND_ESPS_FILTER(a,b) \- find ESPS filter files..PPFIND_ESPS_LIB(a,b) \- search for files in the ESPS library..PPFIND_ESPS_INPUT(a,b) \- search for ESPS input files..PPFIND_WAVES_INPUT(a,b) \- search for waves+ input files..PPFIND_WAVES_LIB(a,b) \- search for files in the waves+ librarydirectory..PPFIND_WAVES_COMMAND(a,b) \- find waves+ command files..PPFIND_WAVES_MENU(a,b) \- find waves+ menu files..PPFIND_WAVES_COLORMAP(a,b) \- find waves+ colormaps..PPFIND_WAVES_PROFILE(a,b) \- find a waves profile ..PPFIND_FAB2_BIN(a,b) \- find FAB2 board binaries..PPFIND_SURF_BIN(a,b) \- find Surf board binaries..PP.SH ERRORS AND DIAGNOSTICS.PPNone. Always returns something unless too small a string is providedwhich could cause problems if other memory addresses are overwritten..SH FUTURE CHANGES.PPMake environment variable handling match the way the shell handlesthem. Things like ${foobar}, etc... ..SH BUGS.PPIf the user provided string is too small then who knows what will happen..SH REFERENCES.PPNone..SH "SEE ALSO".PP.nf\fIget_esps_base\fP(3\-\s-1ESPSu\s+1), \fIget_esps_base\fP(1\-\s-1ESPS\s+1), \fIfind_esps_file\fP(1\-\s-1ESPS\s+1), \fIbuild_filename\fP(3\-\s-1ESPS\s+1).fi.SH AUTHORKen Nelson wrote the routine and the man page..PP
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?