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

📄 sendxwaves2.3

📁 speech signal process tools
💻 3
字号:
.\" Copyright (c) 1995, Entropic Research Lab, Inc..\" @(#)SendXwaves.3	1.1 16 Nov 1995 ERL.TH "SEND_XWAVES" 3\-ESPSu 16 Nov 1995.ds ]W "\fI\s+4\ze\h'0.05'e\s-4\v'-0.4m'\fP\(*p\v'0.4m'\ Entropic Speech, Inc..SH "NAME"OpenXwaves \- open a connection to an \fIxwaves+\fR server.brSendXwavesNoReply \- send a command to an \fIxwaves+\fR server and do not wait for reply.brSendXwavesReply \- send a command to an \fIxwaves+\fR server and  wait for reply.brCloseXwaves \- close a connection to an \fIxwaves+\fR server.SH "SYNOPSIS".ft B.nf#include <esps/esps.h>#include <esps/xwaves_ipc.h>.spSxptr *OpenXwaves(display_name, destination, my_name)char *display_name;char *destination;char *my_name;.spintSendXwavesNoReply(display_name, destination, sxarg, message)char *display_name;char *destination;Sxptr *sxarg;char *message;.spchar *SendXwavesReply(display_name, destination, sxarg, message, timeout)char *display_name;char *destination;Sxptr *sxarg;char *message;unsigned int timeout;.spvoidCloseXwaves(sxarg)Sxptr *sxarg;.fi.ft R.sp.SH "DESCRIPTION".PP.PP.I Xwaveshas an interprocess communications capability, based on communicating through the X server.  This communications method is compatible with Tcl/Tk (version 4).   When \fIxwaves\fR starts, it registers itself with the X server that it is using for display.   Programs using these functions can send commands to \fIxwaves\fR and get the results of those commands back..PPIn addition to this man page, see the Application Note, "Communicating with .I xwaves from Tcl/Tk, C, and the Unix shell".   This application note gives details about how this communications works.The function .I SendXwavesReply cannot be used from within an X program.  See the above mentioned application note for an example of how to work around this limitation..PP.I OpenXwavesattempts to setup a communications path to the \fIxwaves\fR that has previously registered itself under the name \fIdest\fR, on either the default X server, or one specified by \fIdisplay_name\fR.   The argument\fImy_name\fR can be set to the name that the calling application is to be registered as, or it can be NULL and a default name will be supplied.If successful, then the function returns a pointer to a structure of type \fBSxptr\fR, which contains information needed by subsequent calls to \fISendXwavesReply\fR and \fISendXwavesNoReply\fR.  If the function fails,then NULL is returned.   The name that the application registers as must be unique to all applications registered for communications,so the actual name used might be different than the name supplied through\fImy_name\fR.  The actual name used is stored in the \fISxptr\fR structurereturned as \fISxptr.my_name\fR..PPIn most cases, the registered name of an \fIxwaves\fR application is \fIxwaves\fR, but it might be different if it had to be changed in order to be unique.   This is rarely the case, however, since it would be unusual to run two or more \fIxwaves\fR on the same X display.  However, you mightneed to provide a way for an application program to be given the name ofthe correct \fIxwaves\fR.Note that the registered name of an \fIxwaves\fR is given in parenthesis in the title bar of the control panel and is exported intothe environment under the variable name \fBXWAVES_NAME\fR.This environment variable can be used by an application that is launchedby \fIxwaves\fR (from a menu addop for example)..PPIf \fIdisplay_name\fR is NULL, then the default X server is used (the one specified by the environment variable \fBDISPLAY\fR.   If \fIdisplay_name\fR is not NULL, then it should point to a character string that specifies anX server in the usual format, \fIhost:display.screen\fR.   Of course, the application using this function must have access permission to the Xserver..PP.I SendXwavesNoReplyattempts to send a message to an \fIxwaves\fR application and does not wait for a reply.There are two forms of usage of this function.  One is to use \fIOpenXwaves\fRfirst, and pass its return value in as \fIsxarg\fR.This form should be used when frequent messages aresent to \fIxwaves\fR.  Since the communications is setup only once, overheadis kept to a minimum.  The other form of usage, is to specify the destination \fIxwaves\fR with \fIdisplay_name\fR and \fIdest\fR, just asis done with \fIOpenXwaves\fR, but in this case the communications is setupinside of \fISendXwavesNoReply\fR and is closed after the message is sent.In this case, the argument \fIsxarg\fR must be NULL.  This form is simply provided for convenience and eliminates two additional calls (\fIOpenXwaves\fRand \fICloseXwaves\fR).This function returns zero if an error occurred and the message was not sent.  Otherwise, the return value is non-zero.   However, a non-zero return valuedoes not guarantee that the message was received by \fIxwaves\fR orcorrectly processed by it..PP.I SendXwavesReplyattempts to send a message to an \fIxwaves\fR application and waits for aresponse.   The return is a character pointer to the response, or NULL if thefunction was not able to send the message.    A timeout in millisecondsis specified by the \fItimeout\fR argument.  If this timeout expires beforea response is received, then NULL is returned.   The minimum timeout (if zerois specified) is 1 ms.   An appropriate timeout is much larger, usually  tens of seconds, but it could be more depending upon the nature of thedata and the operations being performed. A typical use of this function would be to return the value of an \fIxwaves\fRglobal, or to return attributes of views..PP.I CloseXwavesis used to close a connection to an \fIxwaves\fR.  It is only used whena connection has been opened with \fIOpenXwaves\fR.  The function removesthe calling application from the communications registry and frees memoryassociated with the connection..fi.SH DIAGNOSTICS.PP.I OpenXwavesreturns NULL if it fails.  The reasons for failure include, failure to connect to the X server, failure to create a simple window to be used forcommunications, failure to allocate memory when required,and failure to find the application specified by \fIdest\fR..PP.I SendXwavesNoReplyreturns 0 if it fails and non-zero upon success.   Reasons for failure arethe same as above..PP.I SendXwavesNoReplyreturns 0 if it fails and non-zero upon success.   In addition to the abovereasons why it might fail, it will return 0 if the timeout expires beforea response is received from \fIxwaves\fR..PP.I CloseXwavesdoes not return a value.   It quietly does nothing if \fIsxarg\fR is NULL.If passed garbage it (and most other Unix functions) could cause a program failure (core dump)..SH "SEE ALSO".PPsend_xwaves(1\-\s-1ESPS\s+1).SH "AUTHOR".PPAlan Parker, based on the idea and some code from Tk by John Ousterhout.

⌨️ 快捷键说明

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